---
name: "weaponState"
type: command
status: ok
groups: ["Weapons"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/weaponState
revid: 378932
updated: 2026-08-19T22:08:00Z
---

# weaponState

*Command · Weapons · Arma 3 v0.50 · introduced in Arma 2: Operation Arrowhead v1.60*

## Description

Returns the given or currently selected weapon state for unit or vehicle.
With [#Syntax 2](../commands/weaponState.md#syntax-2), if no optional arguments are present, currently selected weapon is queried.

> [!NOTE]
> **Arma 3:** Since Arma 3 v1.70 this command has been improved and extended:
> - A vehicle's weapon query doesn't need a weapon operator provided the weapon or muzzle is specified in optional param.
> (keep in mind that by default a vehicle has no weapons selected)
> - Driver turret can now be accessed as well with turret path [-1].
> - Muzzle name is supported as well as weapon name. The command searches for weapon first, then if not found, muzzle is searched for.

## Syntax

### Syntax 1

```sqf
weaponState unit
```

**Parameters:**

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

**Returns:** [Array](../topics/Array.md) with [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase]
- weapon: [String](../topics/String.md)
- muzzle: [String](../topics/String.md)
- firemode: [String](../topics/String.md)
- magazine: [String](../topics/String.md)
- ammoCount: [Number](../topics/Number.md)
- Arma 3 v2.06 roundReloadPhase: [Number](../topics/Number.md) in range -1 or 0..1 - current ammo round reload phase (see [weaponReloadingTime](../commands/weaponReloadingTime.md)). -1 when weapon has magazine removed
- Arma 3 v2.06 magazineReloadPhase: [Number](../topics/Number.md) in range 1..0 - current magazine reload phase, 0 - reload complete. > 0 - reload in progress

### Syntax 2

```sqf
weaponState [vehicle, turretPath, weapon, muzzle, firemode]
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md)
- `turretPath`: Turret Path
- `weapon`: [String](../topics/String.md) - (Optional, default `""`) weapon or muzzle name *(since arma3 1.70)*
- `muzzle`: [String](../topics/String.md) - (Optional, default `""`) muzzle name *(since arma3 2.08)*
- `firemode`: [String](../topics/String.md) - (Optional, default `""`) firemode name *(since arma3 2.08)*

**Returns:** [Array](../topics/Array.md) with [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase]
- weapon: [String](../topics/String.md)
- muzzle: [String](../topics/String.md)
- firemode: [String](../topics/String.md)
- magazine: [String](../topics/String.md)
- ammoCount: [Number](../topics/Number.md)
- Arma 3 v2.06 roundReloadPhase: [Number](../topics/Number.md) - current ammo round reload phase (see [weaponReloadingTime](../commands/weaponReloadingTime.md))
- Arma 3 v2.06 magazineReloadPhase: [Number](../topics/Number.md) - current magazine reload phase from 1 to 0, 0 - reload complete. > 0 - reload in progress

### Syntax 3

*since arma3 2.06*

```sqf
unit weaponState weaponOrMuzzle
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `weaponOrMuzzle`: [String](../topics/String.md)

**Returns:** [Array](../topics/Array.md) with [weapon, muzzle, firemode, magazine, ammoCount, roundReloadPhase, magazineReloadPhase]
- weapon: [String](../topics/String.md)
- muzzle: [String](../topics/String.md)
- firemode: [String](../topics/String.md)
- magazine: [String](../topics/String.md)
- ammoCount: [Number](../topics/Number.md)
- Arma 3 v2.06 roundReloadPhase: [Number](../topics/Number.md) - current ammo round reload phase (see [weaponReloadingTime](../commands/weaponReloadingTime.md))
- Arma 3 v2.06 magazineReloadPhase: [Number](../topics/Number.md) - current magazine reload phase from 1 to 0, 0 - reload complete. > 0 - reload in progress

## Examples

### Example 1

```sqf
_wsPlayer = weaponState player;                    // ["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30,0,0]
```

### Example 2

Query currently selected gunner weapon:

```sqf
_wsVehicle = weaponState [_apc, [0]];            // ["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60,0,0]
```

### Example 3

```sqf
_wsVehicle = weaponState [_apc, [0], "AP"];        // ["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40,0,0]
```

### Example 4

```sqf
_wsPlayer = player weaponState "GL_3GL_F";        // ["arifle_MX_GL_ACO_F","GL_3GL_F","Single","1Rnd_HE_Grenade_shell",1,0,0]
```

## See also

[weapons](../commands/weapons.md) · [selectWeaponTurret](../commands/selectWeaponTurret.md) · [loadMagazine](../commands/loadMagazine.md) · [magazinesTurret](../commands/magazinesTurret.md) · [weaponsTurret](../commands/weaponsTurret.md) · [weaponReloadingTime](../commands/weaponReloadingTime.md)

## Community notes

**AgentRev** — 2022-03-31

In the case of a GL rifle, if the rifle is currently in GL mode, syntax 3 will return the same result for either muzzle:

```sqf
player selectWeapon "GL_3GL_F";
_state = player weaponState "arifle_MX_GL_ACO_F";    // ["arifle_MX_GL_ACO_F","GL_3GL_F","Single","1Rnd_HE_Grenade_shell",1,0,0]
_state = player weaponState "GL_3GL_F";                // ["arifle_MX_GL_ACO_F","GL_3GL_F","Single","1Rnd_HE_Grenade_shell",1,0,0]
```

In rifle mode, the result is different:

```sqf
player selectWeapon "arifle_MX_GL_ACO_F";
_state = player weaponState "arifle_MX_GL_ACO_F";    // ["arifle_MX_GL_ACO_F","arifle_MX_GL_ACO_F","Single","30Rnd_65x39_caseless_mag",30,0,0]
_state = player weaponState "GL_3GL_F";                // ["arifle_MX_GL_ACO_F","GL_3GL_F","Single","1Rnd_HE_Grenade_shell",1,0,0]
```

Therefore, in order to gather all states of one multi-muzzle weapon, we have to do some masochistic stuff:

```sqf
fn_getWeaponStates =
{
    params ["_unit", "_weapon"];
    private _origState = weaponState _unit select [0,3];
    private _muzzles = [_weapon] + (getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles") select { _x != "this" });
    private _states = [];

    {
        _unit selectWeapon _x;
        _states pushBack weaponState _unit;
    } forEach _muzzles;

    _unit selectWeapon _origState;
    _states;
};

private _result = [player, primaryWeapon player] call fn_getWeaponStates;
/*
    [
        ["arifle_MX_GL_ACO_F", "arifle_MX_GL_ACO_F", "Single", "30Rnd_65x39_caseless_mag", 30, 0, 0],
        ["arifle_MX_GL_ACO_F", "GL_3GL_F", "Single", "1Rnd_HE_Grenade_shell", 1, 0, 0]
    ]
*/
```

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