{"name":"addWeaponItem","operator":null,"title":"addWeaponItem","type":"command","url":"https://community.bistudio.com/wiki/addWeaponItem","revid":376456,"updated":"2025-10-14T21:27:36Z","groups":["Unit Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.38"}],"since":{"game":"arma3","name":"Arma 3","version":"1.38"},"arma3_since":"1.38","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified. Since Arma 3 2.22 it is possible to add a magazine directly into a 'Throw' muzzle provided it is configured with `keepInInventory = 0;`. To remove such magazine see removeWeaponItem.","syntaxes":[{"syntax":"unit addWeaponItem [weaponName, itemName, instant]","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":"weaponName","type":"String","optional":false,"default":null,"description":"name of the weapon to add magazine to","types":["String"],"since":null,"text":"weaponName: String - name of the weapon to add magazine to"},{"name":"itemName","type":"String","optional":false,"default":null,"description":"class name of the item to add (if magazine, muzzle will be autodetected)","types":["String"],"since":null,"text":"itemName: String - class name of the item to add (if magazine, muzzle will be autodetected)"},{"name":"instant","type":"Boolean","optional":true,"default":"false","description":"true to skip animation","types":["Boolean"],"since":"arma3 1.96","text":"instant: Boolean - (Optional, default false) true to skip animation"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[weaponName, itemName, instant]","types":["Array"]}},{"syntax":"unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName], instant]","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":"weaponName","type":"String","optional":false,"default":null,"description":"name of the weapon to add magazine to","types":["String"],"since":null,"text":"weaponName: String - name of the weapon to add magazine to"},{"name":"itemName","type":"String","optional":false,"default":null,"description":"class name of the item to add (if magazine, muzzle will be autodetected unless specified)","types":["String"],"since":null,"text":"itemName: String - class name of the item to add (if magazine, muzzle will be autodetected unless specified)"},{"name":"ammoCount","type":"Number","optional":true,"default":null,"description":"optional amount of ammo in magazine","types":["Number"],"since":null,"text":"ammoCount: Number - (Optional) optional amount of ammo in magazine"},{"name":"muzzleName","type":"String","optional":true,"default":null,"description":"optional target muzzle to add magazine to","types":["String"],"since":null,"text":"muzzleName: String - (Optional) optional target muzzle to add magazine to"},{"name":"instant","type":"Boolean","optional":true,"default":"false","description":"true to skip animation","types":["Boolean"],"since":"arma3 1.96","text":"instant: Boolean - (Optional, default false) true to skip animation"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[weaponName, [itemName, ammoCount, muzzleName], instant]","types":["Array"]}}],"examples":[{"text":"```sqf\nplayer addWeaponItem [\"arifle_MX_GL_ACO_F\", \"1Rnd_HE_Grenade_shell\"];\n```","code":["player addWeaponItem [\"arifle_MX_GL_ACO_F\", \"1Rnd_HE_Grenade_shell\"];"]},{"text":"```sqf\nplayer addWeaponItem [\"arifle_MX_GL_ACO_F\", [\"1Rnd_HE_Grenade_shell\", 1, \"GL_3GL_F\"]];\n```","code":["player addWeaponItem [\"arifle_MX_GL_ACO_F\", [\"1Rnd_HE_Grenade_shell\", 1, \"GL_3GL_F\"]];"]},{"text":"```sqf\nplayer addWeaponItem [\"LaserDesignator\", \"LaserBatteries\"];\n```","code":["player addWeaponItem [\"LaserDesignator\", \"LaserBatteries\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["removeWeaponItem","addPrimaryWeaponItem","addSecondaryWeaponItem","addHandgunItem","addBinocularItem","weaponsItems","handgunItems","primaryWeaponItems","secondaryWeaponItems","binocularItems","removePrimaryWeaponItem","removeSecondaryWeaponItem","removeHandgunItem","removeBinocularItem"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Introduced with Arma 3 version 1.38","Scripting Commands","Scripting Commands: Global Effect"]}