pnum stands for playersnumber, so it's the number of players that have been collected in players var, so if pnum is 3, players[0] players[1] and players[2] contain ids of the 3 players, and after that variable is empty, that's why you do the loop from i = 0 to i < 3 (pnum)