engineOn
Used to set
or get
the current engine state.
The functionality of the vehicle engine can be triggered on either client-side or server-side. If you want to trigger the engine on client-side use native.setVehicleEngineOn
.
Setting the value to true
will turn the vehicle on.
Returns a boolean
.
Declaration
vehicle.engineOn: boolean;
Usage
const engineOn = vehicle.engineOn;
// OR
vehicle.engineOn = true;
Real World Example
Set the vehicle engine on when the vehicle is spawned.
const vehicle = new alt.Vehicle('elegy', 0, 0, 0, 0, 0, 0);
vehicle.engineOn = true;
These examples assume you have vehicle created or available on server-side