PDA

View Full Version : Timer ID stored in a variable gets wiped when timer hits ?


NeXoR
25/03/2017, 07:18 PM
Lets say I have something like this:

new TimerID = SetTimer("BlaBla", 1000, 0);
BlaBla();

BlaBla()
{
if(TimerID) // If the timer ID is still stored in the variable > the timer wasnt executed yet
{
KillTimer(TimerID);
// blablabla
}
}

If I call a timer, and store it's ID in a variable
When the function of the Timer is called (Timer is finished)
The Timer ID is still stored in the variable ?

Mencent
25/03/2017, 07:19 PM
Hello!

When the timer is finish you needn't kill the timer because it is still killed. ;)

NeXoR
25/03/2017, 07:22 PM
Nevermind Solved
I just switched the Timer ID variable in a function local variable