# WEAPON::HAS_PED_GOT_WEAPON

- **Hash:** `0x8DECB02F88F428BC`
- **Namespace:** WEAPON
- **Runtime name (Lua/JS):** `HasPedGotWeapon`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/WEAPON/HAS_PED_GOT_WEAPON

## Signature

```c
BOOL HAS_PED_GOT_WEAPON(Ped ped, Hash weaponHash, int p2, BOOL onlyCheckPlayerInventory);
```

## Parameters

- `ped` (`Ped`)
- `weaponHash` (`Hash`)
- `p2` (`int`)
- `onlyCheckPlayerInventory` (`BOOL`)

## Returns

`BOOL`

## Description

onlyCheckPlayerInventory: If true, it will only check the players current inventory. If false, it also checks your horse inventory

## Usage

### Lua

```lua
local retval = HasPedGotWeapon(ped, weaponHash, p2, onlyCheckPlayerInventory)

-- always available, by hash
local retval = Citizen.InvokeNative(0x8DECB02F88F428BC, ped, weaponHash, p2, onlyCheckPlayerInventory, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const retval = HasPedGotWeapon(ped, weaponHash, p2, onlyCheckPlayerInventory);

// by hash
const retval = Citizen.invokeNative('0x8DECB02F88F428BC', ped, weaponHash, p2, onlyCheckPlayerInventory, Citizen.returnResultAnyway());
```

### C#

```csharp
bool retval = Function.Call<bool>((Hash)0x8DECB02F88F428BC, ped, weaponHash, p2, onlyCheckPlayerInventory);
```

- 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` ``.

*Sources: alloc8or RDR3 NativeDB.*
