Killing a timer on repeat.
#6

Example
pawn Code:
new
    Timer,
    TimerCount = 0; // Sets the timer count to zero.
CMD:start(playerid,params[])
{
    Timer = SetTimer("YourFunction",5000,true); // Repeats a timer of 5 seconds
    return 1;
}

forward YourFunction();
public YourFunction() // Every 5 seconds....
{
    TimerCount++; // Timer count is added. The Timer will repeat itself until it matched the below if statement.
    if(TimerCount == 5) // If the timer has been repeated five times.
    {
        KillTimer(Timer); // Then kill the timer.
        return 1;
    }
}
Reply


Messages In This Thread
Killing a timer on repeat. - by Robert_Crawford - 01.03.2012, 17:06
Re: Killing a timer on repeat. - by [XST]O_x - 01.03.2012, 17:19
Re: Killing a timer on repeat. - by Robert_Crawford - 01.03.2012, 17:28
Re: Killing a timer on repeat. - by aco_SRBIJA - 01.03.2012, 17:32
Re: Killing a timer on repeat. - by Robert_Crawford - 02.03.2012, 01:21
Re: Killing a timer on repeat. - by Walsh - 02.03.2012, 01:28
Re: Killing a timer on repeat. - by Robert_Crawford - 02.03.2012, 02:15
Re: Killing a timer on repeat. - by Walsh - 02.03.2012, 02:43
Re: Killing a timer on repeat. - by Robert_Crawford - 02.03.2012, 03:55
Re: Killing a timer on repeat. - by Walsh - 02.03.2012, 04:05

Forum Jump:


Users browsing this thread: 1 Guest(s)