getItemCargo: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *F([a-z ])" to "$1 - f$2")
mNo edit summary
 
Line 14: Line 14:
|p1= box: [[Object]]
|p1= box: [[Object]]


|r1= [[Array]] of Arrays - format: [["5ItemsType1","10ItemsType2"],[5,10]]
|r1= [[Array]] with [classes, counts]
* classes: [[Array]] of [[String]]s - Item class names
* counts: [[Array]] of [[Number]]s - Item counts


|x1= <sqf>hint str getItemCargo cursorTarget;</sqf>
|x1= <sqf>
getItemCargo cursorTarget;
/*
returns e.g
[
        ["5ItemA", "10ItemB"]
        [5, 10]
]
*/
</sqf>


|seealso= [[itemCargo]] [[addItemCargo]] [[addItemCargoGlobal]] [[clearItemCargo]] [[clearItemCargoGlobal]]
|seealso= [[itemCargo]] [[addItemCargo]] [[addItemCargoGlobal]] [[clearItemCargo]] [[clearItemCargoGlobal]]
}}
}}

Latest revision as of 18:23, 2 April 2026

Hover & click on the images for description

Description

Description:
Returns all items names and count from ammo box (or any general weapon holder container).
Groups:
Vehicle Inventory

Syntax

Syntax:
getItemCargo box
Parameters:
box: Object
Return Value:
Array with [classes, counts]

Examples

Example 1:
getItemCargo cursorTarget; /* returns e.g [ ["5ItemA", "10ItemB"] [5, 10] ] */

Additional Information

See also:
itemCargo addItemCargo addItemCargoGlobal clearItemCargo clearItemCargoGlobal

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note