View Single Post
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-14-2019 , 10:14   Re: [TF2] Client is not in game bug
Reply With Quote #18

I know all about these functions because i'm using them a lot (without any errors, but this situation is an exception)

I'm sure, OnPlayerSpawn is not called on connecting (not in game) players, so if (!iClient) check just to ensure that we're working with real player.

Quote:
you check if the client is in game only in that iteration (code part 2).
Client can't be in game if he's not connected.

Quote:
maybe the client disconnected and he's still connected but not in game.
Client can't be disconnected and connected at same time.

I put userids of clients that in-game and if GetClientOfUserid returns 0 inside callback that means that *this* userid disconnected before callback execution.

Quote:
the solution for your problem:
I've already posted this solution, but i think it's just a waste of CPU.
__________________

Last edited by MAGNAT2645; 08-14-2019 at 10:21. Reason: Additional info
MAGNAT2645 is offline