Numplayers

From EDukeWiki
Revision as of 06:22, 19 February 2020 by Fox (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Returns the number of non-bot players in the game.

In singleplayer, it is set to 1.

The non-bot player IDs range from zero to numplayers minus 1. Meaning bots will always hold the highest IDs.

In the original Duke Nukem 3D, once a player quit, numplayers would decrease permanently, meaning it was impossible for a new player to join mid-game.

It can also be used for when making a loop through all non-players. Example:

for My_Player range numplayers
{
  [...]
}

While MULTIMODE stores the total of player in the game, numplayers stores only non-bot players.