addWeaponItem: Difference between revisions
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
|gr1= Unit Inventory | |gr1= Unit Inventory | ||
|descr= 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 <sqf>keepInInventory = 0;</sqf> | |descr= 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 <sqf>keepInInventory = 0;</sqf> To remove such magazine see [[removeWeaponItem]]. | ||
|s1= unit [[addWeaponItem]] [weaponName, itemName, instant] | |s1= unit [[addWeaponItem]] [weaponName, itemName, instant] |
Latest revision as of 19:33, 2 September 2025
Description
- 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 To remove such magazine see removeWeaponItem.
- Groups:
- Unit Inventory
Syntax
- Syntax:
- unit addWeaponItem [weaponName, itemName, instant]
- Parameters:
- unit: Object
- weaponName: String - name of the weapon to add magazine to
- itemName: String - class name of the item to add (if magazine, muzzle will be autodetected)
- since
1.96
- instant: Boolean - (Optional, default false) true to skip animation
- Return Value:
- Nothing
Alternative Syntax
- Syntax:
- unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName], instant]
- Parameters:
- unit: Object
- weaponName: String - name of the weapon to add magazine to
- itemName: String - class name of the item to add (if magazine, muzzle will be autodetected unless specified)
- ammoCount: Number - (Optional) optional amount of ammo in magazine
- muzzleName: String - (Optional) optional target muzzle to add magazine to
- since
1.96
- instant: Boolean - (Optional, default false) true to skip animation
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- removeWeaponItem addPrimaryWeaponItem addSecondaryWeaponItem addHandgunItem addBinocularItem weaponsItems handgunItems primaryWeaponItems secondaryWeaponItems binocularItems removePrimaryWeaponItem removeSecondaryWeaponItem removeHandgunItem removeBinocularItem
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note