hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|=GROUP1" to "|GROUP1=")
(Page filling)
Line 10: Line 10:


| Add group to unit's [[High Command|high command]] bar.
| Add group to unit's [[High Command|high command]] bar.
<br>
 
Array parameters are group, group-name and team (teammain, teamred, teamgreen, teamblue, teamyellow).
{{Informative|The previous HC leader should be [[hcRemoveGroup|removed]] before adding the new one (see '''[[#Examples|Example 3]]''').}} |DESCRIPTION=
<br>
Group is the only necessary parameter. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| unit '''hcSetGroup''' array |SYNTAX=
| unit '''hcSetGroup''' [group, groupName, team] |SYNTAX=
 
|p1= unit: [[Object]] - the leader |PARAMETER1=


|p1= unit: [[Object]] |PARAMETER1=  
|p2= group: [[Group]] |PARAMETER2=


|p2= array: [[Array]] |PARAMETER2=  
|p3= groupName: [[String]] |PARAMETER3=  


|p3= |PARAMETER3=  
|p4= team: [[String]] - can be one of:
* "teamMain"
* "teamRed"
* "teamGreen"
* "teamBlue"
* "teamYellow" |PARAMETER4=


| Nothing |RETURNVALUE=  
| [[Nothing]] |RETURNVALUE=  


|x1= <code>unit [[hcSetGroup]] [group, "HQ", teamred];</code>|EXAMPLE1=


|x1= <code>unit [[hcSetGroup]] [group, "HQ", teamred];</code>|EXAMPLE1=  
|x2= <code>[[player]] [[hcSetGroup]] [group];</code>|EXAMPLE2=


|x2= <code>player [[hcSetGroup]] [group];</code>|EXAMPLE2=  
|x3= <code>[[if]] ([[player]] !{{=}} [[hcLeader]] _group) [[then]]
{
[[hcLeader]] _group [[hcRemoveGroup]] _group;
[[player]] [[hcSetGroup]] [_group];
};</code> | EXAMPLE3=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 17:39, 17 November 2020

Hover & click on the images for description

Description

Description:
Add group to unit's high command bar.
The previous HC leader should be removed before adding the new one (see Example 3).
Groups:
High Command

Syntax

Syntax:
unit hcSetGroup [group, groupName, team]
Parameters:
unit: Object - the leader
group: Group
groupName: String
team: String - can be one of:
  • "teamMain"
  • "teamRed"
  • "teamGreen"
  • "teamBlue"
  • "teamYellow"
Return Value:
Nothing

Examples

Example 1:
unit hcSetGroup [group, "HQ", teamred];
Example 2:
player hcSetGroup [group];
Example 3:
if (player != hcLeader _group) then { hcLeader _group hcRemoveGroup _group; player hcSetGroup [_group]; };

Additional Information

See also:
High CommandhcAllGroupshcGroupParamshcLeaderhcRemoveAllGroupshcRemoveGrouphcSelectedhcSelectGrouphcShowBarhcShownBaronHCGroupSelectionChanged

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

Notes

Bottom Section