Client indexs are like server maxplayers slots, (array[] size of maxplayers.)
Client index 0 is server (or error in some cases).
Players connect to client index 1 to MaxClients.
But you need check first, make sure player is valid, is player connected into that client index (IsClientConnected(client) or IsClientInGame(client) or is it empty).
After MaxClients index, will began entity indexs to 2048 if I remember right.
Server fill slots, starting from smallest index, if there are free.
Player keep same index between map change and reconnect.
But once player disconnect and connect back to server, player could have taken another client index.
userid is handy serial number for players.
userid is like ticket number, number increase by one every time when player connect to server.
Player is keeping same userid number as long as he/she not disconnect from server.
You can look from command
status or
users.
-
users "slot" however, start from index 0, ignore that -1 offset
Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure [A:1:4132805633:15417]
udp/ip : 192.168.1.21:27016 (public ip: )
os : Windows
type : community dedicated
players : 1 humans, 16 bots (32/0 max) (not hibernating)
# userid name uniqueid connected ping loss state rate adr
# 2 1 "Bacardi" STEAM_1:1:14163588 01:07 25 0 active 786432 192.168.1.21:27005
# 3 "Josh" BOT active 64
# 4 "Tom" BOT active 64
# 5 "Brandon" BOT active 64
# 6 "Irving" BOT active 64
# 7 "Greg" BOT active 64
# 8 "Mike" BOT active 64
# 9 "Gary" BOT active 64
#10 "Orin" BOT active 64
#11 "Harold" BOT active 64
#12 "Henry" BOT active 64
#13 "Scott" BOT active 64
#14 "Will" BOT active 64
#15 "Wyatt" BOT active 64
#16 "Alfred" BOT active 64
#17 "Bill" BOT active 64
#18 "Steve" BOT active 64
#end
users
<slot:userid:"name">
0:2:"Bacardi"
1:3:"Josh"
2:4:"Tom"
3:5:"Brandon"
4:6:"Irving"
5:7:"Greg"
6:8:"Mike"
7:9:"Gary"
8:10:"Orin"
9:11:"Harold"
10:12:"Henry"
11:13:"Scott"
12:14:"Will"
13:15:"Wyatt"
14:16:"Alfred"
15:17:"Bill"
16:18:"Steve"
17 users
Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure [A:1:4132805633:15417]
udp/ip : 192.168.1.21:27016 (public ip:)
os : Windows
type : community dedicated
players : 1 humans, 17 bots (32/0 max) (not hibernating)
# userid name uniqueid connected ping loss state rate adr
#30 "Josh" BOT active 64
#31 "Doug" BOT active 64
#33 "Gary" BOT active 64
#35 "Martin" BOT active 64
#36 "Nate" BOT active 64
#37 "Mike" BOT active 64
#38 "Perry" BOT active 64
#40 "Yahn" BOT active 64
#42 "Grant" BOT active 64
#43 "Henry" BOT active 64
#44 "Jon" BOT active 64
#45 "Jason" BOT active 64
#46 "Keith" BOT active 64
#47 "Scott" BOT active 64
#48 "Ethan" BOT active 64
#49 "Matt" BOT active 64
#50 "Jerry" BOT active 64
# 51 22 "Bacardi" STEAM_1:1:14163588 04:35 18 0 active 786432 192.168.1.21:27005
#end
users
<slot:userid:"name">
0:30:"Josh"
1:31:"Doug"
3:33:"Gary"
5:35:"Martin"
6:36:"Nate"
7:37:"Mike"
8:38:"Perry"
10:40:"Yahn"
12:42:"Grant"
13:43:"Henry"
14:44:"Jon"
15:45:"Jason"
16:46:"Keith"
17:47:"Scott"
18:48:"Ethan"
19:49:"Matt"
20:50:"Jerry"
21:51:"Bacardi"
18 users
__________________