Gets or sets the active radio station.
Gets a vehicle that is attached to the vehicle instance.
Gets a vehicle where the vehicle is attached to.
Gets or sets the status of the boat anchor.
Gets or sets the additional body health.
Gets or sets the body health.
Gets or sets the custom primary color as a RGBA type.
Gets or sets the custom secondary color as a RGBA type.
Gets or sets if the vehicle instance has custom tires.
Applies some decoration effects to the vehicle (e.g.: It makes the hydra looking rusty or applies snow to the front bumper of policeold1
). Does not work on every vehicle model.
Gets or sets the dashboard color of the vehicle.
Dash board colors range from 0 to 159.
Gets the current state of the daylights.
Gets if a vehicle is destroyed.
Destroyed is set to true when specific game activities cause the engine to stop. Explosions, being underwater, crashing too much, etc.
Object dimension.
Gets or sets the dirt level of the vehicle.
Gets or sets the drift mode state of the vehicle.
Gets the current driver of the vehicle. It returns null, if there is no driver.
Gets or sets the current engine health.
Default maximum engine health is 1000.
The vehicle.repair()
function should be used to repair a vehicle if the engine health is less than or equal to zero.
This example demonstrates that when you drive through a ColShape it will repair the vehicle.
Gets or sets the engine state of the vehicle.
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.
Gets if a flamethrower of a vehicle is active on vehicle models like cerberus
.
Gets the type of the front wheels.
Gets if the handbrake of a car is active.
Gets if the car has armored windows.
Gets or sets the headlight color of a vehicle.
Gets or sets the interior color of a vehicle.
Gets or sets if the created train is a mission train.
Gets or sets if the train is a caboose.
Gets or sets if the train is the engine of the train.
Gets or sets the lights intensity and distance of a vehicle.
Gets or sets the livery of a vehicle.
Gets or sets the lock state of a vehicle.
Enables or disables the manual engine control.
Gets or sets the current mod kit of a vehicle.
Gets the maximum amount of vehicle mod kits available.
Enables or disables a neon light on a specific position.
Gets or sets the color of the neon lights.
Network owner of the entity.
Gets the current state of the nightlights.
Gets or sets the current number plate style.
Gets or sets the current text displayed on the number plate.
Gets all passengers of the vehicle including the driver itself.
Gets or sets the pearl color of a vehicle.
Gets or sets the current health amount of the petrol tank.
Object position.
Gets or sets the current primary color of a vehicle.
Gets or sets the vehicles rotation with a quaternion.
Gets the type of the rear wheels.
Returns the ref count of the entity.
Gets how often a vehicle got repaired.
Opens or closes the vehicle roof (if vehicle has this feature, otherwise it is always true
).
Gets or sets the roof livery of a vehicle.
Gets or sets the roof state of a vehicle (closed or open).
Entity rotation.
Gets or sets the current secondary color.
Gets or sets the siren state of a vehicle.
Whether the entity should be streamed for other entities.
Gets or sets the color of the tire smoke.
Gets or sets the config index of the train's carriage.
Gets or sets the trains config index.
Gets or sets the cruise speed of the train.
Gets or sets the direction of the train.
Gets or sets the distance of the trains to the engine.
Gets the engine of the train.
Gets or sets if the doors of the trains should be forced open.
Gets another train that is linked to the back of the train. Returns null if there is no linked train.
Gets another train that is linked to the back of the train. Returns null if there is no linked train in front.
Gets or sets if the train is a passenger carriage.
Gets or sets if the trains is rendered derailed.
Gets or sets the track id of the train.
Type of the object.
Object usability.
Gets the velocity vector of a vehicle.
Whether the entity is visible.
Gets or sets the wheel color.
Gets the wheel type.
Gets the amount of wheels of a vehicle.
Gets or sets the window tint of a vehicle.
Array with all vehicles.
Get the entity model hash.
Attaches this entity to another entity.
Target entity.
Target bone id or name.
Origin bone id or name.
Position offset.
Rotation - needs to be in radians.
If true the attached entity has a collision.
If false the entity is attached with a fixed rotation (no bouncing). That means if the value in native was true, you have to use false in the serverside method
Removes the object from the world.
Detaches this entity if attached to another entity.
Returns if a specific wheel has a tire.
The specific wheel based on the id
True when the wheel has a tire, otherwise false.
Returns the appearance of a vehicle as a base64 string.
A base64 string.
Returns the health of a specific armored window.
The window id.
The amount of health.
Returns the amount of shoots that a specific armoured window received.
The window id.
The amount of shoots that a window received.
Returns the damage level of a specific bumper.
The id of a bumper.
The damage level of a bumper.
Returns the damage status of a vehicle as a base64 string.
A base64 string of the damage status.
Returns the state of a specific door.
The id of the door.
The state of the door.
Returns the state of a specific extra of a vehicle.
The id of the extra.
True when the extra is enabled, otherwise false.
Returns the game state data of a vehicle as a base64 string.
A base64 string of the game state data.
Returns the health data of a vehicle as a base64 string.
A base64 string of the health data.
Returns the mod value for a specific mod type.
The id of the mod type.
The value of the mod type.
Returns the amount of possible mod values for a specific mod type.
The id of the mod type.
The amount of possible mod values of a mod type.
Returns the amount of bullet holes of a vehicle part.
The id of a vehicle part.
The amount of bullet holes of a vehicle part.
Returns the damage level of a vehicle part.
The id of a vehicle part.
The damage level of a vehicle part.
Returns the script data of a vehicle as a base64 string.
A base64 string of the script data.
Returns the health of a specific wheel.
The id of the wheel.
The amount of health of a specific wheel.
Returns if a specific light is damaged.
The id of the light.
True if the light is damaged, otherwise false.
Returns if a specific special light is damaged.
The id of the special light.
True if the special light is damaged, otherwise false.
Returns if a specific wheel is burst.
The id of the wheel.
True if the wheel is burst, otherwise false.
Returns if a specific wheel is detached.
The id of the wheel.
True if the wheel is detached, otherwise false.
Returns if a specific wheel is on fire.
The id of the wheel.
True if the wheel is on fire, otherwise false.
Returns if a specific window is damaged.
The id of the window.
True if the window is damaged, otherwise false.
Returns if a specific window is open.
The id of the window.
True if the window is open, otherwise false.
Repairs the vehicle.
Resets overwritten network owner.
Pass true to disable migration, false to keep it enabled. If not specified, it defaults to "false".
Sets the appearance of a vehicle with a base64 string.
The base64 string of the appearance data.
Sets the health of a specific armored window.
The id of the window.
The amount of health.
Sets the shoot count of a specific armoured window.
The id of the window.
The amount of shoots.
Sets the damage level of a specific bumper.
The id of the bumper.
The damage level.
Sets the damage status of a vehicle based on a base64 string.
A base64 string that represents the damage status.
Sets the state of a specific door
The id of the door.
The state of the door.
Sets the state of an extra of a vehicle.
The id of the extra.
The state of the extra.
Sets the game state data of a vehicle with a given base64 string.
A base64 string that represents the game state data.
Sets the health data of a vehicle with a given base64 string.
A base64 string that represents the health data.
Sets a specific light of the vehicle either damaged or not.
The id of the light.
True to damage the specific light, otherwise false.
Applies a specific mod of a given mod type.
The type of the mod.
The id of the mod.
Changes network owner to the specified player.
The given player that will be set as new network owner.
Pass true to disable migration, false to keep it enabled. If not specified, it defaults to "false".
Applies bullet holes to a specific vehicle part.
The id of the part.
The amount of bullet holes.
Sets the damage level of a vehicle part.
The id of the part.
The damage level.
Sets type of the rear wheels.
The id of the rear wheel type.
Sets the script data of a vehicle based on a base64 string.
A base64 string that represents the script data.
Activates the searchlight and follows the target.
Sets if a special light is damaged.
The id of the special light.
True to damage the specific special light, otherwise false.
Set a train as an engine of a train.
The vehicle to set as an engine.
Links another train to the back of the train.
The vehicle to set as linked to the back of the train.
Links another train to the front of the train.
The vehicle to set as linked to the front of the train.
Sets if a specific wheel is burst.
The id of the wheel.
True to burst the wheel, otherwise false.
Sets a wheel either detached or attached.
The id of the wheel.
True to detach the wheel, otherwise false.
Repairs a specific wheel.
The id of the wheel.
Sets if a specific wheel has a tire.
The id of the wheel.
True to apply a tire to a wheel, otherwise false.
Sets the health of a specific wheel.
The id of the wheel.
The health of the wheel.
Sets a wheel either on fire or not
The id of the wheel.
True to set the wheel on fire, otherwise false.
Applies a wheel style based on the type and variation.
The type of the wheel.
The variation id of the wheel.
Sets if a specific window is damaged.
The id of the window.
True to damage the specific window, otherwise false.
Sets if a specific window is open.
The id of the window.
True to open the window, otherwise false.
Retrieves the vehicle from the pool.
The id of the vehicle.
Vehicle if it was found, otherwise null.
A vehicle is an extension of the Entity class.
// Get the vehicle a player is driving. const vehicle = alt.Vehicle.all.find(veh => veh.driver && veh.driver.name === 'Stuyk'); if (!vehicle) { console.log('Stuyk is not driving a vehicle'); } else { console.log('Stuyk is driving a vehicle.') const player = vehicle.driver; }