[HELP] timer won't destroy(kill)
#1

Hello I make something about call with timer and know when I hangup(/h) then timer timer supose to kill but it doesn't it stay if you know what I mean? I use KillTimer(call[playerid]);
Reply
#2

Do you have this code under the command /h?
pawn Код:
call[playerid] = 0;
Reply
#3

You should use the method below to destroy a SA:MP timer, at least this is how I've always done it
This should work:
Код:
new YourTimerName;
YourTimerName = SetTimer("YourTimerCallback", 1000, true); //Replace these arguments 
KillTimer(YourTimerName);
Reply
#4

Nah, it's best to do it per player incase you want to set timers for players.

pawn Код:
new YourTimerName[MAX_PLAYERS];
YourTimerName[playerid] = SetTimerEx("YourTimerCallback", 1000, true, "i", playerid); //if YourTimerCallback has a parameter like public YourTimerCallback(playerid).
KillTimer(YourTimerName[playerid]);
Reply
#5

Oopsie, I misread his above post, I didn't realize it was for a certain player, it's 1:34 AM here and I'm extremely tired, but your code would work just as-well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)