I have a guess. Do you send the players[] array to a new client before he creates his player entity?
Example:
Content of players[] at start: [0][0][0][0]
Server started --> players[]: [0][0][0][0] (because the first glob. pointer is 0)
Client started --> players[]: [0][1][0][0] now send it
Client2 started --> players[]: [0][0][2][0] now send it
You see two things out of this exmample:
1) The startvalue of players has to be [-1][-1][-1][-1] because 0 is already a pointer
2) The array has to be sent to a new client before he creates his player. Otherwise it will send an array where all entries are zero (or -1 if you do it correct) and only the entry for this client is filled.
3) Another thing: Don't send the whole array if you only change 1 index. Send only the changed index. This produces much less traffic.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version