getPedNearbyPeds
GET_PED_NEARBY_PEDS0x23F8F5FC7E8C4A6BThe GTA V native GET_PED_NEARBY_PEDS of the PED namespace, as LS:MP client scripts call it: the global function getPedNearbyPeds, in JavaScript and in Lua.
getPedNearbyPeds(ped: Ped, ignore: number): [
result: number,
sizeAndPeds: number[]
]getPedNearbyPeds(ped: Ped, ignore: integer): integer, integer[]Usage
JavaScript
const [result, sizeAndPeds] = getPedNearbyPeds(ped, ignore);Lua
local result, sizeAndPeds = getPedNearbyPeds(ped, ignore)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
ignore | int | 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 | sizeAndPeds | EntityList | number[] | integer[] | output |
On LS:MP
ℹ
Ped handles
Pass a valid ped handle and a ped type to exclude. Use -1 for no exclusion. Returns the count followed by up to 256 nearby ped 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
sizeAndPeds 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_PEDS(Ped ped, EntityList* sizeAndPeds, int ignore)- Hash
0x23F8F5FC7E8C4A6B