09.03.2013, 18:18
pawn Код:
CMD:aengine(playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, -1, "You need to be the driver of the vehicle");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(IsAnOwnableCar(GetPlayerVehicleID(playerid)))
{
if(PlayerInfo[playerid][pPcarkey] == GetPlayerVehicleID(playerid) || PlayerInfo[playerid][pPcarkey2] == GetPlayerVehicleID(playerid))
{
if(engine == 1)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
SCM(playerid, COLOR_LIGHTRED, "You have turned the engine off");
}
else if(engine == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
SCM(playerid, COLOR_LIGHTRED, "You have turned the engine on");
}
else
{
SCM(playerid, COLOR_LIGHTRED, "You do not have the keys to this vehicle. However, you may attempt to /hotwire it.");
}
}
}
return 1;
}