how to make killtimer - 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: how to make killtimer (
/showthread.php?tid=251124)
how to make killtimer -
sMog. - 25.04.2011
i need to make kill timer
onfilterscriptinit i got this
SetTimer("GiveScore", 60000, true);
then if someone types /afk there is this
KillTimer(GiveScore); // i get error error 076: syntax error in the expression, or invalid function call
then if someone types /afk again there is
SetTimer("GiveScore", 60000, true);
and public is
forward GiveScre;
public GiveScore()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
SetPlayerScore(i, GetPlayerScore(i) + 1);
}
}
}
Re: how to make killtimer -
Cypress - 25.04.2011
You need to name the timer.
example
pawn Код:
new timer;
timer = SetTimer(...
KillTimer(timer);
//other example with your script
new ScoreTimer;
ScoreTimer = SetTimer("GiveScore", 60000, true);
KillTimer(ScoreTimer);
forward GiveScore;
public GiveScore()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
SetPlayerScore(i, GetPlayerScore(i) + 1);
}
}
}
Also when you post something that is related with pawn use the above tags [pawn] [/ pawn] so we can see clearly your pawn code.
Re: how to make killtimer -
sMog. - 25.04.2011
thanks i try
thanks it worked