getPedNearbyVehicles
GET_PED_NEARBY_VEHICLES0xCFF869CBFA210D82The GTA V native GET_PED_NEARBY_VEHICLES of the PED namespace, as LS:MP client scripts call it: the global function getPedNearbyVehicles, in JavaScript and in Lua.
getPedNearbyVehicles(ped: Ped): [result: number, sizeAndVehs: number[]]getPedNearbyVehicles(ped: Ped): integer, integer[]Usage
JavaScript
const [result, sizeAndVehs] = getPedNearbyVehicles(ped);Lua
local result, sizeAndVehs = getPedNearbyVehicles(ped)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
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 | sizeAndVehs | EntityList | number[] | integer[] | output |
On LS:MP
ℹ
Vehicle handles
Pass a valid ped handle. Returns the count followed by up to 256 nearby vehicle handles from the ped scanner.
ℹ
GTA V Enhanced 1158.16
This LS:MP adapter is available on Enhanced 1158.16. Calls on another build raise an error.
ℹ
Checked by LS:MP
sizeAndVehs is required. Otherwise the call is ignored and returns 0: nothing reaches the game, and no error is raised.
Reference
- Namespace
- Ped PED
- In the game
int GET_PED_NEARBY_VEHICLES(Ped ped, EntityList* sizeAndVehs)- Hash
0xCFF869CBFA210D82