Killing false timers
#1

Hi,

I have some timer with false that will be complete only once. And i have variable where i write that timer id. So when timer completes, i make that variable = -1, so that timer is disappear when it calls in public end?
Reply
#2

If you set repeating to false (or 0), it will not run a second time. You will have to set the variable to -1 yourself, but the timer is automatically destroyed.
Reply
#3

Yes, i set variable in public inside, but i need know deeper when timer id is destroyed, because i have like that

Код:
if( variablettimer != -1 )
{
KillTimer(  variablettimer);
 variablettimer = -1;
}
So this can kill new timer, if it instantly get created and it ID match with variablettimer
Reply
#4

No need, timer IDs are always unique, and the initial value doesn't reset on gmx.

Setting the variable to -1 will do nothing, timers that aren't set to repeat run once and get killed. Use KillTimer to stop timers at any time, mostly for timers that repeat.

http://forum.sa-mp.com/showpost.php?...6&postcount=12
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)