29.05.2014, 14:28
PHP код:
CMD:engine(playerid, params[])
{
#define charsmax(%1) sizeof(%1)-1
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new tmp, bEngine, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, bEngine, tmp, tmp, tmp, tmp, tmp, tmp);
new bState = (bEngine == VEHICLE_PARAMS_OFF || bEngine == VEHICLE_PARAMS_UNSET);
SetVehicleParamsEx(vehicleid, bState, bState, -1, -1, -1, -1, -1);
new string[64];
GetPlayerName(playerid, string, charsmax(string));
format(string, charsmax(string), "* %s turn the ignition and %s the engine.", string, bState ? ("starts") : ("turns off"));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE)
}
return 1;
}