---
name: "countFriendly"
type: command
status: ok
groups: ["Sides"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/countFriendly
revid: 379406
updated: 2026-10-31T00:02:17Z
---

# countFriendly

*Command · Sides · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Locality: arguments **global**

## Description

Count how many units in the array are considered friendly to the given unit.

## Syntax

```sqf
unit countFriendly others
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `others`: [Array](../topics/Array.md) of [Objects](../topics/Object.md)

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

## Examples

### Example 1

```sqf
_num = player countFriendly list _triggerOne;
```

## See also

[count](../commands/count.md) · [countEnemy](../commands/countEnemy.md) · [countUnknown](../commands/countUnknown.md) · [countSide](../commands/countSide.md) · [countType](../commands/countType.md)

## Community notes

**Hardrock** — 2006-08-03

*Notes from before the conversion:*

The countFriendly command seem to count the number of units from the array that are considered to be of the given type by the whole side, not just the specified unit.

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