Timer Repeat
#5

Try this:

pawn Код:
forward Haz_Timer();

public Haz_Timer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            if(GetPVarInt(i, "VehLightStatus") > 0)
            {
                SetVehicleParamsEx(GetPlayerVehicleID(i),engine,0,alarm,doors,bonnet,boot,objective);
                SetPVarInt(i, "VehLightStatus", 0);
            }
            else
            {
                SetVehicleParamsEx(GetPlayerVehicleID(i),engine,1,alarm,doors,bonnet,boot,objective);
                SetPVarInt(i, "VehLightStatus", 1);
            }
        }
    }
    return 1;
}

dcmd_hazards(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new veh = GetPlayerVehicleID(playerid);
        SetVehicleParamsEx(veh,engine,1,alarm,doors,bonnet,boot,objective);
        SetPVarInt(playerid, "VehLightStatus", 1);
        return 1;
    }
    return 0;
}
EDIT:

You should also put this:

pawn Код:
SetTimer("Haz_Timer", 500, true);
Under:

pawn Код:
OnGameModeInit()
Reply


Messages In This Thread
Timer Repeat - by wilko1995 - 06.01.2011, 03:41
Re: Timer Repeat - by Krx17 - 06.01.2011, 03:46
Re: Timer Repeat - by wilko1995 - 06.01.2011, 03:53
Re: Timer Repeat - by Retardedwolf - 06.01.2011, 04:10
Re: Timer Repeat - by Whizion - 06.01.2011, 04:16

Forum Jump:


Users browsing this thread: 1 Guest(s)