Matheus28: HI
Firstly, sorry that it's taken ages for me (or anybody) to get around to re-reviewing this.
The only real issue that I see is in the player_team event handler. The logic for ignoring clients seems to be reversed, likely from just typoing it. It exits if the player is in game, rather than if the player is not in game.
Fix that, and I will approve it.
Some less critical things:
* The IsClientSourceTV and IsClientReplay checks in SelectHidden are redundant. IsFakeClient catches those cases.
* The instructions to press right-click to attack and R to use your special should probably be press alt-attack and press reload. Not all uses have the same keybinds. Alternatively, if you use a hint message instead of chat, you can use identifiers like %attack2% and %reload% and it will translate them to whatever key the client has bound.
*
Code:
SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT));
ClientCommand(client, "r_screenoverlay %s", overlay);
Does this work? r_screenoverlay only exists on the client, not the server, and I was under the impression that SetCommandFlags only touches commands that exist on the server. (no communication to the client for it).
--
I also notice that there is a large amount of logic done in OnGameFrame (every frame), and in OnPlayerRunCmd (every frame, for each player).
You might want to consider using the SM profiler and optimizing if the server seems to be taking noticeably more resources with the mod running, especially with other plugins loaded.
For example,
Code:
SetEntDataFloat(i, FindSendPropInfo("CTFPlayer", "m_flMaxspeed"), 400.0, true);
can be done with just SetEntPropFloat
For cases where you check TF2_IsPlayerInCondition and then only use TF2_RemoveCondition if true, you can skip the check. There is no harm in calling RemoveCondition if the condition is not set. (your disguised, dead ringer, and kritzkrieg checks in OnGameFrame).
In OnPlayerRunCmd, you can fold
Code:
if(buttons & IN_FORWARD
|| buttons & IN_BACK
|| buttons & IN_MOVELEFT
|| buttons & IN_MOVERIGHT
|| buttons & IN_JUMP
){
into
Code:
if((buttons & IN_FORWARD|IN_BACK|IN_MOVELEFT|IN_MOVERIGHT|IN_JUMP) > 0)
though the difference for just math will likely be negligible even for per frame per client, and that's assuming that the compiler combines the constants.