Skip to content

REVO / API version 0.0.10

LocalVehicle

Created asynchronously when streamed in. Collections and lookups include only this resource’s vehicles.

new LocalVehicle(model, position, rotation): LocalVehicle

Parameter Type Description
model string | number -
position IVector3 -
rotation number | IVector3 | IQuaternion Heading or XYZ Euler angles in radians, or a non-zero quaternion (normalized on creation).

LocalVehicle

Vehicle.constructor

Property Type Details
aircraftType
readonly
AircraftType Inherited from Vehicle.aircraftType
boatInWater
readonly
boolean Inherited from Vehicle.boatInWater
bodyHealth
readonly
number Inherited from Vehicle.bodyHealth
brake
readonly
number Inherited from Vehicle.brake
brokenDoors
readonly
number Door bitmasks, using the game door indices.

Inherited from Vehicle.brokenDoors
dimension number World ID, default 0. Writable on local objects created by this resource. The server controls other objects. globalDimension makes the object visible in every numbered world.

Overrides Vehicle.dimension
dirtLevel
readonly
number Inherited from Vehicle.dirtLevel
driveable
readonly
boolean Inherited from Vehicle.driveable
engineHealth
readonly
number Inherited from Vehicle.engineHealth
engineRunning boolean Inherited from Vehicle.engineRunning
frontBumper
readonly
IVehicleBumperState Returns a copy. Editing it does not change the vehicle.

Inherited from Vehicle.frontBumper
handbrake
readonly
boolean Inherited from Vehicle.handbrake
hasLandingGear
readonly
boolean Inherited from Vehicle.hasLandingGear
heading number Heading in radians.

Inherited from Vehicle.heading
health number Inherited from Vehicle.health
highBeamsOn
readonly
boolean Inherited from Vehicle.highBeamsOn
hornActive
readonly
boolean Inherited from Vehicle.hornActive
id
readonly
number Local ID, assigned independently on the client and server.

Inherited from Vehicle.id
isLocallySimulated
readonly
boolean Simulation authority does not grant permission to change server-owned state.

Inherited from Vehicle.isLocallySimulated
isNetworked
readonly
false Overrides Vehicle.isNetworked
isStreamedIn
readonly
boolean Inherited from Vehicle.isStreamedIn
landingGearState
readonly
LandingGearState Inherited from Vehicle.landingGearState
lightsOn
readonly
boolean Inherited from Vehicle.lightsOn
livery number Index in [0, 255]. Variations unavailable for this model are ignored.

Inherited from Vehicle.livery
looselyLatchedDoors
readonly
number Inherited from Vehicle.looselyLatchedDoors
mainRotorStopped
readonly
boolean Inherited from Vehicle.mainRotorStopped
maxHealth number Inherited from Vehicle.maxHealth
netOwner
readonly
Player | null Inherited from Vehicle.netOwner
networkId
readonly
null Server-assigned network ID, or null without replication. Separate from id.

Overrides Vehicle.networkId
petrolTankHealth
readonly
number Inherited from Vehicle.petrolTankHealth
physicsAsleep
readonly
boolean Inherited from Vehicle.physicsAsleep
ready
readonly
boolean The initial server state has been applied, or a client-only entity has streamed in.

Inherited from Vehicle.ready
rearBumper
readonly
IVehicleBumperState Inherited from Vehicle.rearBumper
scorched
readonly
boolean Inherited from Vehicle.scorched
scriptID
readonly
number GTA handle, or 0 while not streamed in. Do not retain it across frames.

Inherited from Vehicle.scriptID
steeringAngle number Steering angle in radians.

Inherited from Vehicle.steeringAngle
streamDistance number | null Per-object distance in metres. null uses the streamer’s default.

Inherited from Vehicle.streamDistance
streamingEnabled boolean Enables automatic streaming. Disabling it preserves the current streaming state. A dimension mismatch still suspends it until its dimension is visible again.

Inherited from Vehicle.streamingEnabled
throttle
readonly
number Inherited from Vehicle.throttle
type
readonly
BaseType Inherited from Vehicle.type
valid
readonly
boolean Inherited from Vehicle.valid
all
static readonly
readonly LocalVehicle[] Overrides Vehicle.all
count
static readonly
number Overrides Vehicle.count
Accessor Type Details
angVelocity Read: Vector3
Write: IVector3
Angular velocity in radians per second.

Inherited from Vehicle.angVelocity
modelHash Read: number
Write: string | number
Accepts a model name or nonzero hash of the same entity type. Returns the old hash until the new model is applied.

Overrides Vehicle.modelHash
pos Read: Vector3
Write: IVector3
Inherited from Vehicle.pos
quaternion Read: Quaternion
Write: IQuaternion
Inherited from Vehicle.quaternion
radioStation Read: number | null
Write: number
Station hash. 0 means off, null means unavailable.

Inherited from Vehicle.radioStation
rot Read: Vector3
Write: IVector3
Euler angles in radians, applied X, then Y, then Z.

Inherited from Vehicle.rot
velocity Read: Vector3
Write: IVector3
Inherited from Vehicle.velocity

activatePhysics(): void

void

Vehicle.activatePhysics


destroy(): void

Deletes an entity created by this resource. Throws if the entity is networked, belongs to another resource, has been destroyed, or cannot be removed from GTA.

void

Vehicle.destroy


getSyncedMeta<K>(key): ICustomBaseSyncedMeta[K] | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter
K extends never
Parameter Type
key K

ICustomBaseSyncedMeta[K] | undefined

Vehicle.getSyncedMeta

getSyncedMeta<T>(key): T | undefined

Returns a copy. Client-only objects have no synced metadata.

Type Parameter Default type
T TransportValue
Parameter Type
key string

T | undefined

Vehicle.getSyncedMeta


getSyncedMetaKeys(): string[]

string[]

Vehicle.getSyncedMetaKeys


hasSyncedMeta(key): boolean

Parameter Type
key string

boolean

Vehicle.hasSyncedMeta


repair(): void

void

Vehicle.repair


setDrivingControls(throttle, brake, handbrake): void

Parameter Type Description
throttle number Range [-1, 1].
brake number Range [0, 1].
handbrake boolean -

void

Vehicle.setDrivingControls


setLights(lights, highBeams): void

Parameter Type
lights boolean
highBeams boolean

void

Vehicle.setLights


sleepPhysics(): void

void

Vehicle.sleepPhysics


static getById(id): LocalVehicle | null

Parameter Type
id number

LocalVehicle | null

Vehicle.getById


static getByNetworkId(networkId): null

Parameter Type
networkId number

null

Vehicle.getByNetworkId


static getByScriptId(scriptID): LocalVehicle | null

Parameter Type
scriptID number

LocalVehicle | null

Vehicle.getByScriptId

Creating and configuring vehicles