scriptID
Used to get
the current vehicle's native handle to apply natives to the vehicle.
Returns a number
.
Declaration
vehicle.scriptID: number
Usage
const currentID = vehicle.scriptID;
Real World Example
// Check if the local player is in a vehicle.
if (alt.Player.local.vehicle) {
console.log(`Script ID is: ${alt.Player.local.vehicle.scriptID}`);
native.setVehicleEngineOn(alt.Player.local.vehicle.scriptID, true, false, false);
}
These examples assume you have a vehicle available on client-side
.