# WEAPON::_GET_BEST_PED_WEAPON_IN_INVENTORY

- **Hash:** `0x7B98500614C8E8B8`
- **Namespace:** WEAPON
- **Runtime name (Lua/JS):** `GetBestPedWeaponInInventory`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** named only
- **Since game build:** 1232
- **URL:** https://natives.borderlinerp.com/natives/WEAPON/_GET_BEST_PED_WEAPON_IN_INVENTORY

## Signature

```c
Any _GET_BEST_PED_WEAPON_IN_INVENTORY(Ped ped, Any p1, Any* guidPrimary);
```

## Parameters

- `ped` (`Ped`)
- `p1` (`Any`)
- `guidPrimary` (`Any*`)

## Returns

`Any`

## Usage

### Lua

```lua
local retval, guidPrimary = GetBestPedWeaponInInventory(ped, p1, guidPrimary)

-- always available, by hash
local retval, guidPrimary = Citizen.InvokeNative(0x7B98500614C8E8B8, ped, p1, Citizen.PointerValueIntInitialized(guidPrimary), Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, guidPrimary] = GetBestPedWeaponInInventory(ped, p1, guidPrimary);

// by hash
const [retval, guidPrimary] = Citizen.invokeNative('0x7B98500614C8E8B8', ped, p1, Citizen.pointerValueIntInitialized(guidPrimary), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var guidPrimary = new OutputArgument();
int retval = Function.Call<int>((Hash)0x7B98500614C8E8B8, ped, p1, guidPrimary);
// guidPrimary.GetResult<int>()
```

- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.
- 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.*
