# PED::GET_PED_NEARBY_PEDS

- **Hash:** `0x23F8F5FC7E8C4A6B`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `GetPedNearbyPeds`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PED/GET_PED_NEARBY_PEDS

## Signature

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

## Parameters

- `ped` (`Ped`)
- `sizeAndPeds` (`Any*`)
- `ignoredPedType` (`int`)
- `p3` (`int`)

## Returns

`int`

## Usage

### Lua

```lua
local retval, sizeAndPeds = GetPedNearbyPeds(ped, ignoredPedType, p3)

-- always available, by hash
local retval, sizeAndPeds = Citizen.InvokeNative(0x23F8F5FC7E8C4A6B, ped, Citizen.PointerValueInt(), ignoredPedType, p3, Citizen.ResultAsInteger())
```

### JavaScript

```js
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#

```csharp
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.*
