RedM Natives

NETWORK_GET_NUM_CONNECTED_PLAYERS

Returns the amount of players connected in the current session.

Hash0xA4A79DD2D9600654
Runtime nameNetworkGetNumConnectedPlayers
NamespaceNETWORK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xA4A79DD2D9600654

Signature

int NETWORK_GET_NUM_CONNECTED_PLAYERS();

Returns int

Description

Returns the amount of players connected in the current session. Only works when connected to a session/server.

Usage

Lua
local retval = NetworkGetNumConnectedPlayers()

-- always works, by hash
local retval = Citizen.InvokeNative(0xA4A79DD2D9600654, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = NetworkGetNumConnectedPlayers();

// by hash
const retval = Citizen.invokeNative('0xA4A79DD2D9600654', Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xA4A79DD2D9600654);

Sources

alloc8or RDR3 NativeDB

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