21.11.2012, 20:46
Ok so I have a timer that will make a cars headlights flash... but I seem to be having troubles with it. I can't seem to get the timer to stop (it starts, but wont stop with the command). What do I need to fix or do?
Here is my code:
And the timer command:
Here is my code:
pawn Код:
if(!strcmp(cmd, "/hazard", true))//hazard lights
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new newcar = GetPlayerVehicleID(playerid);
if(CarFlasher[newcar] == 0)
{
CarFlasher[newcar] = SetTimer("Flashers", 1000, true);
CarFlasher[newcar] = 1;
}
if(CarFlasher[newcar] == 1)
{
KillTimer(CarFlasher[newcar]);
CarFlasher[newcar] = 0;
}
}
}
return true;
}
pawn Код:
public Flashers ()
{
new playerid;
new newcar = GetPlayerVehicleID(playerid);
ToggleVehicleLights(newcar)
return 1;
}