---
name: "weaponsTurret"
type: command
status: ok
groups: ["Turrets"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/weaponsTurret
revid: 377486
updated: 2026-01-02T06:49:06Z
---

# weaponsTurret

*Command · Turrets · Arma 3 v0.50 · introduced in Arma 2: Operation Arrowhead v1.52*

Locality: arguments **global**

## Description

Returns all weapons of a given turret. Use turret path [-1] for driver's turret.

## Syntax

```sqf
vehicle weaponsTurret turretPath
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md)
- `turretPath`: Turret Path

**Returns:** [Array](../topics/Array.md) of [String](../topics/String.md)s

## Examples

### Example 1

```sqf
_weapons = vehicle player weaponsTurret [0,0];
```

### Example 2

```sqf
_weapons = _tank weaponsTurret [0];
```

### Example 3

```sqf
_driverWeapon = _ka50pilot weaponsTurret [-1];
```

### Example 4

```sqf
_weaponsForAnyTurrentPosition = (vehicle player) weaponsTurret ((assignedVehicleRole player) select 1);
```

## See also

[addMagazineTurret](../commands/addMagazineTurret.md) · [magazinesTurret](../commands/magazinesTurret.md) · [removeMagazinesTurret](../commands/removeMagazinesTurret.md) · [removeMagazineTurret](../commands/removeMagazineTurret.md) · [weapons](../commands/weapons.md) · [assignedVehicleRole](../commands/assignedVehicleRole.md) · [addWeaponTurret](../commands/addWeaponTurret.md) · [removeWeaponTurret](../commands/removeWeaponTurret.md) · [turretLocal](../commands/turretLocal.md)

## Community notes

**.kju** — 2011-03-11

Use [assignedVehicleRole](../commands/assignedVehicleRole.md) in combination to easily determine the weapons for any vehicle position. You need to check for -1 if the unit is in the driver/pilot position. See example 3 and 4.

---

**DenV** — 2012-05-30

Returns information (including the turrets paths) about all weapons on turrets

```sqf
funcGetTurretsWeapons = {
    private ["_result", "_getAnyMagazines", "_findRecurse", "_class"];
    _result = [];
    _getAnyMagazines = {
        private ["_weapon", "_mags"];
        _weapon = configFile >> "CfgWeapons" >> _this;
        _mags = [];
        {
            _mags = _mags + getArray (
                (if (_x == "this") then { _weapon } else { _weapon >> _x }) >> "magazines"
            )
        } forEach getArray (_weapon >> "muzzles");
        _mags
    };
    _findRecurse = {
        private ["_root", "_class", "_path", "_currentPath"];
        _root = (_this select 0);
        _path = +(_this select 1);
        for "_i" from 0 to count _root -1 do {
            _class = _root select _i;
            if (isClass _class) then {
                _currentPath = _path + [_i];
                {
                    _result set [count _result, [_x, _x call _getAnyMagazines, _currentPath, str _class]];
                } forEach getArray (_class >> "weapons");
                _class = _class >> "turrets";
                if (isClass _class) then {
                    [_class, _currentPath] call _findRecurse;
                };
            };
        };
    };
    _class = (
        configFile >> "CfgVehicles" >> (
            switch (typeName _this) do {
                case "STRING" : {_this};
                case "OBJECT" : {typeOf _this};
                default {nil}
            }
        ) >> "turrets"
    );
    [_class, []] call _findRecurse;
    _result;
};
```

This call:

```sqf
"M1A2_US_TUSK_MG_EP1" call funcGetTurretsWeapons;
```

will return all turrets weapons, their magazines and their paths:

```
[
    ["M256", ["20Rnd_120mmSABOT_M1A2", "20Rnd_120mmHE_M1A2"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"],
    ["M240_veh", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"],
    ["M2BC", ["100Rnd_127x99_M2"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"],
    ["SmokeLauncher", ["SmokeLauncherMag"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"],
    ["M240_veh_2", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0, 1], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/LoaderTurret"]
]
```

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