SA-MP Forums Archive
Engine help - 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: Engine help (/showthread.php?tid=404357)



Engine help - arko123 - 02.01.2013

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vid) == 481 || GetVehicleModel(vid) == 509 || GetVehicleModel(vid) == 510)
    {
        new vid = GetPlayerVehicleID(playerid);
        SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
    }
    return 1;
}
I don't get any error or warning but it doesn't work.


Re: Engine help - park4bmx - 02.01.2013

you need to retrieve the vehicle params first!
GetVehicleParamsEx


Re: Engine help - arko123 - 02.01.2013

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
you need to retrieve the vehicle params first!
GetVehicleParamsEx
Still doesn't work.


Re: Engine help - park4bmx - 02.01.2013

what did u do ?
edit
a quote from one of my old posts

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
dont really know if vortex has this allredy :X
pawn Код:
//At the bottom , very bottom of the script just add this
stock VehicleEngine(vehicleid,VAR)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(VAR == 1)
    {
        VehEngineStat[vehicleid]=1;
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    }else{
        VehEngineStat[vehicleid]=0;
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    }
}
VehicleEngine(vehicleid,VAR)
vehicled is the vehicle's engine you want to taggle ON/OFF
VAR is the the ON/OFF fucntion, "TRUE" = ON , "FALSE" = OFF