This won’t work properly all the time, not sure if it’s also the cause for your other issues but at least it won’t add all players to that array.
For example: if player 0, 1, 2, and 3 are online, then that means 4 players are online. so it’ll iterate and find 0, 1, 2, 3. But, if 2 leaves, then you end up with 3 players online, so it’ll find 0, 1, 3. In which case 4 will be left out.
Just loop from 0 to 256 and you’ll be all set.
Not sure if this also gives you the ‘player id’ issue, but at least it’s some problem.
1 Like