Welcome Guest [Log In] [Register]
Add Reply
Stoping signing off and right back on
Topic Started: Jan 18 2010, 03:45 AM (157 Views)
Lil-Poison

This was a script made by me to stop people from signing on and off really fast. Namely: people signing on and off after an ignore.

Comments in code, nothing needs to be set, you can just put the script in and run it.

Code:
 
Event -PlayerSignOn
//Check signoff array for recently signed off players

/Set #Temp, 0
:SignOffcheck
/Inc #Temp
If $GetValue("Sign_Off_" & $Str(#Temp)) = ""
GoTo SkipSignOffcheck
//If there is no recent signoffs, or the array has ended, the script moves on.
Else
If $GetPlayerinfo(#Source, PSID) == $Left($Getvalue("Sign_Off_" & $Str(#Temp)), 20)
/SendPM #Source, "*** You have recently signed off. You must wait " & $Right($Getvalue("Sign_Off_" & $Str(#Temp)), 2) & " seconds till you can rejoin."
/Kick #Source
/? "Player Kick: User " & $Name(#Source) & " has been kicked. Reason: Signed off less than 20 seconds ago."
//If the person recently signed off, they are kicked. The /? $Msg lets the server know why the player was kicked.
EndIf
GoTo SignOffcheck
//Repeat loop
EndIf
:SkipSignOffcheck
//End of signoff/signon prevention
EndEvent

Event -PlayerSignOff
//Adding player to the signoff array.
//Does not apply to auth.
If #Getplayerinfo(#Source, AUTH) > 0
GoTo ExitLoop
EndIf
//The three lines below were added for:
// A) less lines
// B) prevents arrays from stacking (if the person is kicked from the arraycheck, they have to start over
//again. this prevents this.
If #IsIn($Getvalue("SignedOff"), "**" & $GetPlayerinfo(#Source, PSID)) > 0
GoTo Exitloop
EndIf
//Below checks the array for the empty slot and adds the player to the array
/Set #Temp, 0
:Emptyarray
/Inc #Temp
If $GetValue("Sign_Off_" & $Str(#Temp)) = ""
/SaveValue "Sign_Off_" & $Str(#Temp), $GetPlayerInfo(#Source, PSID) & "_20"
//If you want to change the time duration, change "20" to any double-digit number
//If you want to use single digit numbers, put a 0 in front of it. i.e. 04 05 etc
/Savevalue "SignedOff", $Getvalue("SignedOff") & "**" & $GetPlayerinfo(#Source, PSID)
Else
GoTo Emptyarray
EndIf
:Exitloop
//End adding to array
EndEvent

Event Timer 1
//Event Timer 1 does not lag you. At all
//The purpose of this is to decrement the time between signing on and off. This is basically the time keeper.
/Set #Temp, 0
:NOnigga
/Inc #Temp
If $GetValue("Sign_Off_" & $Str(#Temp)) = ""
GoTo SkipSignOffdecrement
Else
/Savevalue "Sign_Off_" & $Str(#Temp), $Left($GetValue("Sign_Off_" & $Str(#Temp)), 21) & $Right("0" & $Str(#Val($Right($GetValue("Sign_Off_" & $Str(#Temp)), 2)) - 1), 2)
If $Right($GetValue("Sign_Off_" & $Str(#Temp)), 2) = "00"
/Savevalue "SignedOff", $Replace($GetValue("SignedOff"), "**" & $Left($GetValue("Sign_Off_" & $Str(#Temp)), 20), "")
//The loop below is to fill in the empty array. having empty array spots fucks up the script. This prevents that
/Set #TempA, #Temp - 1
/Inc #Temp, -1
:Itsjoe
/Inc #TempA
/Savevalue "Sign_Off_" & $Str(#TempA), $GetValue("Sign_Off_" & $Str(#TempA + 1))
If $GetValue("Sign_Off_" & $Str(#TempA + 1)) <> ""
GoTo Itsjoe
Endif
GoTo NOnigga
EndIf
GoTo NOnigga
EndIf
:SkipSignOffdecrement
//End time keeper
EndEvent


This is just a plug and run script. nothing needs to be set.

Edit: Just a note, /Exits are NOT used here. This is because you will most likely have other scripts in your server besides this one. The exit loops allow the script to keep running.
Edited by Lil-Poison, Jan 18 2010, 03:47 AM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Create your own social network with a free forum.
« Previous Topic · Netbattle Discussion · Next Topic »
Add Reply