{"name":"weaponAccessories","operator":null,"title":"weaponAccessories","type":"command","url":"https://community.bistudio.com/wiki/weaponAccessories","revid":353156,"updated":"2024-03-12T12:48:33Z","groups":["Unit Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Get array with all items linked to a given weapon.\n\n> [!IMPORTANT]\n> This command does not return loaded magazines, see weaponsItems","syntaxes":[{"syntax":"unit weaponAccessories weapon","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"weapon","type":"String","optional":false,"default":null,"description":"primary, secondary or handgun","types":["String"],"since":null,"text":"weapon: String - primary, secondary or handgun"}],"returns":{"type":"Array","types":["Array"],"description":"[silencer, laserpointer/flashlight, optics, bipod]","text":"Array - [silencer, laserpointer/flashlight, optics, bipod]"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"weapon","types":["String"]}}],"examples":[{"text":"```sqf\nplayer weaponAccessories primaryWeapon player; //[\"\",\"acc_pointer_IR\",\"optic_Aco\",\"\"]\n```","code":["player weaponAccessories primaryWeapon player; //[\"\",\"acc_pointer_IR\",\"optic_Aco\",\"\"]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["weaponAccessoriesCargo","handgunItems","primaryWeaponItems","secondaryWeaponItems","weaponsItems","weaponsItemsCargo"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Introduced with Arma 3 version 0.50","Scripting Commands"]}