# WEAPON::GET_PED_AMMO_BY_TYPE

- **Hash:** `0x39D22031557946C1`
- **Namespace:** WEAPON
- **Runtime name (Lua/JS):** `GetPedAmmoByType`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/WEAPON/GET_PED_AMMO_BY_TYPE

## Signature

```c
int GET_PED_AMMO_BY_TYPE(Ped ped, Hash ammoType);
```

## Parameters

- `ped` (`Ped`)
- `ammoType` (`Hash`)

## Returns

`int`

## Usage

### Lua

```lua
local retval = GetPedAmmoByType(ped, ammoType)

-- always available, by hash
local retval = Citizen.InvokeNative(0x39D22031557946C1, ped, ammoType, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetPedAmmoByType(ped, ammoType);

// by hash
const retval = Citizen.invokeNative('0x39D22031557946C1', ped, ammoType, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x39D22031557946C1, ped, ammoType);
```

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

## See also

- [WEAPON::SET_PED_AMMO_BY_TYPE](https://natives.borderlinerp.com/natives/WEAPON/SET_PED_AMMO_BY_TYPE.md)

*Sources: alloc8or RDR3 NativeDB.*
