# WEAPON::_GET_BEST_PED_WEAPON_IN_GROUP

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

## Signature

```c
Hash _GET_BEST_PED_WEAPON_IN_GROUP(Ped ped, Hash weaponGroup, BOOL p2, BOOL p3);
```

## Parameters

- `ped` (`Ped`)
- `weaponGroup` (`Hash`)
- `p2` (`BOOL`)
- `p3` (`BOOL`)

## Returns

`Hash`

## Description

If near your horse when called, weapons stored on your horse will be considered
Returns weaponHash

## Usage

### Lua

```lua
local retval = GetBestPedWeaponInGroup(ped, weaponGroup, p2, p3)

-- always available, by hash
local retval = Citizen.InvokeNative(0x9F67929D98E7C6E8, ped, weaponGroup, p2, p3, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetBestPedWeaponInGroup(ped, weaponGroup, p2, p3);

// by hash
const retval = Citizen.invokeNative('0x9F67929D98E7C6E8', ped, weaponGroup, p2, p3, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x9F67929D98E7C6E8, ped, weaponGroup, p2, p3);
```

- Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat("name")` or a backtick literal like `` `name` ``.
- 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.*
