Vehicle
Hierarchy
- Entity
- Vehicle
Index
Constructors
Properties
- accelerationLevel
- activeRadioStation
- attached
- attachedTo
- boatAnchorActive
- bodyAdditionalHealth
- bodyHealth
- brakeLevel
- collision
- counterMeasureCount
- customPrimaryColor
- customSecondaryColor
- customTires
- darkness
- dashboardColor
- daylightOn
- destroyed
- dimension
- dirtLevel
- driftModeEnabled
- driver
- engineHealth
- engineOn
- flamethrowerActive
- frontWheels
- frozen
- handbrakeActive
- hasArmoredWindows
- hasTimedExplosion
- headlightColor
- hornActive
- hybridExtraActive
- hybridExtraState
- id
- interiorColor
- isMissionTrain
- isTrainCaboose
- isTrainEngine
- lightState
- lightsMultiplier
- livery
- lockState
- manualEngineControl
- modKit
- modKitsCount
- neon
- neonColor
- netOwner
- nightlightOn
- numberPlateIndex
- numberPlateText
- passengers
- pearlColor
- petrolTankHealth
- pos
- primaryColor
- quaternion
- rearWheels
- refCount
- repairsCount
- rocketRefuelSpeed
- roofClosed
- roofLivery
- roofState
- rot
- scriptMaxSpeed
- secondaryColor
- sirenActive
- steeringAngle
- streamed
- streamingDistance
- timedExplosionCulprit
- timedExplosionTime
- timestamp
- tireSmokeColor
- trainCarriageConfigIndex
- trainConfigIndex
- trainCruiseSpeed
- trainDirection
- trainDistanceFromEngine
- trainEngineId
- trainForceDoorsOpen
- trainLinkedToBackwardId
- trainLinkedToForwardId
- trainPassengerCarriages
- trainRenderDerailed
- trainTrackId
- trainUnk1
- trainUnk2
- trainUnk3
- type
- valid
- velocity
- visible
- wheelColor
- wheelType
- wheelsCount
- windowTint
- all
- count
Accessors
Methods
- attachTo
- deleteMeta
- deleteStreamSyncedMeta
- deleteSyncedMeta
- destroy
- detach
- doesWheelHasTire
- getAppearanceDataBase64
- getArmoredWindowHealth
- getArmoredWindowShootCount
- getBumperDamageLevel
- getDamageStatusBase64
- getDoorState
- getExtra
- getGamestateDataBase64
- getHealthDataBase64
- getMeta
- getMetaDataKeys
- getMod
- getModsCount
- getPartBulletHoles
- getPartDamageLevel
- getScriptDataBase64
- getStreamSyncedMeta
- getStreamSyncedMetaKeys
- getSyncedMeta
- getSyncedMetaKeys
- getWeaponCapacity
- getWheelHealth
- hasMeta
- hasStreamSyncedMeta
- hasSyncedMeta
- isLightDamaged
- isSpecialLightDamaged
- isWheelBurst
- isWheelDetached
- isWheelOnFire
- isWindowDamaged
- isWindowOpened
- repair
- resetNetOwner
- setAppearanceDataBase64
- setArmoredWindowHealth
- setArmoredWindowShootCount
- setBadge
- setBumperDamageLevel
- setDamageStatusBase64
- setDoorState
- setExtra
- setGamestateDataBase64
- setHealthDataBase64
- setLightDamaged
- setMeta
- setMod
- setNetOwner
- setPartBulletHoles
- setPartDamageLevel
- setRearWheels
- setScriptDataBase64
- setSearchLightTo
- setSpecialLightDamaged
- setStreamSyncedMeta
- setSyncedMeta
- setTimedExplosion
- setTrainEngineId
- setTrainLinkedToBackwardId
- setTrainLinkedToForwardId
- setWeaponCapacity
- setWheelBurst
- setWheelDetached
- setWheelFixed
- setWheelHasTire
- setWheelHealth
- setWheelOnFire
- setWheels
- setWindowDamaged
- setWindowOpened
- getByID
Constructors
constructor
Properties
publicreadonlyaccelerationLevel
publicactiveRadioStation
Gets or sets the active radio station.
publicreadonlyattached
Gets a vehicle that is attached to the vehicle instance.
publicreadonlyattachedTo
Gets a vehicle where the vehicle is attached to.
publicboatAnchorActive
Gets or sets the status of the boat anchor.
publicbodyAdditionalHealth
Gets or sets the additional body health.
publicbodyHealth
Gets or sets the body health.
publicreadonlybrakeLevel
publiccollision
publiccounterMeasureCount
publiccustomPrimaryColor
Gets or sets the custom primary color as a RGBA type.
publiccustomSecondaryColor
Gets or sets the custom secondary color as a RGBA type.
publiccustomTires
Gets or sets if the vehicle instance has custom tires.
publicdarkness
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.
publicdashboardColor
Gets or sets the dashboard color of the vehicle.
Dash board colors range from 0 to 159.
publicreadonlydaylightOn
Gets the current state of the daylights.
publicreadonlydestroyed
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.
publicdimension
Object dimension.
publicdirtLevel
Gets or sets the dirt level of the vehicle.
publicdriftModeEnabled
Gets or sets the drift mode state of the vehicle.
publicreadonlydriver
Gets the current driver of the vehicle. It returns null, if there is no driver.
publicengineHealth
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.
publicengineOn
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.
publicreadonlyflamethrowerActive
Gets if a flamethrower of a vehicle is active on vehicle models like cerberus
.
publicreadonlyfrontWheels
Gets the type of the front wheels.
publicfrozen
publicreadonlyhandbrakeActive
Gets if the handbrake of a car is active.
publicreadonlyhasArmoredWindows
Gets if the car has armored windows.
publicreadonlyhasTimedExplosion
publicheadlightColor
Gets or sets the headlight color of a vehicle.
publichornActive
publichybridExtraActive
publichybridExtraState
publicreadonlyid
publicinteriorColor
Gets or sets the interior color of a vehicle.
publicisMissionTrain
Gets or sets if the created train is a mission train.
publicisTrainCaboose
Gets or sets if the train is a caboose.
publicisTrainEngine
Gets or sets if the train is the engine of the train.
publiclightState
publiclightsMultiplier
Gets or sets the lights intensity and distance of a vehicle.
publiclivery
Gets or sets the livery of a vehicle.
publiclockState
Gets or sets the lock state of a vehicle.
publicmanualEngineControl
Enables or disables the manual engine control.
publicmodKit
Gets or sets the current mod kit of a vehicle.
publicreadonlymodKitsCount
Gets the maximum amount of vehicle mod kits available.
publicneon
Enables or disables a neon light on a specific position.
publicneonColor
Gets or sets the color of the neon lights.
publicreadonlynetOwner
Network owner of the entity.
publicreadonlynightlightOn
Gets the current state of the nightlights.
publicnumberPlateIndex
Gets or sets the current number plate style.
publicnumberPlateText
Gets or sets the current text displayed on the number plate.
publicreadonlypassengers
Gets all passengers of the vehicle including the driver itself.
publicpearlColor
Gets or sets the pearl color of a vehicle.
publicpetrolTankHealth
Gets or sets the current health amount of the petrol tank.
publicpos
Object position.
publicprimaryColor
Gets or sets the current primary color of a vehicle.
publicquaternion
Gets or sets the vehicles rotation with a quaternion.
publicreadonlyrearWheels
Gets the type of the rear wheels.
publicreadonlyrefCount
Returns the ref count of the entity.
publicreadonlyrepairsCount
Gets how often a vehicle got repaired.
publicrocketRefuelSpeed
publicroofClosed
Opens or closes the vehicle roof (if vehicle has this feature, otherwise it is always true
).
publicroofLivery
Gets or sets the roof livery of a vehicle.
publicroofState
Gets or sets the roof state of a vehicle (closed or open).
publicrot
Entity rotation.
publicscriptMaxSpeed
publicsecondaryColor
Gets or sets the current secondary color.
publicsirenActive
Gets or sets the siren state of a vehicle.
publicreadonlysteeringAngle
publicstreamed
Whether the entity should be streamed for other entities.
publicstreamingDistance
publicreadonlytimedExplosionCulprit
publicreadonlytimedExplosionTime
publicreadonlytimestamp
publictireSmokeColor
Gets or sets the color of the tire smoke.
publictrainCarriageConfigIndex
Gets or sets the config index of the train’s carriage.
publictrainConfigIndex
Gets or sets the trains config index.
publictrainCruiseSpeed
Gets or sets the cruise speed of the train.
publictrainDirection
Gets or sets the direction of the train.
publictrainDistanceFromEngine
Gets or sets the distance of the trains to the engine.
publicreadonlytrainEngineId
Gets the engine of the train.
publictrainForceDoorsOpen
Gets or sets if the doors of the trains should be forced open.
publicreadonlytrainLinkedToBackwardId
Gets another train that is linked to the back of the train. Returns null if there is no linked train.
publicreadonlytrainLinkedToForwardId
Gets another train that is linked to the back of the train. Returns null if there is no linked train in front.
publictrainPassengerCarriages
Gets or sets if the train is a passenger carriage.
publictrainRenderDerailed
Gets or sets if the trains is rendered derailed.
publictrainTrackId
Gets or sets the track id of the train.
publictrainUnk1
publictrainUnk2
publictrainUnk3
publicreadonlytype
Type of the object.
publicreadonlyvalid
Object usability.
publicreadonlyvelocity
Gets the velocity vector of a vehicle.
publicvisible
Whether the entity is visible.
publicwheelColor
Gets or sets the wheel color.
publicreadonlywheelType
Gets the wheel type.
publicreadonlywheelsCount
Gets the amount of wheels of a vehicle.
publicwindowTint
Gets or sets the window tint of a vehicle.
publicstaticreadonlyall
Array with all vehicles.
publicstaticreadonlycount
Accessors
publicmodel
Get the entity model hash.
Getter
Methods
publicattachTo
Attaches this entity to another entity.
publicdeleteMeta
publicdeleteStreamSyncedMeta
publicdeleteSyncedMeta
publicdestroy
Removes the object from the world.
publicdetach
Detaches this entity if attached to another entity.
publicdoesWheelHasTire
Returns if a specific wheel has a tire.
publicgetAppearanceDataBase64
Returns the appearance of a vehicle as a base64 string.
publicgetArmoredWindowHealth
Returns the health of a specific armored window.
publicgetArmoredWindowShootCount
Returns the amount of shoots that a specific armoured window received.
publicgetBumperDamageLevel
Returns the damage level of a specific bumper.
publicgetDamageStatusBase64
Returns the damage status of a vehicle as a base64 string.
publicgetDoorState
Returns the state of a specific door.
publicgetExtra
Returns the state of a specific extra of a vehicle.
publicgetGamestateDataBase64
Returns the game state data of a vehicle as a base64 string.
publicgetHealthDataBase64
Returns the health data of a vehicle as a base64 string.
publicgetMeta
Type parameters
- K: string
publicgetMetaDataKeys
publicgetMod
Returns the mod value for a specific mod type.
publicgetModsCount
Returns the amount of possible mod values for a specific mod type.
publicgetPartBulletHoles
Returns the amount of bullet holes of a vehicle part.
publicgetPartDamageLevel
Returns the damage level of a vehicle part.
publicgetScriptDataBase64
Returns the script data of a vehicle as a base64 string.
publicgetStreamSyncedMeta
Type parameters
- K: string
publicgetStreamSyncedMetaKeys
publicgetSyncedMeta
Type parameters
- K: string
publicgetSyncedMetaKeys
publicgetWeaponCapacity
publicgetWheelHealth
Returns the health of a specific wheel.
publichasMeta
publichasStreamSyncedMeta
publichasSyncedMeta
publicisLightDamaged
Returns if a specific light is damaged.
publicisSpecialLightDamaged
Returns if a specific special light is damaged.
publicisWheelBurst
Returns if a specific wheel is burst.
publicisWheelDetached
Returns if a specific wheel is detached.
publicisWheelOnFire
Returns if a specific wheel is on fire.
publicisWindowDamaged
Returns if a specific window is damaged.
publicisWindowOpened
Returns if a specific window is open.
publicrepair
Repairs the vehicle.
publicresetNetOwner
Resets overwritten network owner.
publicsetAppearanceDataBase64
Sets the appearance of a vehicle with a base64 string.
publicsetArmoredWindowHealth
Sets the health of a specific armored window.
publicsetArmoredWindowShootCount
Sets the shoot count of a specific armoured window.
setBadge
publicsetBumperDamageLevel
Sets the damage level of a specific bumper.
publicsetDamageStatusBase64
Sets the damage status of a vehicle based on a base64 string.
publicsetDoorState
Sets the state of a specific door
publicsetExtra
Sets the state of an extra of a vehicle.
publicsetGamestateDataBase64
Sets the game state data of a vehicle with a given base64 string.
publicsetHealthDataBase64
Sets the health data of a vehicle with a given base64 string.
publicsetLightDamaged
Sets a specific light of the vehicle either damaged or not.
publicsetMeta
Type parameters
- K: string
publicsetMod
Applies a specific mod of a given mod type.
publicsetNetOwner
Changes network owner to the specified player.
publicsetPartBulletHoles
Applies bullet holes to a specific vehicle part.
publicsetPartDamageLevel
Sets the damage level of a vehicle part.
publicsetRearWheels
Sets type of the rear wheels.
publicsetScriptDataBase64
Sets the script data of a vehicle based on a base64 string.
publicsetSearchLightTo
Activates the searchlight and follows the target.
publicsetSpecialLightDamaged
Sets if a special light is damaged.
publicsetStreamSyncedMeta
Type parameters
- K: string
publicsetSyncedMeta
Type parameters
- K: string
publicsetTimedExplosion
publicsetTrainEngineId
Set a train as an engine of a train.
publicsetTrainLinkedToBackwardId
Links another train to the back of the train.
publicsetTrainLinkedToForwardId
Links another train to the front of the train.
publicsetWeaponCapacity
publicsetWheelBurst
Sets if a specific wheel is burst.
publicsetWheelDetached
Sets a wheel either detached or attached.
publicsetWheelFixed
Repairs a specific wheel.
publicsetWheelHasTire
Sets if a specific wheel has a tire.
publicsetWheelHealth
Sets the health of a specific wheel.
publicsetWheelOnFire
Sets a wheel either on fire or not
publicsetWheels
Applies a wheel style based on the type and variation.
publicsetWindowDamaged
Sets if a specific window is damaged.
publicsetWindowOpened
Sets if a specific window is open.
publicstaticgetByID
Retrieves the vehicle from the pool.
A vehicle is an extension of the Entity class.
Example
Export