SA-MP Forums Archive
Timer problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timer problem (/showthread.php?tid=235440)



Timer problem - DaneAMattie - 05.03.2011

Hello people,

I have the following code:

pawn Код:
new PlayerTimer[MAX_PLAYERS];

PlayerTimer[playerid] = SetTimerEx("MoveObject", 50, 1, "i", playerid);
oke so the first time it works and when i enable the timer again it wont work anymore :S

in the timer function i have this code to stop the timer:
pawn Код:
if(key1 == KEY_FIRE && scanactive[playerid] != 0)
    {
KillTimer(PlayerTimer[playerid]);
        PlayerTimer[playerid] = 0;
}
so the problem is that the first time there is no problem but when i call the timer again the timer just wont start :S i tested it with SendClientMessage