PlayerClient

getNumberOfPlayers

GET_NUMBER_OF_PLAYERS0x407C7F91DDB46C16

The GTA V native GET_NUMBER_OF_PLAYERS of the PLAYER namespace, as LS:MP client scripts call it: the global function getNumberOfPlayers, in JavaScript and in Lua.

SignatureJavaScript
getNumberOfPlayers(): number
SignatureLua
getNumberOfPlayers(): integer

Usage

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

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.

Gets the number of players in the current session.
If not multiplayer, always returns 1.

Reference

Namespace
Player PLAYER
In the game
int GET_NUMBER_OF_PLAYERS()
Hash
0x407C7F91DDB46C16

Open in the interactive natives reference