---
name: "isPlayer"
type: command
status: ok
groups: ["Multiplayer"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/isPlayer
revid: 363376
updated: 2024-03-29T08:30:20Z
---

# isPlayer

*Command · Multiplayer · Arma 3 v0.50 · introduced in Armed Assault v1.00*

Locality: arguments **global**

## Description

Checks if given person is a [player](../commands/player.md). Returns [true](../commands/true.md) for headless clients as well.

> [!NOTE]
> Prior to Arma 3 v2.02, in some cases the identity of certain player units could fail to propagate to other clients and the server, which caused [isPlayer](../commands/isPlayer.md) and [getPlayerUID](../commands/getPlayerUID.md) to incorrectly return `false` and `""` respectively, where the affected units were [not](../commands/not.md) [local](../commands/local.md). See [this GitHub bug report](https://github.com/michail-nikolaev/task-force-arma-3-radio/issues/1096) for more info. Remain vigilant toward potential false negatives.

> [!IMPORTANT]
> When used on vehicles, this command will return [true](../commands/true.md) if [effectiveCommander](../commands/effectiveCommander.md) of the vehicle is player. Just because it returns [true](../commands/true.md) does not automatically mean we have a [player](../commands/player.md) unit. Unlike main syntax, alternative syntax always returns [false](../commands/false.md) when used on vehicles, even if they're controlled by a player.

## Syntax

### Syntax 1

```sqf
isPlayer unit
```

**Parameters:**

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

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

### Syntax 2

*since arma3 2.06*

```sqf
isPlayer [person]
```

**Parameters:**

- `person`: [Object](../topics/Object.md) - dead or alive unit

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) if is/was player **and** the identity still exists on the (dead) body

## Examples

### Example 1

```sqf
if (isPlayer _Soldier1) then
{
    _soldier1 setDamage 1;
};
```

### Example 2

```sqf
_playerCount = { isPlayer _x } count playableUnits;
```

### Example 3

```sqf
private _wasPlayer = isPlayer [_deadBody]; // returns true if _deadBody's identity still exists and was controlled by a player
```

## See also

[player](../commands/player.md) · [playableSlotsNumber](../commands/playableSlotsNumber.md) · [playableUnits](../commands/playableUnits.md) · [playersNumber](../commands/playersNumber.md)

## Community notes

**Kronzky**

This is not the same as testing object == [player](../commands/player.md), because in MP it tests for any player, not only for the local one. If object is a vehicle, the test is done for the vehicle commander.

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