The Lab
PED native

GET_PED_NEARBY_PEDS

returns int4 paramsbuild 1207

Fills the array sizeAndPeds with peds near ped, skipping peds of ignoredPedType, and returns how many were found. The first array element must hold the array size.

Signature

C
int GET_PED_NEARBY_PEDS(Ped ped, Any* sizeAndPeds, int ignoredPedType, int p3); // 0x23F8F5FC7E8C4A6B b1207

Parameters

#NameType
1pedPed
2sizeAndPedsAny* (out pointer)
3ignoredPedTypeint
4p3int

Facts

Facts about GET_PED_NEARBY_PEDS
Name
GET_PED_NEARBY_PEDS
Hash
0x23F8F5FC7E8C4A6B
Namespace
Returns
int
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, sizeAndPeds = Citizen.InvokeNative(0x23F8F5FC7E8C4A6B, -- GET_PED_NEARBY_PEDS
  PlayerPedId(), -- Ped ped
  Citizen.PointerValueInt(), -- Any* sizeAndPeds
  0, -- int ignoredPedType
  0, -- int p3
  Citizen.ResultAsInteger()
)
print(result, sizeAndPeds)
JavaScript
const [result, sizeAndPeds] = Citizen.invokeNative("0x23F8F5FC7E8C4A6B", // GET_PED_NEARBY_PEDS
  PlayerPedId(), // Ped ped
  Citizen.pointerValueInt(), // Any* sizeAndPeds
  0, // int ignoredPedType
  0, // int p3
  Citizen.resultAsInteger()
);
console.log(result, sizeAndPeds)
C#
var sizeAndPedsArg = new OutputArgument();
int result = Function.Call<int>((Hash)0x23F8F5FC7E8C4A6B, // GET_PED_NEARBY_PEDS
  API.PlayerPedId(), // Ped ped
  sizeAndPedsArg, // Any* sizeAndPeds
  0, // int ignoredPedType
  0 // int p3
);
int sizeAndPeds = sizeAndPedsArg.GetResult<int>();
All PED natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.