RedM Natives

GET_PED_NEARBY_PEDS

Hash0x23F8F5FC7E8C4A6B
Runtime nameGetPedNearbyPeds
NamespacePED
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x23F8F5FC7E8C4A6B

Signature

int GET_PED_NEARBY_PEDS(Ped ped, Any* sizeAndPeds, int ignoredPedType, int p3);

Parameters

NameTypeDescription
pedPed—
sizeAndPedsAny*—
ignoredPedTypeint—
p3int—

Returns int

Usage

Lua
local retval, sizeAndPeds = GetPedNearbyPeds(ped, ignoredPedType, p3)

-- always works, by hash
local retval, sizeAndPeds = Citizen.InvokeNative(0x23F8F5FC7E8C4A6B, ped, Citizen.PointerValueInt(), ignoredPedType, p3, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, sizeAndPeds] = GetPedNearbyPeds(ped, ignoredPedType, p3);

// by hash
const [retval, sizeAndPeds] = Citizen.invokeNative('0x23F8F5FC7E8C4A6B', ped, Citizen.pointerValueInt(), ignoredPedType, p3, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var sizeAndPeds = new OutputArgument();
int retval = Function.Call<int>((Hash)0x23F8F5FC7E8C4A6B, ped, sizeAndPeds, ignoredPedType, p3);
// sizeAndPeds.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.