26.04.2011, 08:24
I made this engine system:
No compiling errors,and in game it's working,only 1 bug that all the chat is spammed with:"press 2 to turn engine on." How to solve that?
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ToggleEngine(playerid);
SendClientMessage(playerid,GREEN,"Press 2 to turn the engine on");
}
if((newkeys == KEY_SUBMISSION) && (IsPlayerInAnyVehicle(playerid)))
{
ToggleEngine(playerid);
SendClientMessage(playerid,BLUE,"The engine is turned on");
}
return 1;
}