Storing the counts globally based on player index is pointless. As multiple people have told you the indexes are meaningless after a user disconnects. The code you have posted above will break because of this. I repeat: Indexes are not permanent! There is a reason I used the tries to work with steamids instead of player indexes.
If you want a per-user count use my code. Add a global counter if you want, but do it separately from the player counts.
If you want only a global count you can remove everything regarding the g_leave_count trie and just work with the global counter.
/edit: Please try to actually understand what I did with the code. Your changes break it completely and shows that you did not understand it at all.