dont really know if vortex has this allredy :X
pawn Код:
//this goes at the top of your script/gamemode with all the other "new"
new VehEngineStat[MAX_VEHICLES];
//then add whats inside the callback into your current callback
//so do "CTRL + F" and type "OnPlayerKey" and it would show the "public" then just copy and past the callback bellow
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
new playerState = GetPlayerState(playerid);
if(newkeys & KEY_SUBMISSION && playerState == PLAYER_STATE_DRIVER)
{
if(VehLights[vehicleid] == 0) VehicleLights(vehicleid,true);
else VehicleLights(vehicleid,false);
}
}
//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);
}
}
it has been tested and i use it in one of my gamemodes so yeah
just to let you know
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