Problem Timer - 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: Problem Timer (
/showthread.php?tid=402831)
Problem Timer -
cotyzor - 28.12.2012
Sometime my timer called "AntiCheat" doesn't start ... I create a special command to start timer, but still doesn't work
Код:
if(!strcmp(cmdtext, "/restartacheat42s", true))
{
SetTimer("anticheat", 100, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Anti cheat has been restarted.");
return 1;
}
Re: Problem Timer -
Grim_ - 28.12.2012
Read up the documentation on SetTimer. Two possible problems, 1) the name of the function needs to be case specific 2) you only call the function once. If you want the timer to repeat, pass 1 or "true" for the third parameter.
Re: Problem Timer -
cotyzor - 28.12.2012
1) I checked and it's correct
2)
Код:
public OnGameModeInit()
{
SetTimer("anticheat",1000,true);
}
forward anticheat();
public anticheat()
{
}