SA-MP Forums Archive
Doubt???? - 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: Doubt???? (/showthread.php?tid=621225)



Doubt???? - bugmenotlol - 08.11.2016

how to make a timer that stops on player disconnect and continue on player connect ??


Re: Doubt???? - Micko123 - 08.11.2016

First you make timer
Then you do this
PHP код:
new Timer1[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
Timer1[playerid] = SetTimerEx(blah blah blah);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(Timer1[playerid])
    return 
1;