timer help
#1

how to make a timer switch some items not random like 1 - 2 - 3 - 4 - 5 - 6 - 7 then when timer go to 7 start to 1 and make again 1 - 2 - 3 - 4 - 5 - 6 - 7 in progressive
Reply
#2

At TOP of your script:
pawn Код:
new Number=0;
Where you want to start the Timer (Mostly at OnGameModeInit):
pawn Код:
SetTimer("YourTimer", 20000, 1); //Timer gets called every 20 secs
The Function:
pawn Код:
forward YourTimer();
public YourTimer()
{
    switch(Number)
    {
    case 0: { SendClientMessageToAll(0xFFFFFFFF, "Case 0!"); Number++; }
    case 1: { SendClientMessageToAll(0xFFFFFFFF, "Case 1!"); Number++; }
    //....
    case 7: { SendClientMessageToAll(0xFFFFFFFF, "Case 7!"); Number=0; } // Make "=0" at the LAST case.
    }
    return 1;
}
I hope this helps you.

Greetz,
Jeffry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)