PedClientChecked by LS:MP1 output

getPedNearbyPeds

GET_PED_NEARBY_PEDS0x23F8F5FC7E8C4A6B

The 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.

SignatureJavaScript
getPedNearbyPeds(ped: Ped, ignore: number): [
  result: number,
  sizeAndPeds: number[]
]
SignatureLua
getPedNearbyPeds(ped: Ped, ignore: integer): integer, integer[]

Usage

JavaScript
const [result, sizeAndPeds] = getPedNearbyPeds(ped, ignore);
Lua
local result, sizeAndPeds = getPedNearbyPeds(ped, ignore)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
ignoreintnumberinteger

Returns

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

#ValueTypeJavaScriptLuaDescription
1resultintnumberintegerThe native’s own return value.
2sizeAndPedsEntityListnumber[]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

Open in the interactive natives reference