getAllVehicles
GET_ALL_VEHICLES0x9B8E1BF04B51F2E8The 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.
getAllVehicles(): [result: number, vehsStruct: number[]]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.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | result | int | number | integer | The native’s own return value. |
| 2 | vehsStruct | EntityList | number[] | 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