Vehicle
This page describes the vehicle API
Get vehicles
vehicleList()
Retrieves all online vehicle IDs.
Spawn
vehicleSpawn(string, vec3, float)
Spawns the vehicle at a specified position and heading direction.
Remarks
You can use the following listing for vehicle model names.
Arguments
Type | Description |
string | Model name |
vec3 | Position |
float | Heading direction |
Returns
Vehicle ID if spawned, -1 if failed.
Despawn
vehicleDespawn(vehicle)
Despawns a vehicle
Invalid
vehicleInvalid(vehicle)
Checkes whether the vehicle ID is invalid.
Repair
vehicleRepair(vehicle)
Repairs the vehicle.
Set position
vehiclePositionSet(vehicle, vec3)
Sets the vehicle position.
Set direction
vehicleDirectionSet(vehicle, vec3)
Sets the vehicle forward direction vector.
Set heading
vehicleHeadingSet(vehicle, float)
Sets the vehicle heading angle.
Set fuel
vehicleFuelSet(vehicle, float)
Set vehicle fuel level
Set transparency
vehicleTransparencySet(vehicle, float)
Set vehicle transparency value
Set lock
vehicleLockSet(vehicle, int)
Locks/Unlocks the vehicle
Get position
vehiclePositionGet(vehicle)
Gets the vehicle position.
Get direction
vehicleDirectionGet(vehicle)
Gets the vehicle direction.
Get heading
vehicleHeadingGet(vehicle)
Retrieves the vehicle's heading angle.
Get fuel
vehicleFuelGet(vehicle)
Retrieves the vehicle's fuel level.
Get transparency
vehicleTransparencyGet(vehicle)
Retrieves the vehicle's transparency value.
Get lock
vehicleLockGet(vehicle)
Retrieves the vehicle's lock state.
Visibility
There are several visibility options you can set for the vehicle:
Name | Description |
VISIBILITY_ICON | Vehicle's blip visibility on the map |
VISIBILITY_RADAR | Vehicle's marker visibility on the radar |
VISIBILITY_COLLISION | Vehicle's collision state |
VISIBILITY_MODEL | Vehicle's transparency state |
Get visibility
vehicleVisibilityGet(vehicle, visibility_type)
Retrieves the current vehicle's visibility.
Set visibility
vehicleVisibilitySet(vehicle, visibility_type, int)
Sets the current vehicle's visibility setting.
Last updated