Problem killing timer
#3

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
Reply


Messages In This Thread
Problem killing timer - by jakejohnsonusa - 23.04.2013, 20:46
AW: Problem killing timer - by HurtLocker - 23.04.2013, 20:53
Re: Problem killing timer - by cessil - 23.04.2013, 20:56
AW: Problem killing timer - by HurtLocker - 23.04.2013, 21:00
Re: Problem killing timer - by jakejohnsonusa - 23.04.2013, 22:09

Forum Jump:


Users browsing this thread: 1 Guest(s)