# PLAYER::_GET_PLAYER_FREE_AIM_CLOSEST_ENTITY

- **Hash:** `0x7AE93C45EC14A166`
- **Namespace:** PLAYER
- **Runtime name (Lua/JS):** `GetPlayerFreeAimClosestEntity`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PLAYER/_GET_PLAYER_FREE_AIM_CLOSEST_ENTITY

## Signature

```c
BOOL _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY(Player player, Entity* entity);
```

## Parameters

- `player` (`Player`)
- `entity` (`Entity*`)

## Returns

`BOOL`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns true if any entity have been found closest to where the player is aiming at (like 5m max far). Seems to only work on human peds

Parameters:
- entity: Entity* - Pointer of closest entity.

Returns:
- success: bool - True if entity found, false otherwise.

Example video:
- https://imgur.com/a/JiqTmYl

*Source: VORPCORE RDR3natives*

Only used in script function PROCESS_PED_INTERRUPT_DIALOGUE
_GET_PLAYER_*

## Usage

### Lua

```lua
local retval, entity = GetPlayerFreeAimClosestEntity(player, entity)

-- always available, by hash
local retval, entity = Citizen.InvokeNative(0x7AE93C45EC14A166, player, Citizen.PointerValueIntInitialized(entity), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, entity] = GetPlayerFreeAimClosestEntity(player, entity);

// by hash
const [retval, entity] = Citizen.invokeNative('0x7AE93C45EC14A166', player, Citizen.pointerValueIntInitialized(entity), Citizen.returnResultAnyway());
```

### C#

```csharp
var entity = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x7AE93C45EC14A166, player, entity);
// entity.GetResult<int>()
```

- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
