Skip to content

REVO / API version 0.0.10

Vehicle

Position and rotation getters return copies. Assign a new value to apply changes.

new Vehicle(model, position, rotation?): Vehicle

Parameter Type Description
model string | number Model name (ASCII case-insensitive) or unsigned 32-bit hash.
position IVector3 -
rotation? number | IVector3 | IQuaternion Heading or XYZ Euler angles in radians, or a unit quaternion. Defaults to zero heading.

Vehicle

Physical.constructor

Property Type Details
bodyHealth number —
collisionEnabled boolean Inherited from Physical.collisionEnabled
dimension number Dimension: 0..4294967294, default 0. globalDimension shows entities and spatial audio in every dimension. Players cannot use globalDimension. Global entities share movement, damage and seats across dimensions. A vehicle’s trailer follows its dimension. Occupants follow unless the new dimension is global.

Inherited from Physical.dimension
dirtLevel number —
engineHealth number —
engineRunning boolean —
frontBumperState IVehicleBumperState —
health number Inherited from Physical.health
highBeamsOn
readonly
boolean —
id
readonly
number Inherited from Physical.id
lightsOn
readonly
boolean —
livery
readonly
number —
modKit number Model-specific mod kit index. Defaults to 0.
netOwner
readonly
Player | null —
networkId
readonly
number | null Network ID shared with clients. null after destruction.

Inherited from Physical.networkId
parent
readonly
Vehicle | null —
petrolTankHealth number —
primaryColor number | IRGB GTA color ID (0..160) or custom RGB (each component 0..255). Assigning an ID clears custom RGB.
radioStation number —
rearBumperState IVehicleBumperState —
secondaryColor number | IRGB GTA color ID (0..160) or custom RGB (each component 0..255). Assigning an ID clears custom RGB.
trailer
readonly
Vehicle | null —
type
readonly
BaseType Inherited from Physical.type
valid
readonly
boolean Inherited from Physical.valid
visible boolean Inherited from Physical.visible
wheelType VehicleWheelType Wheel family used by the front and rear wheel mods.
windowTint VehicleWindowTint —
xenonColor number Xenon color index (0..12), or -1 for the default. Enable the Xenon toggle mod to use it.
all
static readonly
readonly Vehicle[] Overrides Physical.all
count
static readonly
number Overrides Physical.count
Accessor Type Details
angVelocity Read: Vector3
Write: IVector3
Inherited from Physical.angVelocity
modelHash Read: number
Write: string | number
Accepts a model name or nonzero uint32 hash. Clients load the new model asynchronously.

Inherited from Physical.modelHash
neonColor Read: IRGB | null
Write: IRGB
null until set. Each RGB component is 0..255. Enable the desired neon sides separately.
numberPlate Read: string | null
Write: string
null until set by the server. GTA supplies the original plate.

Up to 8 ASCII letters, digits or spaces. Letters become uppercase. An empty string blanks the plate.
pos Read: Vector3
Write: IVector3
Inherited from Physical.pos
quaternion Read: Quaternion
Write: IQuaternion
Inherited from Physical.quaternion
rot Read: Vector3
Write: IVector3
Euler angles in radians, applied X, then Y, then Z.

Inherited from Physical.rot
tyreSmokeColor Read: IRGB | null
Write: IRGB
null until set. Each RGB component is 0..255. Enable the TyreSmoke toggle mod to use it.
velocity Read: Vector3
Write: IVector3
Inherited from Physical.velocity

deleteSyncedMeta(key): void

Parameter Type
key string

void

Physical.deleteSyncedMeta


destroy(): void

Deletes the entity. Throws for players and already destroyed entities.

void

Physical.destroy


getExtra(id): boolean | null

Returns the server’s setting, or null if the extra still uses its model default. IDs are 1..16.

Parameter Type
id number

boolean | null


getMod(type): number

Returns the server’s selected mod index, or -1 for stock.

Parameter Type
type VehicleModType

number


getModVariation(type): boolean

Whether this wheel mod uses custom tyres.

Parameter Type
type VehicleModType

boolean


getObservers(): readonly Player[]

readonly Player[]

Physical.getObservers


getSeatOccupant(seat): number

Returns the player’s ID, or 65535 for an empty seat.

Parameter Type Description
seat number 1 for the driver.

number


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

Type Parameter
K extends never
Parameter Type
key K

ICustomBaseSyncedMeta[K] | undefined

Physical.getSyncedMeta

getSyncedMeta<T>(key): T | undefined

Type Parameter Default type
T TransportValue
Parameter Type
key string

T | undefined

Physical.getSyncedMeta


getSyncedMetaKeys(): string[]

string[]

Physical.getSyncedMetaKeys


hasSyncedMeta(key): boolean

Parameter Type
key string

boolean

Physical.hasSyncedMeta


isLightDamaged(light): boolean

Parameter Type
light number

boolean


isNeonEnabled(side): boolean

Parameter Type
side VehicleNeonSide

boolean


isToggleModOn(type): boolean

Parameter Type
type VehicleToggleModType

boolean


isWheelBurst(wheel): boolean

Parameter Type
wheel number

boolean


isWheelOnRim(wheel): boolean

Parameter Type
wheel number

boolean


repair(): boolean

boolean


setExtra(id, enabled): boolean

Sets extra 1..16 when present on the model. Enabling an extra can also repair the vehicle in GTA.

Parameter Type
id number
enabled boolean

boolean


setLightDamaged(light, damaged): boolean

Parameter Type
light number
damaged boolean

boolean


setLights(enabled, highBeams?): boolean

Parameter Type
enabled boolean
highBeams? boolean

boolean


setLivery(livery): boolean

Parameter Type
livery number

boolean


setMod(type, index, customTyres?): boolean

Part index: 0..254, or -1 for stock. customTyres applies to installed wheel mods. Returns false for invalid arguments. Unsupported parts use stock on the client. The server keeps the requested index.

Parameter Type
type VehicleModType
index number
customTyres? boolean

boolean


setNeonEnabled(side, enabled): boolean

Parameter Type
side VehicleNeonSide
enabled boolean

boolean


setSyncedMeta<K>(key, value): void

Copies and replicates the value to the object’s audience. Player metadata also goes to that player.

Type Parameter
K extends string
Parameter Type
key K
value K extends never ? ICustomBaseSyncedMeta[K] : TransportValue

void

Physical.setSyncedMeta

setSyncedMeta(values): void

Atomically merges own enumerable fields. Unsupported values reject the entire batch.

Parameter Type
values Partial<ICustomBaseSyncedMeta> & Record<string, TransportValue>

void

Physical.setSyncedMeta


setToggleMod(type, enabled): boolean

Enables an upgrade when supported by the model. Returns false for an invalid type.

Parameter Type
type VehicleToggleModType
enabled boolean

boolean


setWheelBurst(wheel, burst, onRim?): boolean

Parameter Type Description
wheel number Wheel index, from 0 to 5.
burst boolean -
onRim? boolean -

boolean


setWheelFixed(wheel): boolean

Parameter Type
wheel number

boolean


static getById(id): Vehicle | null

Parameter Type
id number

Vehicle | null

Physical.getById


static getByNetworkId(networkId): Vehicle | null

Parameter Type
networkId number

Vehicle | null

Physical.getByNetworkId


static getInRadius(position, radius, dimension?): readonly Vehicle[]

Includes global entities alongside the selected dimension. globalDimension selects only global entities. Omit it to search all worlds.

Parameter Type
position IVector3
radius number
dimension? number

readonly Vehicle[]

Physical.getInRadius

Creating and configuring vehicles