hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(populated)
mNo edit summary
 
(69 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Add group to unit's high command bar. Array parameters are group,group,name and team (teammain,teamred,teamgreen,teamblue,teamyellow) .,Group is the only necessary parameter. Example:unit hcSetGroup [group,HQ,teamred],or,player hcSetGroup [group] |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| unit '''hcSetGroup''' array |= Syntax
|game4= arma3
|version4= 0.50


|p1= unit: [[Object]] -  |= PARAMETER1
|gr1= High Command


|p2= array: [[Array]] -  |= PARAMETER2
|descr= Add group to unit's [[High Command|high command]] bar.


|p3= |= PARAMETER3
{{Feature|informative|The previous HC leader should be [[hcRemoveGroup|removed]] before adding the new one (see '''{{Link|#Example 3}}''').}}


| Nothing |= RETURNVALUE
|s1= unit [[hcSetGroup]] [group, groupName, team]


|p1= unit: [[Object]] - the leader


|x1= <code>(example)</code>|= EXAMPLE1
|p2= group: [[Group]]


____________________________________________________________________________________________
|p3= groupName: [[String]] - (Optional)


| |= SEEALSO
|p4= team: [[String]] Enum - (Optional, default "teamMain") can be one of:
* "teamMain"
* "teamRed"
* "teamGreen"
* "teamBlue"
* "teamYellow"


| |= MPBEHAVIOUR
|r1= [[Nothing]]
____________________________________________________________________________________________
 
}}
|x1= <sqf>unit hcSetGroup [group, "HQ", "teamred"];</sqf>


<h3 style='display:none'>Notes</h3>
|x2= <sqf>player hcSetGroup [group];</sqf>
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x3= <sqf>
</dl>
if (player != hcLeader _group) then
{
hcLeader _group hcRemoveGroup _group;
player hcSetGroup [_group];
};
</sqf>


<h3 style='display:none'>Bottom Section</h3>
|seealso= [[High Command]] [[hcAllGroups]] [[hcGroupParams]] [[hcLeader]] [[hcRemoveAllGroups]] [[hcRemoveGroup]] [[hcSelected]] [[hcSelectGroup]] [[hcShowBar]] [[hcShownBar]] [[onHCGroupSelectionChanged]]
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]

Latest revision as of 21:54, 26 September 2024

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 - (Optional)
team: String Enum - (Optional, default "teamMain") 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 Command hcAllGroups hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcShowBar hcShownBar onHCGroupSelectionChanged

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