20.11.2012, 02:03
Ok so I decided to create a command in my GM that acts as hazard lights. What it does it constantly turn the lights on and off when someone does /hazard. But I am trying to get it where /hazard turns it on AND off. How do I do this? Please tell me what to add so that /hazard will both set the timer to on if its off and kill the timer if it's is on.
Thanks,
jakejohnsonusa
Here is what I have so far:
And for the flashers timer:
**I do have the defined things and it compiles and works, all I need is to make it where /hazard will also turn it off once it's on***
Thanks,
jakejohnsonusa
Here is what I have so far:
pawn Код:
if(!strcmp(cmd, "/hazard", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
flashers1 = SetTimer("Flashers", 1000, true);
}
}
}
pawn Код:
public Flashers ()
{
new playerid;
new newcar = GetPlayerVehicleID(playerid);
ToggleVehicleLights(newcar)
return 1;
}