addItemCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Some wiki formatting)
Line 10: Line 10:
|gr1= Vehicle Inventory
|gr1= Vehicle Inventory


|descr= Creates new items and stores them in given container. Works with [[Arma_3:_CfgWeapons_Items|items]], [[Arma_3:_CfgWeapons_Weapons|weapons]], [[Arma_3:_CfgMagazines|magazines]], [[Arma_3:_CfgWeapons_Equipment|equipment]] and [[Arma_3:_Characters_And_Gear_Encoding_Guide#Facewear_configuration|glasses]] but not backpacks. In the latter case use [[addBackpackCargo]] instead. For global variant see [[addItemCargoGlobal]]
|descr= Creates new items and stores them in given container.
Works with [[Arma_3:_CfgWeapons_Items|items]], [[Arma_3:_CfgWeapons_Weapons|weapons]], [[Arma_3:_CfgMagazines|magazines]], [[Arma_3:_CfgWeapons_Equipment|equipment]] and [[Arma_3:_Characters_And_Gear_Encoding_Guide#Facewear_configuration|glasses]] but not backpacks.
In the latter case use [[addBackpackCargo]] instead. For the global variant, see [[addItemCargoGlobal]].


|s1= box [[addItemCargo]] [item, count]
|s1= box [[addItemCargo]] [item, count]
Line 16: Line 18:
|p1= box: [[Object]]
|p1= box: [[Object]]


|p2= [item, count]: [[Array]]
|p2= item: [[String]]


|p3= item: [[String]]
|p3= count: [[Number]]
 
|p4= count: [[Number]]


|r1= [[Nothing]]
|r1= [[Nothing]]

Revision as of 23:49, 7 August 2022

Hover & click on the images for description

Description

Description:
Creates new items and stores them in given container. Works with items, weapons, magazines, equipment and glasses but not backpacks. In the latter case use addBackpackCargo instead. For the global variant, see addItemCargoGlobal.
Groups:
Vehicle Inventory

Syntax

Syntax:
box addItemCargo [item, count]
Parameters:
box: Object
item: String
count: Number
Return Value:
Nothing

Examples

Example 1:
supplyBox addItemCargo ["optic_ARCO", 10];

Additional Information

See also:
addItemCargoGlobal clearItemCargo addMagazineCargo addMagazineCargoGlobal addWeaponCargo addWeaponCargoGlobal addBackpackCargo addBackpackCargoGlobal

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
7erra - c
Posted on Nov 20, 2021 - 12:27 (UTC)
Make sure that you are using the classname from CfgWeapons, CfgMagazines or CfgGlasses! Placing an item in Eden Editor places the container of the item, not the item itself. To get the item classname you can open the config of the placed container in the Config Viewer and look for a subclass called "TransportItems". The correct classname is stored under configFile >> "CfgVehicles" >> _containerClass >> "TransportItems" >> "some_classname" >> "name".