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.
Syntax
Syntax 1
unit addWeaponItem [weaponName, itemName, instant]
Parameters:
unit: ObjectweaponName: String - name of the weapon to add magazine toitemName: String - class name of the item to add (if magazine, muzzle will be autodetected)instant: Boolean - (Optional, default false) true to skip animation (since arma3 1.96)
Returns: Nothing
Syntax 2
unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName], instant]
Parameters:
unit: ObjectweaponName: String - name of the weapon to add magazine toitemName: String - class name of the item to add (if magazine, muzzle will be autodetected unless specified)ammoCount: Number - (Optional) optional amount of ammo in magazinemuzzleName: String - (Optional) optional target muzzle to add magazine toinstant: Boolean - (Optional, default false) true to skip animation (since arma3 1.96)
Returns: Nothing
Examples
Example 1
player addWeaponItem ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];
Example 2
player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];
Example 3
player addWeaponItem ["LaserDesignator", "LaserBatteries"];
See also
removeWeaponItem · addPrimaryWeaponItem · addSecondaryWeaponItem · addHandgunItem · addBinocularItem · weaponsItems · handgunItems · primaryWeaponItems · secondaryWeaponItems · binocularItems · removePrimaryWeaponItem · removeSecondaryWeaponItem · removeHandgunItem · removeBinocularItem