Keystroke Commands?
#9

Try this:
pawn Код:
// PRESSING(newkeys, keys)
#define PRESSING(%0,%1) \
    (((%0) & (%1)) == (%1))
pawn Код:
if(PRESSING(newkeys, KEY_SPRINT) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
         if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
        {
            TogglePlayerControllable(playerid,1);
            EngineStatus[GetPlayerVehicleID(playerid)] = 1;
            PlayerActionMessage(playerid,15.0,"turns on the engine");
        }
        else if(EngineStatus[GetPlayerVehicleID(playerid)] == 1)
        {
            TogglePlayerControllable(playerid,0);
            EngineStatus[GetPlayerVehicleID(playerid)] = 0;
            PlayerActionMessage(playerid,15.0,"turns off the engine");
        }
    }
Reply


Messages In This Thread
Keystroke Commands? - by External-Life - 12.12.2009, 01:03
Re: Keystroke Commands? - by Zeex - 12.12.2009, 01:14
Re: Keystroke Commands? - by External-Life - 12.12.2009, 01:38
Re: Keystroke Commands? - by External-Life - 12.12.2009, 02:10
Re: Keystroke Commands? - by External-Life - 14.12.2009, 12:44
Re: Keystroke Commands? - by Damon_Black - 14.12.2009, 13:07
Re: Keystroke Commands? - by Deat_Itself - 14.12.2009, 13:21
Re: Keystroke Commands? - by External-Life - 16.12.2009, 00:12
Re: Keystroke Commands? - by Chaprnks - 16.12.2009, 01:18

Forum Jump:


Users browsing this thread: 1 Guest(s)