itemsWithMagazines: Difference between revisions
m (Replaced <code> with <sqf>) |
BrettMayson (talk | contribs) mNo edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 12: | Line 12: | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
|r1= [[Array]] | |r1= [[Array]] of [[String]]s | ||
|x1= <sqf>private _res1 = itemsWithMagazines player; | |x1= <sqf> | ||
private _res1 = itemsWithMagazines player; | |||
// ... is essentially the same as ... | // ... is essentially the same as ... | ||
private _res2 = items player + magazines player;</sqf> | private _res2 = items player + magazines player; | ||
</sqf> | |||
Example result: | Example result: | ||
<sqf>[ | <sqf> | ||
[ | |||
"FirstAidKit", //item | "FirstAidKit", //item | ||
"30Rnd_65x39_caseless_mag", //magazine | "30Rnd_65x39_caseless_mag", //magazine | ||
| Line 26: | Line 29: | ||
"ToolKit", //item | "ToolKit", //item | ||
"MineDetector" //item | "MineDetector" //item | ||
]</sqf> | ] | ||
</sqf> | |||
|seealso= [[items]] [[removeAllItemsWithMagazines]] | |seealso= [[items]] [[removeAllItemsWithMagazines]] [[backpacks]] | ||
}} | }} | ||
Latest revision as of 11:35, 1 January 2026
Description
- Description:
- Returns combined array including all unit's stored items and all unit's stored magazines and all unit's stored weapons. Loaded magazines such as currentMagazine, primaryWeaponMagazine, secondaryWeaponMagazine, handgunMagazine, binocularMagazine as well as assignedItems are excluded.
- Groups:
- Unit Inventory
Syntax
- Syntax:
- itemsWithMagazines unit
- Parameters:
- unit: Object
- Return Value:
- Array of Strings
Examples
- Example 1:
- Example result:[ "FirstAidKit", //item "30Rnd_65x39_caseless_mag", //magazine "16Rnd_9x21_Mag", //magazine "Chemlight_green", //magazine "HandGrenade", //magazine "ToolKit", //item "MineDetector" //item ]
Additional Information
- See also:
- items removeAllItemsWithMagazines backpacks
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note