SA-MP Forums Archive
How to do this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to do this? (/showthread.php?tid=251336)



How to do this? - Cjgogo - 26.04.2011

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.


Re: How to do this? - Cjgogo - 26.04.2011

well?


Re: How to do this? - Cjgogo - 26.04.2011

0 REPLIES < 16 VIEWS


Re: How to do this? - aircombat - 26.04.2011

post the "ToggleEngine" stock