Help with timers
#10

pawn Код:
if(!strcmp(cmd, "/hazard", true))//hazard lights
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                new newcar = GetPlayerVehicleID(playerid);
                if(CarFlasher[newcar] == 0) // is flesher off
                {
                    CarFlasher[newcar] = SetTimer("Flashers", 1000, true); // CarFlasher[newcar] =  timerid
                    CarFlasher[newcar] = 1; // flesher on
                    return 1;
                }
                if(CarFlasher[newcar] == 1) // is flesher on
                {
                    KillTimer(CarFlasher[newcar]);//CarFlasher[newcar] = 1 NOT TIMER ID
                    CarFlasher[newcar] = 0; // flesher off
                    return 1;
                }
            }
        }
        return true;
    }
i hope this will help you to debug you code.
Reply


Messages In This Thread
Help with timers - by jakejohnsonusa - 21.11.2012, 20:46
Re: Help with timers - by ScRaT - 21.11.2012, 20:51
Re: Help with timers - by jakejohnsonusa - 21.11.2012, 21:08
Re: Help with timers - by Azazelo - 21.11.2012, 21:16
Re: Help with timers - by jakejohnsonusa - 21.11.2012, 21:32
Re: Help with timers - by ScRaT - 21.11.2012, 21:37
Re: Help with timers - by Dr.Einstein - 21.11.2012, 21:42
Re: Help with timers - by jakejohnsonusa - 21.11.2012, 21:48
Re: Help with timers - by jakejohnsonusa - 21.11.2012, 22:25
Re: Help with timers - by Azazelo - 21.11.2012, 23:54

Forum Jump:


Users browsing this thread: 1 Guest(s)