{"name":"primaryWeaponItems","operator":null,"title":"primaryWeaponItems","type":"command","url":"https://community.bistudio.com/wiki/primaryWeaponItems","revid":378479,"updated":"2026-04-24T11:51:13Z","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":"global","effect":null,"server_exec":false},"exec":null,"description":"Returns array with all items assigned to the primaryWeapon except magazines. Use primaryWeaponMagazine command for the latter. This command is used for infantry weapons only.","syntaxes":[{"syntax":"primaryWeaponItems unit","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"}],"returns":{"type":"Array with [muzzle, rail, optic, bipod]","types":["Array"],"description":"muzzle: String - class name of the muzzle attachment (silencer, flash hider) - rail: String - class name of the rail attachement (laserpointer/flashlight) - optic: String - bipod: String","text":"Array with [muzzle, rail, optic, bipod]\n- muzzle: String - class name of the muzzle attachment (silencer, flash hider)\n- rail: String - class name of the rail attachement (laserpointer/flashlight)\n- optic: String\n- bipod: String"},"form":"unary","operator":null,"left":null,"right":{"text":"unit","types":["Object"]}}],"examples":[{"text":"```sqf\nprimaryWeaponItems player;\n/*\n[\n    \"muzzle_snds_H\",    // silencer\n    \"acc_pointer_IR\",    // laser\n    \"optic_Aco\",        // optics\n    \"bipod_01_F_blk\"    // bipod\n]\n*/\n```","code":["primaryWeaponItems player;\n/*\n[\n\t\"muzzle_snds_H\",\t// silencer\n\t\"acc_pointer_IR\",\t// laser\n\t\"optic_Aco\",\t\t// optics\n\t\"bipod_01_F_blk\"\t// bipod\n]\n*/"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["addPrimaryWeaponItem","removePrimaryWeaponItem","removeAllPrimaryWeaponItems","weaponAccessories","weaponAccessoriesCargo","handgunItems","binocularItems","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"]}