NetworkClient

networkGetNumConnectedPlayers

NETWORK_GET_NUM_CONNECTED_PLAYERS0xA4A79DD2D9600654

The GTA V native NETWORK_GET_NUM_CONNECTED_PLAYERS of the NETWORK namespace, as LS:MP client scripts call it: the global function networkGetNumConnectedPlayers, in JavaScript and in Lua.

SignatureJavaScript
networkGetNumConnectedPlayers(): number
SignatureLua
networkGetNumConnectedPlayers(): integer

Usage

JavaScript
const result = networkGetNumConnectedPlayers();
Lua
local result = networkGetNumConnectedPlayers()

Parameters

None.

Returns

int JavaScript number, Lua integer

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

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

Reference

Namespace
Network NETWORK
In the game
int NETWORK_GET_NUM_CONNECTED_PLAYERS()
Hash
0xA4A79DD2D9600654

Open in the interactive natives reference