{"name":"weaponsInfo","title":"weaponsInfo","type":"command","url":"https://community.bistudio.com/wiki/weaponsInfo","revid":377065,"updated":"2026-01-01T09:09:48Z","groups":["Weapons"],"status":"ok","games":{"arma3":"2.10"},"since":"arma3 2.10","arma3_since":"2.10","description":"Returns entity's weapons information including weapon index and firemode.","syntaxes":[{"syntax":"unit weaponsInfo [weaponOrMuzzle, onlyLoaded]","params":[{"name":"unit","type":"Object","description":"person","type_expr":"Object"},{"name":"weaponOrMuzzle","type":"String","description":"name of the weapon or muzzle (returns whichever matches first) or \"\" to return all weapons","type_expr":"String"},{"name":"onlyLoaded","type":"Boolean","optional":true,"default":"false","description":"true to return loaded weapons only","type_expr":"Boolean","text":"onlyLoaded: Boolean - (Optional, default false) true to return loaded weapons only"}],"returns":{"type":"Array of Arrays","type_expr":"Array<Array>","description":"with [weaponIndex, isSelected, weaponName, muzzleName, firemode, magazineName, ammoCount, isPrimary] (or an empty []):\n- weaponIndex: Number - internal weapon index (changes frequently) used with \"SwitchWeapon\" and \"UseWeapon\" actions - isSelected: Boolean - true if this weapon is currently selected - weaponName: String - weapon name - muzzleName: String - muzzle name - firemode: String - firemode that is set for this 'weaponIndex' - magazineName: String - name of the loaded magazine or \"\" - ammoCount: Number - magazine ammo count or -1 - isPrimary: Boolean - true if this muzzle is considered primary by the engine (Since Arma 3 2.14)","text":"Array of Arrays with [weaponIndex, isSelected, weaponName, muzzleName, firemode, magazineName, ammoCount, isPrimary] (or an empty []):\n\n- weaponIndex: Number - internal weapon index (changes frequently) used with \"SwitchWeapon\" and \"UseWeapon\" actions\n- isSelected: Boolean - true if this weapon is currently selected\n- weaponName: String - weapon name\n- muzzleName: String - muzzle name\n- firemode: String - firemode that is set for this 'weaponIndex'\n- magazineName: String - name of the loaded magazine or \"\"\n- ammoCount: Number - magazine ammo count or -1\n- isPrimary: Boolean - true if this muzzle is considered primary by the engine (Since Arma 3 2.14)"},"form":"binary","left":{"text":"unit"},"right":{"text":"[weaponOrMuzzle, onlyLoaded]"}}],"examples":[{"text":"Find weapon with FullAuto firemode and switch to it:\n\n```sqf\nprivate _weapons = player weaponsInfo [currentMuzzle player, true];\nprivate _found = _weapons findIf { _x select 4 == \"FullAuto\" };\nif (_found > -1) then { action [\"SwitchWeapon\", player, player, _weapons select _found select 0] };\n```","code":["private _weapons = player weaponsInfo [currentMuzzle player, true];\nprivate _found = _weapons findIf { _x select 4 == \"FullAuto\" };\nif (_found > -1) then { action [\"SwitchWeapon\", player, player, _weapons select _found select 0] };"]}],"see_also":["weaponState","weaponReloadingTime","action"]}