Arma 3 Scripting

weapons

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.75

Command · also in Vehicle Inventory · Markdown · JSON · original wiki page

Description

Returns array of names of all unit's weapons.

Syntax

weapons unit

Parameters:

Returns: Array of Strings - weapon class names

Examples

Example 1

_wArray = weapons player;

See also

magazines · weaponsTurret · assignedVehicleRole · weaponState

Community notes

Bdfy

Armed Assault v1.02 This command returns only weapons defined for the primary turret of the vehicle. for ex. only ["D81", "PKT"] for t72, not ["D81", "PKT","DSHKM"]

Donnervogel

weapons never returns the weapon "Throw" which all soldier units have have to throw hand grenades. You'd have to use hasWeapon to verify it. Also hand grenades are not listed since they are magazines. Use magazines for that.

.kju

Use weaponsTurret to determine the weapons of a non gunner/turret position.

Dr_Eyeball

This command does not include non-turret weapons, such as smoke, flare or chaff launchers which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. (Unsure whether it excludes it because it is not in the turret or because these are not considered true weapons via some property.)