29.08.2013, 01:56
At the top of the script:
Under OnVehicleSpawn(vehicleid)
Change "engineon" to just "engine" and delete "engineoff" if you have one because this will do both in one command. Under the engine command:
PS: Scripted from my iPhone so there might be that slight spelling error .
pawn Код:
new vehicleenginestatus[MAX_VEHICLES];
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, 0, 0, objective);
vehicleenginestatus[vehicleid] = 0;
return 1;
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; }