getUnitLoadout: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Remove syntaxhighlight spoiler hack)
 
Line 28: Line 28:
</syntaxhighlight>
</syntaxhighlight>
</spoiler>
</spoiler>
<syntaxhighlight lang="cpp"></syntaxhighlight><!-- for the spoiler to not eat the syntax highlight... -->
}}
}}



Latest revision as of 13:44, 23 June 2023

Hover & click on the images for description

Description

Description:
Returns a Unit Loadout Array with all assigned items, weapons, containers and their stored items.
The config should contain the following standard entries:
Groups:
Unit Inventory

Syntax 1

Syntax:
getUnitLoadout unit
Parameters:
unit: Object
Return Value:
Array format Unit Loadout Array

Syntax 2

Syntax:
getUnitLoadout [unit, fullMagazines]
Parameters:
unit: Object
fullMagazines: Boolean - true to top up used magazines
Return Value:
Array format Unit Loadout Array

Syntax 3

Syntax:
getUnitLoadout name
Parameters:
name: String - CfgVehicles classname from which to extract the loadout
Return Value:
Array format Unit Loadout Array

Syntax 4

Syntax:
getUnitLoadout config
Parameters:
config: Config - loadout config class
Return Value:
Array format Unit Loadout Array

Examples

Example 1:
Copy
getUnitLoadout player;
Example 2:
Copy
getUnitLoadout [player, true];
Example 3:
Copy
getUnitLoadout "B_Soldier_F";
Example 4:
Copy
getUnitLoadout (configFile >> "CfgVehicles" >> "B_Soldier_F");
Example 5:
Copy
getUnitLoadout (missionConfigFile >> "MyLoadout");

Additional Information

See also:
setUnitLoadout

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