02.04.2018, 12:32
PHP код:
CMD:engine(playerid, params[])
{
new
string[265],
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective,
vehicleid = GetPlayerVehicleID(playerid);
if(IsBicycle(vehicleid))
return SendClientMessage(playerid, 0xE74C3CFF, "You are not driving a vehicle with engine!");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
return SendClientMessage(playerid, 0xE74C3CFF, "You are not driving a vehicle!");
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 1)
{
engine = 0;
format(string, sizeof(string), "%s stops the engine of a %s.", GetName(playerid), GetVehicleName(vehicleid));
SendClientMessage(playerid, 0xFF66FFAA, string);
RangeDetector(playerid, 30.0, string, 0xFF66FFAA);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
else
{
if(Fuel[vehicleid] < 0)
return SendClientMessage(playerid, 0xFF66FFAA, "Your vehicle is out of fuel!");
engine = 1;
format(string, sizeof(string), "%s starts the engine of a %s.", GetName(playerid), GetVehicleName(vehicleid));
SendClientMessage(playerid, 0xFF66FFAA, string);
RangeDetector(playerid, 30.0, string, 0xFF66FFAA);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}