15.07.2010, 13:25
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
new Number=0;
SetTimer("YourTimer", 20000, 1); //Timer gets called every 20 secs
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;
}