If you join the server, but only select the spectator team (so you're never getting alive)? Is the "Command_SteamLvl" working as expected that way too?
Or do you have to wait until you have spawned (been alive at least once) before your "Command_SteamLvl" works fine?
Quote:
Originally Posted by Aketti
[...] so now the question is where should I put this piece of code to check if player has certain level and kick him from server if he doesn`t. I wouldn`t like to check all players every round to determine if their level is ok, it should happen on player connect.
|
As OnClientPostAdminCheck does not provide the information you want at that stage, I suggest trying player_spawn:
You can then create a global variable, e.g. "g_bHasPlayerBeenSpawned", and at the time you check the player and handle him/her accordingly, if (s)he fits the criteria to stay, set "g_bHasPlayerBeenSpawned" to TRUE, to prevent further scans.
And then remember to unset / set to FALSE again in OnClientDisconnect for the relevant client index.
If OnClientPostAdminCheck is "too soon" to check for this prop, as it appears according to your explanation, the player_spawn may be the earliest / best shot, and then add the use of the boolean variable from the beginning and/or if you experience performance issues due to the check at each spawn.
__________________