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

# countType

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

Locality: arguments **global**

## Description

Count how many objects in the array are of given type. This command also works with parent classes like "Air", "Tank", and "Car". For a full class reference see Classes.

## Syntax

```sqf
type countType objects
```

**Parameters:**

- `type`: [String](../topics/String.md) - class type
- `objects`: [Array](../topics/Array.md) of [Objects](../topics/Object.md)

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

## Examples

### Example 1

```sqf
_count = "Tank" countType list _triggerOne;
```

### Example 2

```sqf
_count = "B_medic_F" countType units player;
```

## See also

[count](../commands/count.md) · [isKindOf](../commands/isKindOf.md) · [typeOf](../commands/typeOf.md) · [countFriendly](../commands/countFriendly.md) · [countEnemy](../commands/countEnemy.md) · [countSide](../commands/countSide.md) · [countUnknown](../commands/countUnknown.md)

## Community notes

**Kronzky** — 2007-04-23

This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc.)

---

**Killzone_Kid** — 2016-05-04

To complement Kronzky's note, if one needs to count exact types, [countType](../commands/countType.md) is not suitable for this, use [count](../commands/count.md) instead:

```sqf
_count = {typeOf _x == "B_medic_F"} count units player;
```

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