SA-MP Forums Archive
Vehicle spawn engine - 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: Vehicle spawn engine (/showthread.php?tid=293659)



Vehicle spawn engine - Tanush123 - 29.10.2011

Well how can i make when player enters a vehicle, the engines is off? i used this
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    for(new i=0;i<MAX_VEHICLES;i++) {
    vEngine[i] = 1;
    }
    return 1;
}
But when i enter a vehicle the engine is automatically on


Re: Vehicle spawn engine - park4bmx - 29.10.2011

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, false, doors, bonnet, boot, objective);
Just add this and it will turn the engine off


Re: Vehicle spawn engine - Tanush123 - 29.10.2011

I already have them on top of script -_-, /engine works but i want the vehicles engine to be on vEngine[vid] = 1; when a vehicle spawns


Re: Vehicle spawn engine - [MG]Dimi - 29.10.2011

if you want engine to idle once vehicle spawns just add
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, false, doors, bonnet, boot, objective);

Under OnVehicleSpawn(vehicleid)


Re: Vehicle spawn engine - Tanush123 - 29.10.2011

Damn i did taht dimi but it wont work still