SA-MP Forums Archive
How to.. - 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.. (/showthread.php?tid=197446)



How to.. - admantis - 09.12.2010

How to know a Timer ID?

So i can KillTimer it :S


Re: How to.. - Lynn - 09.12.2010

new Timer;
Timer = SetTimer();
KillTimer(Timer);

That may not be correct. Doing it strictly from memory, haven't used pawn in a while. A bit rusty xD
You can change,
new Timer; to what ever name.
Then just do, KillTimer(NameYouChoose);


Re: How to.. - admantis - 09.12.2010

Ermm... Both things didn't worked


Re: How to.. - Lynn - 09.12.2010

What does your current code look like?


Re: How to.. - admantis - 09.12.2010

Up of all..
Код:
forward JobCash(playerid);
In a callback..
Код:
JobCash = SetTimerEx("CashJob",5000,true,"i",playerid);
In another callback
Код:
KillTimer(JobCash);  // Here is an error



Re: How to.. - Basicz - 09.12.2010

Quote:
Originally Posted by Lynn
Посмотреть сообщение
new Timer;
Nah, in your code you used forward for the timer name.


Re: How to.. - Voldemort - 09.12.2010

pawn Код:
forward JobCash(playerid);

new PlayerJobTimer[MAX_PLAYERS];


PlayerJobTimer[playerid] = SetTimerEx("JobCash",5000,true,"i",playerid);


public JobCash(playerid)
{
//Here
}

KillTimer(PlayerJobTimer[playerid]);