SA-MP Forums Archive
Car help, engine & Car exploding, vanishes the paintjob - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car help, engine & Car exploding, vanishes the paintjob (/showthread.php?tid=528552)



deletethis - zDigol - 28.07.2014

delethis


Re : Car help, engine & Car exploding, vanishes the paintjob - SlimDkhili - 28.07.2014

You should save your engine status in player information (.ini or in mysql , depend of how you save your player characters)

to make sure when you spown a new vehicle in game , add those two lines where the cmd of adding a vehicle
Код:
engine = 0;
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
rep + if i helped you


Re: Re : Car help, engine & Car exploding, vanishes the paintjob - zDigol - 28.07.2014

---------------


Re: Car help, engine & Car exploding, vanishes the paintjob - AMouldyLemon - 28.07.2014

No.. You save it in a Variable, and change it according to whether you want it On or Off.

Example:
pawn Код:
new Engine[MAX_PLAYERS];

if(Engine[vehicleid] == 1)
pawn Код:
Engine on:

new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);


Engine off:

new engine, lights, alarm, doors, bonnet, boot, objective;
 GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);



Re: Car help, engine & Car exploding, vanishes the paintjob - Beckett - 28.07.2014

pawn Код:
public OnVehicleSpawn(vehicleid)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
 GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    YourEngineVariable[vehicleid] = 0;
    return 1;
}



Re: Car help, engine & Car exploding, vanishes the paintjob - zDigol - 28.07.2014

---------------