# HUD::_HUD_CHECK_CLOSEST_HORSE

- **Hash:** `0x0501D52D24EA8934`
- **Namespace:** HUD
- **Runtime name (Lua/JS):** `HudCheckClosestHorse`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **Other names:** `_GET_NEAR_HORSE`
- **URL:** https://natives.borderlinerp.com/natives/HUD/_HUD_CHECK_CLOSEST_HORSE

## Signature

```c
Entity _HUD_CHECK_CLOSEST_HORSE(BOOL p0);
```

## Parameters

- `p0` (`BOOL`)

## Returns

`Entity`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns closest horse entity handle (about 3 meters; facing, directly riding, etc).
Maybe when horse hud interaction prompts are allowed to show (?)

Params: p0 is usually true, if its false the native returns the players ped handle (?)

_HIDE_* - _IGNORE_*

*Source: VORPCORE RDR3natives*

This native accepts 1 as parameter in the decompiles
returns the nearest horse handle if within 2 3 meters of the player, if not close enough returns false

NOTE: if type is 0 returns PlayerPedId always?

*Source: femga rdr3_discoveries*

```
0x0501d52d24ea8934 (by aaron1a12)
Seems to return horse ped when really close (facing, directly riding, etc)
Maybe when horse interaction prompts are allowed to show?

N_0x0501d52d24ea8934(1)
```

## Usage

### Lua

```lua
local retval = HudCheckClosestHorse(p0)

-- always available, by hash
local retval = Citizen.InvokeNative(0x0501D52D24EA8934, p0, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = HudCheckClosestHorse(p0);

// by hash
const retval = Citizen.invokeNative('0x0501D52D24EA8934', p0, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x0501D52D24EA8934, p0);
```

- 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, femga rdr3_discoveries.*
