06.01.2011, 04:16
Try this:
EDIT:
You should also put this:
Under:
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;
}
You should also put this:
pawn Код:
SetTimer("Haz_Timer", 500, true);
pawn Код:
OnGameModeInit()