getUnitLoadout: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
Lou Montana (talk | contribs) m (Remove syntaxhighlight spoiler hack) |
||
(24 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 1.58 | |version1= 1.58 | ||
|gr1= Unit Inventory | |gr1= Unit Inventory | ||
|descr= Returns a '''[[Unit Loadout Array]]''' with all assigned items, weapons, containers and their stored items. | |descr= Returns a '''[[Unit Loadout Array]]''' with all assigned items, weapons, containers and their stored items. | ||
{{Feature|informative| | |||
The config should contain the following standard entries: <spoiler> | |||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
class MyLoadout | class MyLoadout | ||
Line 23: | Line 25: | ||
"HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade" | "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade", "HandGrenade" | ||
}; | }; | ||
};</syntaxhighlight> | }; | ||
</syntaxhighlight> | |||
</spoiler> | |||
}} | |||
|s1= [[getUnitLoadout]] unit | |s1= [[getUnitLoadout]] unit | ||
Line 32: | Line 34: | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
|r1= [[Array]] | |r1= [[Array]] format [[Unit Loadout Array]] | ||
|s2= [[getUnitLoadout]] [unit, fullMagazines] | |||
| | |p21= unit: [[Object]] | ||
| | |p22= fullMagazines: [[Boolean]] - [[true]] to top up used magazines | ||
| | |r2= [[Array]] format [[Unit Loadout Array]] | ||
| | |s3= [[getUnitLoadout]] name | ||
| | |p41= name: [[String]] - {{hl|CfgVehicles}} classname from which to extract the loadout | ||
|r3= [[Array]] format [[Unit Loadout Array]] | |||
| | |s4= [[getUnitLoadout]] config | ||
| | |p61= config: [[Config]] - loadout config class | ||
| | |r4= [[Array]] format [[Unit Loadout Array]] | ||
|x1= <sqf>getUnitLoadout player;</sqf> | |||
| | |x2= <sqf>getUnitLoadout [player, true];</sqf> | ||
| | |x3= <sqf>getUnitLoadout "B_Soldier_F";</sqf> | ||
| | |x4= <sqf>getUnitLoadout (configFile >> "CfgVehicles" >> "B_Soldier_F");</sqf> | ||
|x5= <sqf>getUnitLoadout (missionConfigFile >> "MyLoadout");</sqf> | |||
|x5= < | |||
|seealso= [[setUnitLoadout]] | |seealso= [[setUnitLoadout]] | ||
}} | }} | ||
Latest revision as of 13:44, 23 June 2023
Description
- Description:
- Returns a Unit Loadout Array with all assigned items, weapons, containers and their stored items.
- 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
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