Vehicle
@vimp-mp/types 2.0.1Server-spawned vehicle handle returned by vimp.vehicles.create.
Mutating world, appearance, lock and health properties updates the authoritative server state and broadcasts the change to every player currently streaming the vehicle.
interface Vehicle extends StreamSyncedMetaMembers
bodyHealth
bodyHealth: numberBody health, clamped by runtime to 0-1000.
dimension
dimension: numberVirtual world (dimension). The vehicle is visible only to players in the same dimension. Changing it also changes every occupant's dimension without removing them from the vehicle; each player receives a playerDimensionChange event. Defaults to 0.
dirtLevel
dirtLevel: numberDirt level, clamped by runtime to 0-15.
driver
readonly driver: Player | nullPlayer in the driver seat (-1 / seat -1 server-side), or null.
engineHealth
engineHealth: numberEngine health, clamped by runtime to -4000..1000.
engineOn
engineOn: booleanWhether the engine is running.
id
readonly id: numberServer-assigned vehicle identifier.
isExists
readonly isExists: booleanWhether the vehicle is still registered with the server runtime.
livery
livery: numberLivery index, clamped by runtime to -1..255.
lockState
lockState: numberDoor lock state, clamped by runtime to 0-10.
model
model: numberVehicle model hash.
numberPlate
numberPlate: stringNumber plate text, truncated by runtime to 8 characters.
numberPlateType
numberPlateType: numberNumber plate style, clamped by runtime to 0-5.
passengers
readonly passengers: Array<Player>All players currently seated in the vehicle, including the driver.
position
position: Vec3Authoritative world position.
primaryColor
primaryColor: numberGTA primary paint id, clamped by runtime to 0-255.
rotation
rotation: Vec3Authoritative world rotation in degrees.
secondaryColor
secondaryColor: numberGTA secondary paint id, clamped by runtime to 0-255.
deleteStreamSyncedMeta
deleteStreamSyncedMeta(key: string): voidDeletes key and propagates the removal to streaming clients.
destroy
destroy(): booleanDestroy the vehicle and unregister it from vimp.vehicles.
getStreamSyncedMeta
getStreamSyncedMeta<T = unknown>(key: string): T | undefinedReturns undefined if the key is unset.
getStreamSyncedMetaKeys
getStreamSyncedMetaKeys(): Array<string>Returns all stream-synced metadata keys stored on the entity.
hasStreamSyncedMeta
hasStreamSyncedMeta(key: string): booleanReturns whether the entity has a value for key.
setStreamSyncedMeta
setStreamSyncedMeta(key: string, value: unknown): voidSet or replace one key. The value is forwarded to every player currently streaming this entity, plus included in the snapshot for any future stream-in. Use deleteStreamSyncedMeta rather than undefined when the key must be removed.