Timer continueing after disconnection - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer continueing after disconnection (
/showthread.php?tid=550616)
Timer continueing after disconnection -
MrViolence101 - 13.12.2014
Hey guys,
Im busy making make a /arrest command for cops in my server. If the cops arrest the suspect they must be sent to jail and if they disconnected after they were jailed the timer must be paused and if they reconnect the timer must continue. Can anyone present me with a piece of coding that does this please. Thanks in advance.
Re: Timer continueing after disconnection -
Abagail - 13.12.2014
This isn't a request forum, it's a scripting help and improvement forum. If you need a script done, then post somewhere else. This isn't the place.
Re: Timer continueing after disconnection -
Banana_Ghost - 13.12.2014
You need to save a variable for the jail time, use SetTimerEx to count down the jail time for the player, if they quit, kill the timer, and when they rejoin, OnPlayerSpawn if their jailtime is greater than 0, put them back in jail and start the timer again.