Quote:
Originally Posted by jakejohnsonusa
Ok so for some reason this timer isn't being killed when the player does /dispatch off (It turns on fine with /dispatch on). Does anyone see somthing I am doing wrong? I have no compile errors.
I have added these in the right spots BTW:
forward DispatchAlert(playerid);
new DispatchAlertVar[MAX_PLAYERS];
Here is the command code:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(playerid) && IsACop(playerid) || IsAFiremen(playerid)) { DispatchAlertVar[playerid] = SetTimerEx("DispatchAlert",10000,true, "i", playerid); } } }
|
the problem is caused because you put the timer in a loop which is creating MAX_PLAYERS amount of timers, your /dispatch off would only stop one so you'd still have MAX_PLAYERS - 1 amount of timers still running