---
name: "ammo"
type: command
status: ok
groups: ["Unit Inventory"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/ammo
revid: 364083
updated: 2024-05-03T19:33:29Z
---

# ammo

*Command · Unit Inventory · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Locality: arguments **global**

## Description

Check how many rounds are left in the currently loaded magazine in the given muzzle.

> [!NOTE]
> In older titles and before Arma 3 v1.56, the command did not return ammo for units in vehicles.

## Syntax

```sqf
unit ammo muzzle
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `muzzle`: [String](../topics/String.md) - weapon's muzzle - see the Weapons topic for reference about possible values

**Returns:** [Number](../topics/Number.md)

## Examples

### Example 1

```sqf
_count = player ammo "M16"; // returns 30 in case of a full magazine
```

### Example 2

```sqf
_count = player ammo "M203Muzzle";
```

### Example 3

```sqf
_count = player ammo primaryWeapon player;
```

## See also

[setAmmo](../commands/setAmmo.md) · [someAmmo](../commands/someAmmo.md) · [magazines](../commands/magazines.md)

## Community notes

**.kju** — 2012-02-17

The command works (now?) also for units in vehicles. However only for the vehicle's gunners' weapons - aka those returned by "weapons vehicle".

---

**.kju** — 2018-08-30

Actually the command wants the `currentMuzzle (gunner _vehicle)` as parameter - not the weapon class.
Most of the time both are the same. However when you have custom modes[] for the weapons, this is likely not true.

<sub>Source: [BI Community Wiki — ammo](https://community.bistudio.com/wiki/ammo) (revision 364083).</sub>
