12.12.2009, 01:03
How would you add a command that by using the shift key or what ever that it does what ever i want it to?
if (PRESSED(KEY_JUMP)) { if(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 { TogglePlayerControllable(playerid,0); EngineStatus[GetPlayerVehicleID(playerid)] = 0; PlayerActionMessage(playerid,15.0,"turns off the engine"); } } }
if (PRESSED(KEY_JUMP)) { if(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"); return 1; } else { TogglePlayerControllable(playerid,0); EngineStatus[GetPlayerVehicleID(playerid)] = 0; PlayerActionMessage(playerid,15.0,"turns off the engine"); return 1; } } }
if (PRESSED(KEY_JUMP)) { if(IsPlayerInAnyVehicle(playerid)) { if(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 { EngineStatus[GetPlayerVehicleID(playerid)] = 0; PlayerActionMessage(playerid,15.0,"turns off the engine"); } } }
// PRESSING(newkeys, keys)
#define PRESSING(%0,%1) \
(((%0) & (%1)) == (%1))
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");
}
}