This method forces game engine to think that in our hands there is no weapons. So we can completely rewrite the code of the main CS weapons. Why this way? Bcz
client side forces the animation replace 2 and not only. So we should completely resend everything from the server side to avoid bugs.
The way it's done is not very perfect, but it works in unique way, cz u can modify everything u want in simple way (not only view body switch, but damage, attack speed, recoil, rate and other).
There is three examples are attached, some people are saying the code is unreadable, but it's my style.
The blocking client side useful guide i found here (written by KCE):
https://forums.alliedmods.net/showthread.php?t=41265
From this thread, i've used method 1.
So, everything another part just was easy to complete. I' ve made 3 examples: knife, glock18, ak47.
You can put them together and test. While testing, use cl_lw 1 or 0 to see how it works.
I' ve seen once a person who made view body switch by another way, but it was buggy while using cl_lw 0. So...
Type in console switch_sex and set to 0 to view male hands. 1 is female.
Using this examples you can completely replace default CS weapon system and play with any bodygroup you want.
Updated: added shells, Glock18 Burst mode, removed some useless code again.
Updated: fix shoot event for other weapons, fix left-right hand auto switch