---
name: "allPlayers"
type: command
status: ok
groups: ["Multiplayer", "Object Detection"]
arma3_since: "1.48"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/allPlayers
revid: 370218
updated: 2024-11-10T14:50:49Z
---

# allPlayers

*Command · Multiplayer, Object Detection · Arma 3 v1.48*

## Description

Returns a list of all units controlled by connected clients. This includes:
- Normal human players (including dead players)
- Virtual Entities (see *Systems* → *Logic Entities* → *Virtual Entities* in the Eden Editor)
  - Headless Clients (`HeadlessClient_F`)
  - Virtual Curators (`VirtualCurator_F`, `- _VirtualCurator_F`)
  - Virtual Spectators (`VirtualSpectator_F`)

Use [BIS_fnc_listPlayers](../functions/BIS_fnc_listPlayers.md) or see [#Example 1](../commands/allPlayers.md#example-1) to only get human players.

## Syntax

```sqf
allPlayers
```

**Returns:** [Array](../topics/Array.md) of [Object](../topics/Object.md)s

## Examples

### Example 1

Get human players (i.e. all players excluding Headless Clients):

```sqf
private _players = allPlayers - entities "HeadlessClient_F";
```

### Example 2

Get non-virtual players (i.e. all players excluding Virtual Entities):

```sqf
private _players = allPlayers select {!(_x isKindOf "VirtualMan_F")};
```

### Example 3

```sqf
{
    systemChat format [
        "Player %1 is %2", 
        name _x, 
        ["dead", "alive"] select alive _x
    ];
} forEach allPlayers;
```

### Example 4

```sqf
private _bluforPlayers = blufor countSide allPlayers;
```

## Multiplayer

- The complete array of [allPlayers](../commands/allPlayers.md) may get delayed on mission start in multiplayer. Use [BIS_fnc_listPlayers](../functions/BIS_fnc_listPlayers.md) to obtain it earlier.
- The order of the returned array may differ from server to clients.

## See also

[allCurators](../commands/allCurators.md) · [allGroups](../commands/allGroups.md) · [allDead](../commands/allDead.md) · [allUnits](../commands/allUnits.md) · [switchableUnits](../commands/switchableUnits.md) · [playableUnits](../commands/playableUnits.md) · [vehicles](../commands/vehicles.md) · [allUnitsUAV](../commands/allUnitsUAV.md) · [allDeadMen](../commands/allDeadMen.md) · [isPlayer](../commands/isPlayer.md) · [playersNumber](../commands/playersNumber.md) · [allUsers](../commands/allUsers.md) · [getUserInfo](../commands/getUserInfo.md)

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