addItemCargo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
|gr1= Vehicle Inventory | |gr1= Vehicle Inventory | ||
|descr= Creates new items and stores them in given container. Works with [[ | |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= | |p2= item: [[String]] | ||
|p3= | |p3= count: [[Number]] - number of items to add; {{GVI|arma3|2.14|size= 0.75}} a negative value removes items | ||
| | |||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf>supplyBox addItemCargo ["optic_ARCO", 10];</sqf> | ||
|seealso= [[addItemCargoGlobal]] [[clearItemCargo]] [[addMagazineCargo]] | |seealso= [[addItemCargoGlobal]] [[clearItemCargo]] [[addMagazineCargo]] [[addMagazineCargoGlobal]] [[addWeaponCargo]] [[addWeaponCargoGlobal]] [[addBackpackCargo]] [[addBackpackCargoGlobal]] | ||
}} | }} | ||
Line 32: | Line 32: | ||
|user= 7erra | |user= 7erra | ||
|timestamp= 20211120122755 | |timestamp= 20211120122755 | ||
|text= 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 | |text= 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 <sqf inline>configFile >> "CfgVehicles" >> _containerClass >> "TransportItems" >> "some_classname" >> "name"</sqf>. | |||
}} | }} |
Latest revision as of 13:43, 25 May 2023
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 - number of items to add; 2.14 a negative value removes items
- 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
- 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".