If someone finds this useful here is an improved version based on a few other hide plugins around here.
thanks hardy for fixing some bugs https://hatebin.com/tfzgekhcvn
thank you! i added the code to main thread and i also added TF2 version reference.
__________________
Also known as Hardy`.
Feel free to contact me if you have a private plugin request!