How to do this?
#1

I have this code wich is also workign eprfectly in-game,but there's only 1 problem:

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;
}
I want so if the engine is on when I press 1 again to send the emssage engine is turned off,not again on.
Reply


Messages In This Thread
How to do this? - by Cjgogo - 26.04.2011, 16:06
Re: How to do this? - by Cjgogo - 26.04.2011, 16:17
Re: How to do this? - by Cjgogo - 26.04.2011, 16:34
Re: How to do this? - by aircombat - 26.04.2011, 17:09

Forum Jump:


Users browsing this thread: 1 Guest(s)