# ENTITY::GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM

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

## Signature

```c
Player GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM(Entity entity, int team, Ped playerPedToIgnore, int flags);
```

## Parameters

- `entity` (`Entity`)
- `team` (`int`)
- `playerPedToIgnore` (`Ped`)
- `flags` (`int`)

## Returns

`Player`

## Usage

### Lua

```lua
local retval = GetNearestPlayerToEntityOnTeam(entity, team, playerPedToIgnore, flags)

-- always available, by hash
local retval = Citizen.InvokeNative(0xB2C30C3B4AFF718C, entity, team, playerPedToIgnore, flags, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetNearestPlayerToEntityOnTeam(entity, team, playerPedToIgnore, flags);

// by hash
const retval = Citizen.invokeNative('0xB2C30C3B4AFF718C', entity, team, playerPedToIgnore, flags, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xB2C30C3B4AFF718C, entity, team, playerPedToIgnore, flags);
```

*Sources: alloc8or RDR3 NativeDB.*
