{"name":"weaponsInfo","operator":null,"title":"weaponsInfo","type":"command","url":"https://community.bistudio.com/wiki/weaponsInfo","revid":377065,"updated":"2026-01-01T09:09:48Z","groups":["Weapons"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.10"}],"since":{"game":"arma3","name":"Arma 3","version":"2.10"},"arma3_since":"2.10","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns entity's weapons information including weapon index and firemode.","syntaxes":[{"syntax":"unit weaponsInfo [weaponOrMuzzle, onlyLoaded]","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"person","types":["Object"],"since":null,"text":"unit: Object - person"},{"name":"weaponOrMuzzle","type":"String","optional":false,"default":null,"description":"name of the weapon or muzzle (returns whichever matches first) or \"\" to return all weapons","types":["String"],"since":null,"text":"weaponOrMuzzle: String - name of the weapon or muzzle (returns whichever matches first) or \"\" to return all weapons"},{"name":"onlyLoaded","type":"Boolean","optional":true,"default":"false","description":"true to return loaded weapons only","types":["Boolean"],"since":null,"text":"onlyLoaded: Boolean - (Optional, default false) true to return loaded weapons only"}],"returns":{"type":"Array of Arrays with [weaponIndex, isSelected, weaponName, muzzleName, firemode, magazineName, ammoCount, isPrimary] (or an empty []):","types":["Array"],"description":"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- 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","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[weaponOrMuzzle, onlyLoaded]","types":["Array"]}}],"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] };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["weaponState","weaponReloadingTime","action"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Weapons","Introduced with Arma 3 version 2.10","Scripting Commands"]}