The global pointer of the first entity is always 0, the second is 1 and so on.
The msg pointer is always NULL on this server side event.

Your source code is already big. So it's not that easy to find the problem without doing some tests.
You should comment out everything that's not needed. Then you can check if the correct function is called for every player entity. If the my pointer is pointing to the entity you want. Then you can check if the global pointer returned by anet is correct and so on.
Do a step by step debugging and try to keep the code as simple as possible. Comment out things that are unrelated to your problem.

I can tell you that the functions are tested out very well! There are already a lot of games using these functions. Maybe looking into my example codes on the anet homepage may also help you.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version