---
name: "captiveNum"
type: command
status: ok
groups: ["Object Manipulation", "Sides"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/captiveNum
revid: 369311
updated: 2024-09-03T18:42:55Z
---

# captiveNum

*Command · Object Manipulation, Sides · Arma 3 v0.50 · introduced in Arma 2 v1.00*

Locality: arguments **global**

## Description

Checks whether the unit is a [captive](../commands/captive.md). If the unit is a vehicle, its commander is checked instead.

If a unit's captivity level was set as a [Boolean](../topics/Boolean.md), then the returned number is either 0 (for [false](../commands/false.md)) or 1 (for [true](../commands/true.md)).

## Syntax

```sqf
captiveNum unit
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)

**Returns:** [Number](../topics/Number.md) - anything from 0 to value set by [setCaptive](../commands/setCaptive.md) alt syntax. A non zero value means [captive](../commands/captive.md).

## Examples

### Example 1

```sqf
_captivity = captiveNum _unit;
```

### Example 2

```sqf
_unit setCaptive 1024;
hint str captive _unit; // true
hint str captiveNum _unit; // 1024
```

## See also

[captive](../commands/captive.md) · [setCaptive](../commands/setCaptive.md)

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