{"name":"weapons","title":"weapons","type":"command","url":"https://community.bistudio.com/wiki/weapons","revid":379485,"updated":"2026-10-31T00:12:47Z","groups":["Unit Inventory","Vehicle Inventory"],"status":"ok","games":{"ofp":"1.75","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.75","arma3_since":"0.50","description":"Returns array of names of all unit's weapons.","syntaxes":[{"syntax":"weapons unit","params":[{"name":"unit","type":"Object","type_expr":"Object"}],"returns":{"type":"Array of Strings","type_expr":"Array<String>","description":"weapon class names"},"form":"unary","right":{"text":"unit"}}],"examples":[{"code":["_wArray = weapons player;"]}],"see_also":["magazines","weaponsTurret","assignedVehicleRole","weaponState"],"notes":[{"user":"Bdfy","date":"2007-01-20T12:07:00Z","text":"Armed Assault v1.02 This command returns only weapons defined for the primary turret of the vehicle.\nfor ex. only [\"D81\", \"PKT\"] for t72, not [\"D81\", \"PKT\",\"DSHKM\"]"},{"user":"Donnervogel","date":"2007-03-03T05:01:00Z","text":"*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."},{"user":".kju","date":"2011-03-11T00:00:00Z","text":"Use weaponsTurret to determine the weapons of a non gunner/turret position."},{"user":"Dr_Eyeball","date":"2011-11-25T00:00:00Z","text":"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.)"}]}