Key bind
#1


How can i make a command which will be /engine so we can start the engine, in to a key like CTRL or something?

Here is the command:

pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
          if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
            {
                TogglePlayerControllable(playerid,1);
                EngineStatus[GetPlayerVehicleID(playerid)] = 1;
                if(PlayerInfo[playerid][pSex] == 1)
                {
                    PlayerActionMessage(playerid,15.0,"has just started the engine of his vehicle.");
                }
                else
                {
                    PlayerActionMessage(playerid,15.0,"has just started the engine of her vehicle.");
                }
            }
            else
            {
                TogglePlayerControllable(playerid,0);
                EngineStatus[GetPlayerVehicleID(playerid)] = 0;

                if(PlayerInfo[playerid][pSex] == 1)
                {
                    PlayerActionMessage(playerid,15.0,"has just stopped the engine of his vehicle.");
                }
                else
                {
                    PlayerActionMessage(playerid,15.0,"has just stopped the engine of her vehicle.");
                }
            }
        }
        else
        {
          SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[ERROR:] You are not even in a car!");
        }
        return 1;
    }
Reply


Messages In This Thread
Key bind - by Mrkrabz - 27.02.2009, 10:40
Re: Key bind - by zyx - 27.02.2009, 10:46
Re: Key bind - by CracK - 27.02.2009, 10:48
Re: Key bind - by MenaceX^ - 27.02.2009, 11:05
Re: Key bind - by CracK - 27.02.2009, 11:29

Forum Jump:


Users browsing this thread: 1 Guest(s)