Skip to main content

Vehicles

All the pool vehicle related functions.

GetAll

Function

local Pools = WXSCore.Pools
Pools.Vehicles:GetAll()

Returns

NameTypeDescription
vehiclesnumber[]A table of all the vehicles handles.

Example

local Pools = WXSCore.Pools
local vehicles = Pools.Vehicles:GetAll()

GetInArea

Function

local Pools = WXSCore.Pools
Pools.Vehicles:GetInArea(coords, radius)

Parameters

NameTypeDescription
coordsvector3The coordinates of the area.
radiusfloatThe radius of the area.

Returns

NameTypeDescription
vehiclesnumber[]A table of all the vehicles handles in the area.

Example

local Pools = WXSCore.Pools
local vehicles = Pools.Vehicles:GetInArea(vector3(0.0, 0.0, 0.0), 100.0)

GetClosest

Function

local Pools = WXSCore.Pools
Pools.Vehicles:GetClosest(coords)

Parameters

NameTypeDescription
coordsvector3The coordinates of the area.

Returns

NameTypeDescription
vehiclenumberThe vehicle handle of the closest vehicle.
distancefloatThe distance between the closest vehicle and the coords.

Example

local Pools = WXSCore.Pools
local vehicle, distance = Pools.Vehicles:GetClosest(vector3(0.0, 0.0, 0.0))