---
name: "units"
type: command
status: ok
groups: ["Groups", "Object Detection"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/units
revid: 340313
updated: 2023-04-29T17:06:31Z
---

# units

*Command · Groups, Object Detection · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

## Description

Returns an array with all the units in the group or unit's group, or all units belonging to a certain side.

## Syntax

```sqf
units type
```

**Parameters:**

- `type`: [Group](../topics/Group.md), [Object](../topics/Object.md) or Arma 3 v2.02 [Side](../topics/Side.md)

**Returns:** [Array](../topics/Array.md) of [Object](../topics/Object.md)s - if *type* is a destroyed object, an empty array is returned

## Examples

### Example 1

```sqf
_myUnitCount = count units player;
```

### Example 2

```sqf
_isInMyGroup = _soldier1 in units player;
```

### Example 3

```sqf
private _unitsEast = units opfor;
```

### Example 4

```sqf
// both methods are the same, the latter is preferred for performance reason
units group player;        // [B Alpha 1-1:1 (R3vo), B Alpha 1-1:2, B Alpha 1-1:3, B Alpha 1-1:4, B Alpha 1-1:5, B Alpha 1-1:6, B Alpha 1-1:7, B Alpha 1-1:8]
units player;            // [B Alpha 1-1:1 (R3vo), B Alpha 1-1:2, B Alpha 1-1:3, B Alpha 1-1:4, B Alpha 1-1:5, B Alpha 1-1:6, B Alpha 1-1:7, B Alpha 1-1:8]
```

## See also

[group](../commands/group.md) · [allGroups](../commands/allGroups.md) · [groups](../commands/groups.md) · [allUnits](../commands/allUnits.md) · [playableUnits](../commands/playableUnits.md) · [switchableUnits](../commands/switchableUnits.md) · [vehicles](../commands/vehicles.md)

## Community notes

**Kronzky** — 2009-09-25

The returned array on MP clients is not updated when team members die (only when they are deleted). (*Tested on VBS2*)

---

**Ilias38rus** — 2020-07-03

Seems to always return a list with the same order as the leader's squad menu.

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