Help with timers
#7

Код:
  
if(!strcmp(cmd, "/hazard", true))//hazard lights
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                new newcar = GetPlayerVehicleID(playerid);
                if(CarFlasher[newcar] == 0)
                {
                    CarFlasher[newcar] = SetTimerEx("Flashers", 1000, true, "d", newcar);
                    CarFlasher[newcar] = 1;
                }
                if(CarFlasher[newcar] == 1)
                {
                    KillTimer(CarFlasher[newcar]);
                    CarFlasher[newcar] = 0;
                }
            }
        }
        return true;
    }
And this is the function:
Код:
forward Flashers(vehid);
public Flashers (vehid)
{
     ToggleVehicleLights(vehid);
    //your other code
    return 1;
}
Anyways, if you search there is already a filterscript about vehicle lights. Take a look at it and see how it was built, but don't just copy and paste, otherwise you will never learn.
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)