---
name: "weaponsItems"
type: command
status: ok
groups: ["Unit Inventory", "Vehicle Inventory"]
arma3_since: "0.76"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/weaponsItems
revid: 369242
updated: 2024-09-03T10:35:40Z
---

# weaponsItems

*Command · Unit Inventory, Vehicle Inventory · Arma 3 v0.76*

## Description

Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons.

> [!NOTE]
> This command can return weapon magazine(s) if any are present. Or an empty array if weapon is stored without a magazine in it.

- Arma 3 v1.22 it is possible to query weapon holders and ammo crates with this command.
If the argument is a vehicle, the command will return vehicle's weapons.
If the argument is a container, the command will act identical to [weaponsItemsCargo](../commands/weaponsItemsCargo.md).
- Arma 3 v1.96 the returned array always contains secondary muzzle magazine info and consistent with [getUnitLoadout](../commands/getUnitLoadout.md) format for weapon items.
- Arma 3 v2.02 the returned array can contains binocular weapon items.

## Syntax

### Syntax 1

```sqf
weaponsItems vehicle
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - unit or vehicle

**Returns:** [Array](../topics/Array.md) of [Array](../topics/Array.md)s of weapon items, format [weapon, muzzle, flashlight, optics, [magazine, ammo], [magazine, ammo], bipod]:
- weapon: [String](../topics/String.md)
- muzzle: [String](../topics/String.md)
- flashlight: [String](../topics/String.md)
- optics: [String](../topics/String.md)
- [primaryMagazine, primaryAmmo]: [Array](../topics/Array.md) - could be empty
- [secondaryMagazine, secondaryAmmo]: [Array](../topics/Array.md) - could be empty
- bipod: [String](../topics/String.md)

> [!IMPORTANT]
> The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array, e.g do **not** assume the first item is always the primary weapon.

### Syntax 2

*since arma3 2.14*

```sqf
weaponsItems [vehicle, extended]
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md) - unit or vehicle
- `extended`: [Boolean](../topics/Boolean.md) - [true](../commands/true.md) to include muzzle information

**Returns:** [Array](../topics/Array.md) of [Array](../topics/Array.md)s (see above) in format [weapon, muzzle, flashlight, optics, [magazine, ammo, muzzle, maxammo], [magazine, ammo, muzzle, maxammo], bipod]

## Examples

### Example 1

```sqf
hint str weaponsItems player;
// returns e.g
/*
[
    ["arifle_MX_ACO_pointer_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], [], "bipod_01_F_blk"],
    ["launch_NLAW_F", "", "", "", ["NLAW_F", 1], [], ""],
    ["hgun_P07_F", "muzzle_snds_L", "", "", ["16Rnd_9x21_Mag", 11], [], ""]
]
// a loaded underbarrel grenade launcher can look like this:
[
    ["arifle_MX_GL_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], ["1Rnd_HE_Grenade_shell", 1], ""]
]
*/
```

### Example 2

```sqf
hint str weaponsItems vehicle player;
// returns e.g
/*
[
    ["gatling_30mm", "", "", "", ["250Rnd_30mm_HE_shells", 250], [], ""],
    ["missiles_SCALPEL", "", "", "", ["8Rnd_LG_scalpel", 8], [], ""],
    ["rockets_Skyfire", "", "", "", ["38Rnd_80mm_rockets", 38], [], ""]
]
*/
```

## See also

[weaponsItemsCargo](../commands/weaponsItemsCargo.md) · [primaryWeaponItems](../commands/primaryWeaponItems.md) · [secondaryWeaponItems](../commands/secondaryWeaponItems.md) · [handgunItems](../commands/handgunItems.md) · [addPrimaryWeaponItem](../commands/addPrimaryWeaponItem.md) · [addSecondaryWeaponItem](../commands/addSecondaryWeaponItem.md) · [addHandgunItem](../commands/addHandgunItem.md) · [primaryWeapon](../commands/primaryWeapon.md) · [secondaryWeapon](../commands/secondaryWeapon.md) · [handgunWeapon](../commands/handgunWeapon.md) · [binocular](../commands/binocular.md) · [weaponAccessories](../commands/weaponAccessories.md) · [addWeaponWithAttachmentsCargoGlobal](../commands/addWeaponWithAttachmentsCargoGlobal.md) · [BIS_fnc_weaponComponents](../functions/BIS_fnc_weaponComponents.md) · [weaponState](../commands/weaponState.md)

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