Benroadsbind "1" "slot1; r_drawviewmodel 0" bind "2" "slot2; r_drawviewmodel 0" bind "3" "slot3; r_drawviewmodel 1"
Found this on the steam forums and used it, problem is when I respawn my weapons view models turn back on until I press 1. Is there a way around this?
Turn on "remember last active weapon" in advanced options. Your problem is that u died while holding your melee and when you spawn u switch to primary without pressing the button that changes view models. Remembering last active weapon prevents any weapon changing while dead that screws up view models. Your only other problem would be weapons that switch your active weapon automatically (like using a throwable item or running out of ammo). This will change to your last active weapon which may have had a different view model setting. The only way around this is to set up a more complicated bind that works only for a specific class when they're holding a specific slot, which is extensive and gets screwed up if you switch that slot to a different item that works differently. Ex u could make the sniper always switch to primary and turn off view models every time he fires secondary (jarate), but then if u use an smg u have problems (or even worse if u use a backpack and accidentally press two, switching ur binds without switching ur weps).
Long story short, it's easier to just press one either while ur dead or after u spawn.