# Unit Inventory (scripting commands)

- [addBackpackGlobal](../../commands/addBackpackGlobal.md): Adds a backpack to a unit - global variant of addBackpack.
- [addBinocularItem](../../commands/addBinocularItem.md): Adds weapon item, including magazine, directly to the binocular weapon. This is used for infantry weapons.
- [addGoggles](../../commands/addGoggles.md): Create a new item and try to link it into goggles (glasses) slot.
- [addHandgunItem](../../commands/addHandgunItem.md): Adds weapon item, including magazine, directly to the handgunWeapon. This is used for infantry weapons.
- [addHeadgear](../../commands/addHeadgear.md): Creates a headgear item and tries to link it to headgear slot. If slot is occupied with another item, the item in the slot will be replaced.
- [addItem](../../commands/addItem.md): Creates new item and tries to add it into inventory. Inventory must have enough space to accomodate new item or command will fail.The item can also be a weapon or a magazine.
- [addItemToUniform](../../commands/addItemToUniform.md): Create new item and store it to soldier's uniform. The item can also be a weapon or a magazine.
- [addItemToVest](../../commands/addItemToVest.md): Create new item and store it to soldier's vest. The item can also be a weapon or a magazine.
- [addMagazine](../../commands/addMagazine.md): Adds a magazine to a person. Infantry units can only carry a specific number of magazines, once the magazine slots are filled (or uniform/vest/bagpack are full in Arma 3), any further addMagazine commands are ignored.
- [addMagazineGlobal](../../commands/addMagazineGlobal.md): Adds magazine to a unit regardless of locality. This command can also be used to add magazine to a vehicle, like a static gun, for example.
- [addMagazines](../../commands/addMagazines.md): Adds multiple magazines to the unit. For cargo containers use addMagazineCargoGlobal command.
- [addPrimaryWeaponItem](../../commands/addPrimaryWeaponItem.md): Adds weapon item, including magazine, directly to the primaryWeapon. This is used for infantry weapons.
- [addSecondaryWeaponItem](../../commands/addSecondaryWeaponItem.md): Adds weapon item, including magazine, directly to the secondaryWeapon. This is used for infantry weapons.
- [addUniform](../../commands/addUniform.md): Create a new uniform and try to link it into uniform slot (given uniform has to be supported by allowedUniforms list of target soldier).
- [addVest](../../commands/addVest.md): Create a new vest and try to link it into vest slot.
- [addWeapon](../../commands/addWeapon.md): Add a weapon to a unit. For a global version of this command see addWeaponGlobal.
- [addWeaponGlobal](../../commands/addWeaponGlobal.md): Add a weapon to a unit. Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command will replace the weapon currently in a slot with the added weapon if…
- [addWeaponItem](../../commands/addWeaponItem.md): 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.
- [ammo](../../commands/ammo.md): Check how many rounds are left in the currently loaded magazine in the given muzzle.
- [assignedItems](../../commands/assignedItems.md): Get array with assigned items. The resulting Array order is not guaranteed. To check availability of a particular slot item use getSlotItemName. To return stored items see items and itemsWithMagazines.
- [assignItem](../../commands/assignItem.md): Assigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced. See also linkItem.
- [backpackMagazines](../../commands/backpackMagazines.md): Get array with all magazines from backpack of the given unit.
- [backpacks](../../commands/backpacks.md): Returns an array of all backpack names a unit has in its inventory, excluding the one it carries on the back.
- [binocular](../../commands/binocular.md): Returns class name of currently used binocular weapon.
- [binocularItems](../../commands/binocularItems.md): Returns array with all items assigned to the binocular weapon except magazines. Use binocularMagazine command for the latter. This command is used for infantry weapons only.
- [binocularMagazine](../../commands/binocularMagazine.md): Collects all loaded magazines from all binocular muzzles and returns them in Array, otherwise it returns []. This command is used for infantry weapons only.
- [canAdd](../../commands/canAdd.md): Checks if given object can be stored in inventory of given object or any inventory container (uniform, vest, backpack) of given unit.
- [canAddItemToUniform](../../commands/canAddItemToUniform.md): Checks if given object can be stored into soldier's uniform.
- [canAddItemToVest](../../commands/canAddItemToVest.md): Checks if given object can be stored into soldier's vest.
- [currentMagazine](../../commands/currentMagazine.md): Returns class name of currently loaded vehicle's / unit's magazine.
- [currentMagazineDetail](../../commands/currentMagazineDetail.md): Returns description of vehicle's currently loaded magazine, its ammo count (current/default) and its id.
- [currentThrowable](../../commands/currentThrowable.md): Returns currently selected throwable (and the muzzle it is loaded into), which will be launched if the user presses <kbd>G</kbd>.
- [currentWeapon](../../commands/currentWeapon.md): Return the name of the currently selected weapon (on the primary turret for vehicles).
- [forceAddUniform](../../commands/forceAddUniform.md): Create a new uniform and hard link it into slot (without any restrictions).
- [gearIDCAmmoCount](../../commands/gearIDCAmmoCount.md): Returns ammo count of assigned magazine.
- [gearSlotAmmoCount](../../commands/gearSlotAmmoCount.md): Returns ammo count of assigned magazine.
- [gearSlotData](../../commands/gearSlotData.md): Returns gear slot item name.
- [getContainerMaxLoad](../../commands/getContainerMaxLoad.md): Returns max load value of given uniform, vest or backpack container. For other types of containers, use maxLoad command
- [getCorpse](../../commands/getCorpse.md): Returns the corpse associated with given weaponholder. When unit is killed and had a weapon, the weapon is placed inside "WeaponHolderSimulated" and dropped together with the unit.
- [getCorpseWeaponholders](../../commands/getCorpseWeaponholders.md): Returns primary and secondary weapon holders of a dead unit. If a unit had weapons at the moment of death, primary weapon is dropped into primary weaponholder and secondary weapon is dropped into secondary.
- [getSlotItemName](../../commands/getSlotItemName.md): Returns the name of assigned item in given slot or the empty string.
- [getUnitLoadout](../../commands/getUnitLoadout.md): Returns a Unit Loadout Array with all assigned items, weapons, containers and their stored items.
- [goggles](../../commands/goggles.md): Returns name of currently used goggles (for NVGoggles use hmd).
- [handgunItems](../../commands/handgunItems.md): Returns array with all items assigned to the handgunWeapon except magazines. Use handgunMagazine command for the latter. This command is used for infantry weapons only.
- [handgunMagazine](../../commands/handgunMagazine.md): Collects all loaded magazines from all handgunWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry weapons only.
- [handgunWeapon](../../commands/handgunWeapon.md): Returns the name of a unit's handgun (an empty string if there is none).
- [hasWeapon](../../commands/hasWeapon.md): Checks if a unit has the given weapon in hands or on back/in holster. Weapons inside unit containers such as vest and backpack are not counted.
- [headgear](../../commands/headgear.md): Returns headgear of unit.
- [hmd](../../commands/hmd.md): Returns class name of currently used Head Mounted Display. Returns an empty string if the slot is empty.
- [isSwitchingWeapon](../../commands/isSwitchingWeapon.md): Returns wether or not the unit is in the process of switching weapon.
- [isThrowable](../../commands/isThrowable.md): Returns true if the given magazine is a throwable.
- [isUniformAllowed](../../commands/isUniformAllowed.md): Check whether given uniform can be dressed by target soldier.
- [items](../../commands/items.md): Returns an array of names of all unit's stored items, including weapons but excluding magazines (see itemsWithMagazines) and assignedItems.
- [itemsWithMagazines](../../commands/itemsWithMagazines.md): Returns combined array including all unit's stored items and all unit's stored magazines and all unit's stored weapons.
- [linkItem](../../commands/linkItem.md): Create and assign item to the correct slot. If there is an item in the targeted slot, it gets replaced. See also assignItem.
- [load](../../commands/load.md): Returns the percentage of fullness of a unit's cargo. Output is usually in range 0..1, but can be higher after using certain scripting commands (like addWeaponWithAttachmentsCargoGlobal) which ignore load values when…
- [loadAbs](../../commands/loadAbs.md): Returns current sum of mass from items stored in all unit's containers, linked items and weapons.
- [loadUniform](../../commands/loadUniform.md): Returns current percentage of mass from items stored in a uniform relative to the maximum capacity of the uniform.
- [loadVest](../../commands/loadVest.md): Returns current percentage of mass from items stored in a vest relative to the maximum capacity of the vest.
- [lockedInventory](../../commands/lockedInventory.md): Get a vehicle's inventory lock state. Can also be used on a unit's backback (see lockInventory).
- [lockInventory](../../commands/lockInventory.md): Lock or unlock a vehicle's inventory access. This command can also lock backpack a unit is wearing to prevent access by a third party. If set to true (locked), the inventory cannot be accessed via hotkey or action menu.
- [magazines](../../commands/magazines.md): Returns array of type names of all vehicle's magazines. When applied to a unit, the command behaves differently and will omit magazines already loaded into unit's weapons.
- [magazinesAmmo](../../commands/magazinesAmmo.md): Returns all vehicle's magazines and their ammo count (also works on supply boxes). When applied to a unit (soldier), the command behaves differently and will omit magazines already loaded into unit's weapons.
- [magazinesAmmoFull](../../commands/magazinesAmmoFull.md): Returns array of arrays of all unit's or vehicle's magazines with extended information about them. The magazines returned are for primary gunner. If you need magazines for all turrets, see magazinesAllTurrets.
- [magazinesDetail](../../commands/magazinesDetail.md): Returns an array of strings with description of all vehicle's magazines, their ammo count (current/default) and their ids for the primary gunner.
- [magazinesDetailBackpack](../../commands/magazinesDetailBackpack.md): Returns an array with the type names of all the unit's backpack magazines.
- [magazinesDetailUniform](../../commands/magazinesDetailUniform.md): Returns an array with the type names of all the unit's uniform magazines.
- [magazinesDetailVest](../../commands/magazinesDetailVest.md): Returns an array with the type names of all the unit's vest magazines.
- [maxLoad](../../commands/maxLoad.md): Returns maximum load limit for a unit, uniform/vest/backpack containers, vehicle cargo, supply boxes and weapon holders.
- [primaryWeapon](../../commands/primaryWeapon.md): Returns name of unit's primary weapon. This command will also return a weapon class name if the weapon is not used by the player, for example, it is on the unit's back.
- [primaryWeaponItems](../../commands/primaryWeaponItems.md): Returns array with all items assigned to the primaryWeapon except magazines. Use primaryWeaponMagazine command for the latter. This command is used for infantry weapons only.
- [primaryWeaponMagazine](../../commands/primaryWeaponMagazine.md): Collects all loaded magazines from all primaryWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry weapons only.
- [removeAllAssignedItems](../../commands/removeAllAssignedItems.md): Unassigns and deletes all linked items from inventory. The commands operates on assignedItems array, which does not include goggles or headgear but includes binoculars, which is a weapon.
- [removeAllBinocularItems](../../commands/removeAllBinocularItems.md): Removes all items from binocular weapon, except magazine.
- [removeAllContainers](../../commands/removeAllContainers.md): Removes all containers (vest, uniform, backpack) from the provided unit.
- [removeAllHandgunItems](../../commands/removeAllHandgunItems.md): Removes all items from handgunWeapon, except magazine.
- [removeAllItems](../../commands/removeAllItems.md): Removes all special items from the unit.
- [removeAllItemsWithMagazines](../../commands/removeAllItemsWithMagazines.md): Removes all itemsWithMagazines from the uniform, vest and backpack. Command essentially clears all unit's containers.
- [removeAllMagazines](../../commands/removeAllMagazines.md): Removes all magazines from the unit.
- [removeAllPrimaryWeaponItems](../../commands/removeAllPrimaryWeaponItems.md): Removes all items from primaryWeapon, except magazine.
- [removeAllSecondaryWeaponItems](../../commands/removeAllSecondaryWeaponItems.md): Removes all items from secondaryWeapon, except magazine.
- [removeAllWeapons](../../commands/removeAllWeapons.md): Removes all weapons and magazines from the given unit. Does not remove items like map, compass, radio (see removeWeapon for this).
- [removeBackpackGlobal](../../commands/removeBackpackGlobal.md): Removes backpack from a unit. (even non-local)
- [removeBinocularItem](../../commands/removeBinocularItem.md): Removes given weapon item, including magazine, from the binocular weapon.
- [removeGoggles](../../commands/removeGoggles.md): Removes goggles from unit (diver goggles for example). This command does not remove NVGoggles. Use unassignItem and removeItem or just unlinkItem for latter.
- [removeHandgunItem](../../commands/removeHandgunItem.md): Removes given weapon item, including magazine, from the handgunWeapon
- [removeHeadgear](../../commands/removeHeadgear.md): Removes headgear from a unit. If unit has no headgear command quietly fails.
- [removeItem](../../commands/removeItem.md): Removes item from the inventory. The removal order by containers is uniform → vest → backpack.
- [removeItems](../../commands/removeItems.md): Removes all items with given class name from the inventory.
- [removeMagazine](../../commands/removeMagazine.md): Remove magazine from the unit or static weapon.
- [removeMagazineGlobal](../../commands/removeMagazineGlobal.md): Removes the magazine from the unit.
- [removeMagazines](../../commands/removeMagazines.md): Removes all magazines of given type from the unit. If magazine class does not exist, nothing happens, not even .rpt message, unlike with addMagazine command.
- [removePrimaryWeaponItem](../../commands/removePrimaryWeaponItem.md): Removes given weapon item, including magazine, from the primaryWeapon.
- [removeSecondaryWeaponItem](../../commands/removeSecondaryWeaponItem.md): Removes given weapon item, including magazine, from the secondaryWeapon.
- [removeUniform](../../commands/removeUniform.md): Removes uniform from unit.
- [removeVest](../../commands/removeVest.md): Removes vest from unit.
- [removeWeapon](../../commands/removeWeapon.md): Remove weapon from a unit. The unit must be local to the computer where command is executed. For a global version of this command, see removeWeaponGlobal.
- [removeWeaponGlobal](../../commands/removeWeaponGlobal.md): Remove a weapon from a unit. An attempt to remove a weapon, which is not in unit's possession, is simply ignored.
- [removeWeaponItem](../../commands/removeWeaponItem.md): Removes magazine from the specified muzzle. It is possible to remove magazine directly from 'Throw' muzzle provided it is configured with `keepInInventory = 0;`.
- [secondaryWeapon](../../commands/secondaryWeapon.md): Returns the name of a unit's secondary weapon (launcher). To detect the weapon which is currently being used by the unit use currentWeapon.
- [secondaryWeaponItems](../../commands/secondaryWeaponItems.md): Returns array with all items assigned to the secondaryWeapon except magazines. Use secondaryWeaponMagazine command for the latter. This command is used for infantry weapons only.
- [secondaryWeaponMagazine](../../commands/secondaryWeaponMagazine.md): Collects all loaded magazines from all secondaryWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry weapons only.
- [selectThrowable](../../commands/selectThrowable.md): Selects current throwable, which will be launched if the user presses <kbd>G</kbd>.
- [setAmmo](../../commands/setAmmo.md): Sets custom ammo count in the currently loaded magazine of the specified weapon or muzzle.
- [setMaxLoad](../../commands/setMaxLoad.md): Sets maximum load limit for a uniform/vest/backpack containers, vehicle cargo, supply boxes and weapon holders. In MP this command should be executed on the server and will persist on given container for JIP.
- [setUnitLoadout](../../commands/setUnitLoadout.md): Creates a loadout from given inventory structure and applies it to a unit. When String for class name is supplied, the command will search `CfgVehicles` for the given class in order to extract the loadout from config.
- [setVehicleAmmoDef](../../commands/setVehicleAmmoDef.md): Sets how much ammunition (compared to the configuration of magazines defined in the vehicle's class) the vehicle has. Note that the ammo will only be added to local turrets.
- [soldierMagazines](../../commands/soldierMagazines.md): Get array with all magazines of the given unit.
- [someAmmo](../../commands/someAmmo.md): Check if unit has some ammo.
- [throwables](../../commands/throwables.md): Returns all throwables in unit inventory in currentThrowable format.
- [unassignItem](../../commands/unassignItem.md): Unassigns existing item and tries to put it into inventory. If there is no space in inventory the item simply disappears. See also unlinkItem.
- [uniform](../../commands/uniform.md): Returns name of uniform.
- [uniformContainer](../../commands/uniformContainer.md): Returns a cargo container of a unit's uniform.
- [uniformItems](../../commands/uniformItems.md): Get array with all items (of any kind, even weapons) from uniform.
- [uniformMagazines](../../commands/uniformMagazines.md): Get array with all magazines from uniform of the given unit.
- [uniqueUnitItems](../../commands/uniqueUnitItems.md): Returns hashmap of all items in units inventory as [classname, count] pairs.
- [unlinkItem](../../commands/unlinkItem.md): Unassign and delete existing item from its assigned slot. Nothing happens if the item does not exist or is not assigned. See also unassignItem.
- [vest](../../commands/vest.md): nameof vest.
- [vestContainer](../../commands/vestContainer.md): Returns a cargo container of a unit's vest.
- [vestItems](../../commands/vestItems.md): Get array with all items (of any kind, even weapons) from vest.
- [vestMagazines](../../commands/vestMagazines.md): Get array with all magazines from vest of the given unit.
- [weaponAccessories](../../commands/weaponAccessories.md): Get array with all items linked to a given weapon.
- [weaponAccessoriesCargo](../../commands/weaponAccessoriesCargo.md): Returns array with all items assigned to the given weapon in given cargo container.
- [weaponCargo](../../commands/weaponCargo.md): Get array with weapons from ammo box (or any general weapon holder container).
- [weapons](../../commands/weapons.md): Returns array of names of all unit's weapons.
- [weaponsItems](../../commands/weaponsItems.md): Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons.
