OxVehicle
- entity:
number
- make:
string
- model:
string
- netId:
number
- plate:
string
- group?:
string
- id?:
number
- owner?:
number
- vin?:
string
OxVehicle.delete
Despawns the vehicle and removes it from the database.
vehicle.delete()
OxVehicle.despawn
Despawns the vehicle, optionally saving it to the database.
vehicle.despawn(save)
Parameters
- save?:
boolean
OxVehicle.get
Get the value of specific key from the vehicless's metadata.
vehicle.get(key)
Parameters
- key:
string
Returns
unknown
OxVehicle.getCoords
Returns the vehicle's current coordinates.
vehicle.getCoords(): Vector3
OxVehicle.getState
Returns the vehicle's statebag interface.
vehicle.getState()
Returns
StateBagInterface
OxVehicle.getStored
Returns the vehicle's "stored" state.
vehicle.getStored()
Returns
string?
OxVehicle.respawn
Spawns a new entity for the vehicle, removing an existing entity if it exists and reapplying stored vehicle properties.
vehicle.respawn(coords, rotation)
Parameters
- coords?:
vector3
- rotation?:
vector3
OxVehicle.save
Saves the vehicle to the database.
vehicle.save()
Returns
number
OxVehicle.set
Stores a value in the vehicle's metadata, which will be saved to the database (this behaviour is likely to be removed).
player.set(key, value)
Parameters
- key:
string
- value:
any
OxVehicle.setGroup
Sets the vehicle as a group vehicle "owned" by the given group name, or removes the group if omitted.
vehicle.setGroup(groupName)
Parameters
- groupName?:
string
OxVehicle.setOwner
Sets the owner of a vehicle as the given charId, or removes the owner if omitted.
vehicle.setOwner(charId)
Parameters
- charId?:
number
OxVehicle.setPlate
Sets the registered plate of a vehicle to the given value. The plate will be padded or stripped to 8 characters.
This plate is not necessarily the displayed plate on vehicle properties.
vehicle.setPlate(plate: string)
OxVehicle.setProperties
Saves the properties (mods, extras, etc.) stored on the vehicle, optionally applying them to the entity.
vehicle.setProperties(properties, apply)
Parameters
- properties:
VehicleProperties
- apply?:
boolean
OxVehicle.setStored
Sets the vehicle as "stored" at the given value (e.g. impound, garage, null), and optionally despawns the vehicle.
vehicle.setStored(value, despawn)
Parameters
- value?:
string
- despawn?:
boolean