This type of cheat, probably a wallhack, relies on the client being able to receive enemy players' location information that is sent from the server. It basically applies the glowing outline (similar to CTF intel carriers) on the enemy players. Changing the server's sv_pure settings will stop the client from replacing the players' textures with ones that glow through walls, but it does not stop injected cheat programs from intercepting the players' location data packets and applying the green outline based on that information.
The only way to stop this is to not send player location packets to the clients until those clients would normally be able to see enemy players. This can be done with a server-side plugin that computes visibility for each player and does not send location data for enemies that are outside of each client's field of view. In layman's terms, if the enemy is cloaked or behind a wall, the server figures out which clients should be able to see him, and doesn't tell the ones who shouldn't where he is. Instead, it simply skips sending them location data packets, or makes up a fake location (such as above the map or in spawn) until the enemy shows himself. This also prevents all forms of ESP/Radar from working (even the legit radar in Counter-Strike.)
While this plugin does prevent wallhacks and radar from being able to know where the enemy is, as well as preventing aimbots from targeting players through walls, there are some downsides. It will not stop the aimbot from targeting an enemy who is in the cheating player's field of view. It also will cause legit players to see their enemies "pop" out of thin air or disappear when wandering into and out of their view.
I believe such a plugin already exists.
https://forums.alliedmods.net/showthread.php?t=162720
If it's not there, would someone else please post the link to it? I've seen it but I forgot where it is or what it's called.
EDIT: Yeah, it's one of the SMAC modules, but be careful with it. It's effective, but, like r3dw3r3w0lf said, very CPU intensive, and it can cause legit players to sometimes see weird things.
In a way, it's kinda sad that TF2 is free to play. Cheaters should be forced to pay money to continue cheating. Maybe that would discourage them at least a little bit.
__________________