I have now Idea how, but it works! Thanks!
Here are the scripts I ended up using, in case somebody wants to know :)
-----------------------------------------------------------------------------
Paste this into you autoexec.cfg :
unbind "KEY"
bind "KEY" view
alias viewon "exec viewmodall; alias view viewoff"
alias viewoff "exec viewmodmelee; alias view viewon"
viewoff
-----------------------------------------------------------------------------
create a new .cfg file named viewmodall.cfg and paste this:
r_drawviewmodel 1
alias wep1 "slot1; wep1com; alias mouseup wep-3; alias mousedown wep2; alias quickswap wep-3; alias lastwep wep1; keybind1"
alias wep2 "slot2; wep2com; alias mouseup wep-1; alias mousedown wep3; alias quickswap wep-1; alias lastwep wep2; keybind2"
alias wep3 "slot3; wep3com; alias mouseup wep-2; alias mousedown wep1; alias quickswap wep-2; alias lastwep wep3; keybind3"
alias wep-1 "slot1; wep1com; alias mouseup wep-3; alias mousedown wep2; alias quickswap wep2; alias lastwep wep-1; keybind-1"
alias wep-2 "slot2; wep2com; alias mouseup wep-1; alias mousedown wep3; alias quickswap wep3; alias lastwep wep-2; keybind-2"
alias wep-3 "slot3; wep3com; alias mouseup wep-2; alias mousedown wep1; alias quickswap wep1; alias lastwep wep-3; keybind-3"
alias keybind1 "alias key1 wep1; alias key2 mousedown; alias key3 mouseup"
alias keybind2 "alias key1 mouseup; alias key2 wep2; alias key3 mousedown"
alias keybind3 "alias key1 mousedown; alias key2 mouseup; alias key3 wep3"
alias keybind-1 "alias key1 wep-1; alias key2 mousedown; alias key3 mouseup"
alias keybind-2 "alias key1 mouseup; alias key2 wep-2; alias key3 mousedown"
alias keybind-3 "alias key1 mousedown; alias key2 mouseup; alias key3 wep-3"
alias mouseup "wep-3"
alias mousedown "wep2"
alias quickswap "lastwep"
alias lastwep "wep2"
alias key1 "wep1"
alias key2 "mousedown"
alias key3 "mouseup"
alias key4 "slot4; extrakey"
alias key5 "slot5; extrakey"
alias extrakey "alias mouseup wep-3; alias mousedown wep1; alias quickswap lastwep; alias lastwep wep3"
alias wep1com "r_drawviewmodel 1"
alias wep2com "r_drawviewmodel 1"
alias wep3com "r_drawviewmodel 1"
//BACKUP
bind MWHEELUP mouseup
bind MWHEELDOWN mousedown
bind Q quickswap
bind 1 key1
bind 2 key2
bind 3 key3
bind 4 key4
bind 5 key5
---------------------------------------------------------------------------------
create a new .cfg file named viewmodmelee.cfg and paste the stuff from above again,
but change:
alias wep1com "r_drawviewmodel 1"
alias wep2com "r_drawviewmodel 1"
alias wep3com "r_drawviewmodel 1"
to
alias wep1com "r_drawviewmodel 0"
alias wep2com "r_drawviewmodel 0"
alias wep3com "r_drawviewmodel 1"
and you are done :)
--------------------------------------------------------------------------------
There is only one small problem: If you press the key to toggle the viewmodel stuff, the last used weapon or quickswitch will be changed to you secondary!
However, that should be easy to fix, since it is a problem with the stuff in the viewmodmelee.cfg and in the viewmodall.cfg. Could someone please help me fixing this?