VehicleClient

setVehicleEngineOn

SET_VEHICLE_ENGINE_ON0x2497C4717C8B881E

The GTA V native SET_VEHICLE_ENGINE_ON of the VEHICLE namespace, as LS:MP client scripts call it: the global function setVehicleEngineOn, in JavaScript and in Lua.

SignatureJavaScript
setVehicleEngineOn(
  vehicle: Vehicle,
  value: boolean,
  instantly: boolean,
  disableAutoStart: boolean
): void
SignatureLua
setVehicleEngineOn(
  vehicle: Vehicle,
  value: boolean,
  instantly: boolean,
  disableAutoStart: boolean
)

Usage

JavaScript
setVehicleEngineOn(vehicle, value, instantly, disableAutoStart);
Lua
setVehicleEngineOn(vehicle, value, instantly, disableAutoStart)

Parameters

ParameterTypeJavaScriptLuaDescription
vehicleVehiclenumberintegerThe vehicle to start or stop the engine on.
valueBOOLbooleanbooleantrue to turn the vehicle on; false to turn it off.
instantlyBOOLbooleanbooleanif true, the vehicle will be set to the state immediately; otherwise, the current driver will physically turn on or off the engine.
disableAutoStartBOOLbooleanbooleanIf true, the system will prevent the engine from starting when the player got into it.

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Starts or stops the engine on the specified vehicle.

Reference

Namespace
Vehicle VEHICLE
In the game
void SET_VEHICLE_ENGINE_ON(Vehicle vehicle, BOOL value, BOOL instantly, BOOL disableAutoStart)
Hash
0x2497C4717C8B881E

Open in the interactive natives reference