addItemCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 98337 by killzone_kid on 2016-12-28T14:05:59Z)
m (Some wiki formatting)
 
(41 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|arg= local |= Arguments in MP
|arg= local


|eff= local |= Effects in MP
|eff= local


|0.50|= Game version
|gr1= Vehicle Inventory
____________________________________________________________________________________________


| Creates new items and stores them in given container. Works with items, weapons and magazines. For global variant see [[addItemCargoGlobal]] |= Description
|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]].


| box '''addItemCargo''' [item, count] |= Syntax
|s1= box [[addItemCargo]] [item, count]


|p1= box: [[Object]] |= PARAMETER1
|p1= box: [[Object]]


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


|p3= item: [[String]] |= PARAMETER3
|p3= count: [[Number]] - number of items to add; {{GVI|arma3|2.14|size= 0.75}} a negative value removes items


|p4= count: [[Number]] |= PARAMETER4
|r1= [[Nothing]]


| [[Nothing]] |= RETURNVALUE
|x1= <sqf>supplyBox addItemCargo ["optic_ARCO", 10];</sqf>


|seealso= [[addItemCargoGlobal]] [[clearItemCargo]] [[addMagazineCargo]] [[addMagazineCargoGlobal]] [[addWeaponCargo]] [[addWeaponCargoGlobal]] [[addBackpackCargo]] [[addBackpackCargoGlobal]]
}}


|x1= <code>supplyBox [[addItemCargo]] ["optic_ARCO", 10];</code> |= EXAMPLE1
{{Note
 
|user= 7erra
____________________________________________________________________________________________
|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.
| [[addItemCargoGlobal]], [[clearItemCargo]], [[addMagazineCargo]], [[addMagazineCargoGlobal]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[addBackpackCargo]], [[addBackpackCargoGlobal]] |= SEEALSO
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>.
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 14:43, 25 May 2023

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 - number of items to add; Arma 3 logo black.png2.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
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".