# GetPlayerCount

Player
5.1 OC
int
int player_type If specified, only the number of players of the specified type is returned. For a list of all player types see GetPlayerType.
Returns the number of players currently in the game.
As players may join and leave a game at runtime, there can be "gaps" in player indexing, meaning player numbers may skip certain values. GetPlayerCount returns the actual number of players, not the index of the last player plus one. To process all joined players you need special handling (see example) - you cannot simply run from index 0 to GetPlayerCount() - 1. See the example for GetPlayerByIndex.
See GetPlayerByIndex.
GetPlayerName
GetPlayerByIndex
EliminatePlayer
Sven2
2007-12