Arma 3 Scripting

addPrimaryWeaponItem

  • Local argument
  • Global effect
  • Arma 3 v0.50

Command · Markdown · JSON · original wiki page

Description

Adds weapon item, including magazine, directly to the primaryWeapon. This is used for infantry weapons.

Syntax

unit addPrimaryWeaponItem item

Parameters:

Returns: Nothing or Boolean - false is returned if item can not be added

Examples

Example 1

player addPrimaryWeaponItem "muzzle_snds_H";

See also

addWeaponItem · removePrimaryWeaponItem · removeAllPrimaryWeaponItems · addSecondaryWeaponItem · addHandgunItem · addBinocularItem · weaponsItems · handgunItems · primaryWeaponItems · secondaryWeaponItems · binocularItems

Community notes

SilentSpike

If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also not added to the unit's inventory in such a case.