---
name: "hcSetGroup"
type: command
status: ok
groups: ["High Command"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/hcSetGroup
revid: 376359
updated: 2025-10-07T21:40:53Z
---

# hcSetGroup

*Command · High Command · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Add group to unit's high command bar.

> [!NOTE]
> The previous HC leader should be [removed](../commands/hcRemoveGroup.md) before adding the new one (see **[#Example 3](../commands/hcSetGroup.md#example-3)**).

## Syntax

```sqf
unit hcSetGroup [group, groupName, team]
```

**Parameters:**

- `unit`: [Object](../topics/Object.md) - the leader
- `group`: [Group](../topics/Group.md)
- `groupName`: [String](../topics/String.md) - (Optional)
- `team`: [String](../topics/String.md) - (Optional, default "teamMain") can be one of:
  - "teamMain"
  - "teamRed"
  - "teamGreen"
  - "teamBlue"
  - "teamYellow"

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
unit hcSetGroup [_group, "HQ", "teamred"];
```

### Example 2

```sqf
player hcSetGroup [_group];
```

### Example 3

```sqf
if (player != hcLeader _group) then
{
    hcLeader _group hcRemoveGroup _group;
    player hcSetGroup [_group];
};
```

## See also

High Command · [hcAllGroups](../commands/hcAllGroups.md) · [hcGroupParams](../commands/hcGroupParams.md) · [hcLeader](../commands/hcLeader.md) · [hcRemoveAllGroups](../commands/hcRemoveAllGroups.md) · [hcRemoveGroup](../commands/hcRemoveGroup.md) · [hcSelected](../commands/hcSelected.md) · [hcSelectGroup](../commands/hcSelectGroup.md) · [hcShowBar](../commands/hcShowBar.md) · [hcShownBar](../commands/hcShownBar.md) · [onHCGroupSelectionChanged](../commands/onHCGroupSelectionChanged.md)

<sub>Source: [BI Community Wiki — hcSetGroup](https://community.bistudio.com/wiki/hcSetGroup) (revision 376359).</sub>
