- While loop stop when FindEntityByClassname return -1
- You can start with variable int ent = -1;
but in your example, it just skip client indexs, 0 = console, 1 2 3 ...
is dynamic variable.
In old games you can set server max players, in server launch parameter -maxplayers
1 to 64.
It depends game, how many slot you can get, example TF2 have 32.
SourceTV add one extra slot also when enabled +1.
And If I remember right, CSGO game reserve all 65 slots for players but limit player count with different game modes (gamemodes.txt "maxplayers").
To stop this change of max players count, it can be force to keep max player count with -maxplayers_override
public const int MaxClients; /**< Maximum number of players the server supports (dynamic) */
I maybe telling lot of