Ко всем new добавим
Ишим OnPlayerExitVehicle Вставим
- Код:
new pLights[MAX_PLAYERS], bool:LightsOnOff[MAX_PLAYERS];
- Код:
SetTimer("Timer", 300, true);
- Код:
if(!strcmp("/blink", cmdtext, true, 7))
{
if(!LightsOnOff[playerid])
{
LightsOnOff[playerid] = true;
}
else
{
LightsOnOff[playerid] = false;
new vehicleid = GetPlayerVehicleID(playerid), panels, doors, lights, tires;
if(vehicleid != 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
}
}
return 1;
}
Ишим OnPlayerExitVehicle Вставим
- Код:
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
- Код:
forward Timer();
public Timer()
{
new p, vehicleid, panels, doors, lights, tires;
for(p = 0; p < MAX_PLAYERS; p++)
{
if(!IsPlayerConnected(p) || IsPlayerNPC(p)) continue;
{
vehicleid = GetPlayerVehicleID(p);
if(vehicleid != 0 && GetPlayerState(p) == PLAYER_STATE_DRIVER)
{
if(LightsOnOff[p])
{
if(pLights[p] != 1 && pLights[p] != 4)
{
pLights[p] = 1;
}
else
{
if(pLights[p] == 1)
{
pLights[p] = 4;
}
else
{
pLights[p] = 1;
}
}
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, pLights[p], tires);
}
}
}
}
return 1;
}