I know that I can turn off the viewmodels of all weapons of a specific class by typing
r_drawviewmodel "0" into the cfg file of that class, but how can I (with or without scripts) turn the viewmodels off for one weapon, but on for another?
e.g. I want my viewmodel to be on for my flamethrower and melee weapon for the pyro, but I want my shotgun's viewmodel off (as it helps me aim better). Is there any way I can do this?
In response to Austin's answer, I thought I'd post my entire cfg for my Pyro, to see if there are any conflictions:
cl_autoreload 1 unbind mouse3 //Secondary weapon alias +secondary "slot2" alias -secondary "slot1" //Melee weapon alias +melee "slot3" alias -melee "slot1" //Binds bind "mouse5" "+melee;r_drawviewmodel 1" bind mwheelup "slot1;r_drawviewmodel 1" bind mwheeldown "slot2;r_drawviewmodel 0"**
There is a bit in there about when I hold mouse5, I switch to melee, and, upon release, I switch back to my primary weapon, but I don't know if this is relevant.