addWeaponItem

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Arma 3 version 1.38
  Arguments of this scripting command have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
1.38

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.

Syntax

Syntax:
unit addWeaponItem [weaponName, itemName]
Parameters:
unit: Object
[weaponName, itemName]: Array
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)
Return Value:
Nothing

Alternative Syntax

Syntax:
unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName]]
Parameters:
unit: Object
[weaponName, [magazineName, ammoCount, muzzleName]]: Array
weaponName: String - name of the weapon to add magazine to
[itemName, ammoCount, muzzleName]: Array
itemName: String - class name of the item to add (if magazine, muzzle will be autodetected unless specified)
ammoCount (Optional): Number - optional amount of ammo in magazine
muzzleName (Optional): String - optional target muzzle to add magazine to
Return Value:
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"]];

Additional Information

Multiplayer:
-
See also:
addPrimaryWeaponItemaddSecondaryWeaponItemaddHandgunItemweaponsItemshandgunItemsprimaryWeaponItemssecondaryWeaponItemsremovePrimaryWeaponItemremoveSecondaryWeaponItemremoveHandgunItem

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section