26.04.2011, 16:06
I have this code wich is also workign eprfectly in-game,but there's only 1 problem:
I want so if the engine is on when I press 1 again to send the emssage engine is turned off,not again on.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
ToggleEngine(playerid);
SendClientMessage(playerid,GREEN,"Press 2 to turn the engine on");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == KEY_SUBMISSION) && (IsPlayerInAnyVehicle(playerid)))
{
ToggleEngine(playerid);
SendClientMessage(playerid,BLUE,"The engine is turned on");
}
return 1;
}