VehicleClientChecked by LS:MP1 output

getAllVehicles

GET_ALL_VEHICLES0x9B8E1BF04B51F2E8

The GTA V native GET_ALL_VEHICLES of the VEHICLE namespace, as LS:MP client scripts call it: the global function getAllVehicles, in JavaScript and in Lua.

SignatureJavaScript
getAllVehicles(): [result: number, vehsStruct: number[]]
SignatureLua
getAllVehicles(): integer, integer[]

Usage

JavaScript
const [result, vehsStruct] = getAllVehicles();
Lua
local result, vehsStruct = getAllVehicles()

Parameters

None. The game writes the output: it is handed back, not passed in.

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1resultintnumberintegerThe native’s own return value.
2vehsStructEntityListnumber[]integer[]output

On LS:MP

ℹ
Vehicle pool snapshot

Returns the count and up to 256 vehicle handles on this client. Use lsmp.getGamePool when you need the complete pool.

ℹ
GTA V Enhanced 1158.16

This LS:MP adapter is available on Enhanced 1158.16. Calls on another build raise an error.

Reference

Namespace
Vehicle VEHICLE
In the game
int GET_ALL_VEHICLES(EntityList* vehsStruct)
Hash
0x9B8E1BF04B51F2E8

Open in the interactive natives reference