getPlayers

Returns an array of all connected players (server ID's) as strings. Equivalent to GetPlayers() in Lua.

Syntax

getPlayers();

Examples

const players = getPlayers();
for (const playerId of players) {
  console.log(playerId);
}