RedM Natives

GET_ACTIVE_PLAYERS

Returns all player indices for 'active' physical players known to the client.

Hash0xCF143FB9
Runtime nameGetActivePlayers
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

object GET_ACTIVE_PLAYERS();

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

Description

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
local retval = GetActivePlayers()

-- always works, by hash
local retval = Citizen.InvokeNative(0xcf143fb9, Citizen.ResultAsObject2(msgpack.unpack))
JavaScript and C#
JavaScript
const retval = GetActivePlayers();

// by hash
const retval = Citizen.invokeNative('0xcf143fb9', Citizen.returnResultAnyway(), Citizen.resultAsObject2());
C#
Function.Call((Hash)0xcf143fb9);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.