25.03.2012, 13:05
pawn Код:
forward OnPlayerStateChange(playerid,newstate,oldstate);
public OnPlayerStateChange(playerid,newstate,oldstate){
{
if (newstate==PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY,"You entered a vehicle, drive safely!");
SendClientMessage(playerid,COLOR_GREY,"Type /engine & /lights to switch them on and off.");
}
}
return 1;
if(newstate == PLAYER_STATE_ONFOOT)
{
if(GetPVarInt(playerid,"Lights")>0)
{
SetPVarInt(playerid,"Lights",0);
if(IsValidObject(GetPVarInt(playerid,"Siren1")))
{
DestroyObject(GetPVarInt(playerid,"Siren1"));
}
if(IsValidObject(GetPVarInt(playerid,"Siren2")))
{
DestroyObject(GetPVarInt(playerid,"Siren2"));
}
}
}
return 1;
}
