engine command not working
#2

At the top of the script:

pawn Код:
new vehicleenginestatus[MAX_VEHICLES];
Under OnVehicleSpawn(vehicleid)

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, 0, 0, objective);
vehicleenginestatus[vehicleid] = 0;
return 1;
Change "engineon" to just "engine" and delete "engineoff" if you have one because this will do both in one command. Under the engine command:

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Yoi are not the driver.");
if(vehicleenginestatus(vehid) == 0) { vehicleenginestatus[vehid] = 1; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 1, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched on."); return 1; }
else { vehicleenginestatus[vehid] = 0; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 0, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched off."); return 1; }
PS: Scripted from my iPhone so there might be that slight spelling error .
Reply


Messages In This Thread
engine command not working - by Strapz - 28.08.2013, 22:17
Re: engine command not working - by DanishHaq - 29.08.2013, 01:56
Re: engine command not working - by Strapz - 29.08.2013, 10:12
Re: engine command not working - by DanishHaq - 29.08.2013, 12:26
Re: engine command not working - by Luis- - 29.08.2013, 12:29
Re: engine command not working - by DanishHaq - 29.08.2013, 12:36

Forum Jump:


Users browsing this thread: 1 Guest(s)