# CFX::GET_ACTIVE_PLAYERS

- **Hash:** `0xCF143FB9`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetActivePlayers`
- **Side:** client (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_ACTIVE_PLAYERS

## Signature

```c
object GET_ACTIVE_PLAYERS();
```

## Returns

`object` — An object containing a list of player indices.

## Description

*Source: Cfx.re native reference*

Returns all player indices for 'active' physical players known to the client.
The data returned adheres to the following layout:

```
[127, 42, 13, 37]
```

## Usage

### Lua

```lua
local retval = GetActivePlayers()

-- always available, by hash
local retval = Citizen.InvokeNative(0xcf143fb9, Citizen.ResultAsObject2(msgpack.unpack))
```

### JavaScript

```js
const retval = GetActivePlayers();

// by hash
const retval = Citizen.invokeNative('0xcf143fb9', Citizen.returnResultAnyway(), Citizen.resultAsObject2());
```

### C#

```csharp
Function.Call((Hash)0xcf143fb9);
```

*Sources: Cfx.re native reference.*
