Checking if a timer is running?
#1

How would I do so? By assigning it a value like so?

pawn Code:
new Timer1;

Timer1 = SetTimerEx( "Test1", 10000, false );

if(Timer1 == -1)
{
}
would that work? :3
Reply
#2

When the timer ends, the variable will still contain the timer's ID, so no, it won't work.

Let's see..

pawn Code:
new timer;

blahblah = SetTimerEx(..)
timer++;

public thetimerfunction(..)
{
    // Blah blah
    timer--;
}

// Check if running
if(timer) // Timer is running
You should bare in mind that you can have two timers running at once, the same function, so you don't want =1 or =0 you want ++ and --.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)