27.02.2009, 10:40
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;
}