SA-MP Forums Archive
Timers - 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: Timers (/showthread.php?tid=357242)



Timers - CoDeZ - 06.07.2012

Fast question , why at most of game modes , when a timer is created , you have to use Killtimer on gamemodeexit?
Wouldn't it already kill it self?
Explain it please.


Re: Timers - .FuneraL. - 06.07.2012

pawn Код:
// Top of GM

new TimerKilling;

// Timer

TimerKilling = SetTimerEx(....);

// OnGameModeExit

KillTimer(TimerKilling);
To kill the timer, you have to define a variable.



Re: Timers - CoDeZ - 06.07.2012

i know , the question is , why on gamemodeexit i have to kill it?


Re: Timers - .FuneraL. - 06.07.2012

From what I read of his doubts OnGameModeExit you said, but you can kill him in any public.


Re: Timers - [KHK]Khalid - 06.07.2012

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
// Top of GM

new TimerKilling;

// Timer

TimerKilling = SetTimerEx(....);

// OnGameModeExit

KillTimer(TimerKilling);
To kill the timer, you have to define a variable.
He's asking why not how!

@ Question: Yes, I think it gets killed already on exit. So you don't have to kill it OnGameModeExit (That's how all my codes go, I never had to kill a timer on exit).


Re: Timers - LaGrande - 06.07.2012

if u are going to change a gamemode like /rcon changemode then if the timer isn't killed or stopped then it will be running. But i donot kill timers but yes if it is related to players like SetTimer used at OnPlayerConnect then i destroy or kill it at OnPlayerDisconnect.
That's what all i know