Vehicle
A class for vehicle entities implementing a custom statebag interface and common entity operations.
Constructor
lib.vehicle:new(handle)
import { Vehicle } from "@overextended/ox_lib";
new Vehicle(handle)
- handle:
numberThe entity's script handle.
Returns: Vehicle
Methods > setOnGround
Attempts to set the entity onto the ground.
On the server, this uses the ox_entity_setonground state and a statebag change handler.
entity:setOnGround()
entity.setOnGround()
Returns: boolean
Methods > getType
Gets the entity's vehicle type. See GetVehicleType.
entity:getType()
entity.getType()
Returns: string
Methods > getPlate
Gets the entity's number plate text.
entity:getPlate()
entity.getPlate()
Returns: string
Methods > setPlate
Sets the entity's number plate text.
entity:setPlate(plate)
entity.setPlate(plate)
- plate:
string
<include>GameEntity.mdx</include>