Method 1:
One idea is to set a recursive script for the number 1 key to bind your knife script to mouse 1 any time you hit 1, and then return to normal upon hitting 1 again. That should look like this:
//Fast Knife Script
set attackspeed1 "weapon 1; bind MOUSE1 "+attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack"; set attackspeed "vstr attackspeed2";"
//After hitting 1 you have you switch to your knife and have your fast knife script,
REMEBER TO CHANGE THE WAIT TIME BASED ON YOUR FPSset attackspeed2 "weapnext; bind MOUSE1 "+attack"; set attackspeed "vstr attackspeed1";"
//Hit 1 again and you go back to normal and your previous weapon
set attackspeed "vstr attackspeed1"
bind 1 "vstr attackspeed"
So, pretty straight forward, but not perfect for the differences in zombie ts or bomb, where throwing knives are very useful. Not to mention I have a few scripts I use as a human that I wouldn't as a zombie.
Method 2:
So the second method (and method I ascribe to) is to make two seperate config files that can bind keys by the push of the button. In this example I made two new files in the q3ut folder called human.cfg and zombie.cfg. To switch between those two cfg I have a small script in my autoexec.cfg. It is very simple, and looks like this:
//Main zombie, human switch
bind z "exec zombie.cfg; ut_echo "Zombie Mode Activated";"
bind x "exec human.cfg; ut_echo "Human Mode Activated";"
Then within the human.cfg you can put whatever you like. For this example we are going to put in a very simple field of view script ((to change the field of view and sensitivity while scoping in to give a mini zoom in on pressing mouse 2)). Note: I also bound the N key to change weapon modes, the reason for this is once you bind that ability to another key (which we will do in the zombie setup) and then take that command away (by changing what mouse2 does in the human setup), it does not default back to any value. So here is what a human.cfg will look like without my weapon selection binds.
//Human.cfg
Set cg_fov "110"
bind MOUSE1 "+attack;"
bind n "+button3; -button3;"
set zoom1 " ut_zoomin; cg_fov 90; set zoom "vstr zoom2";"
set zoom2 " ut_zoomreset; cg_fov 110; set zoom "vstr zoom1";"
set zoom "vstr zoom1"
bind MOUSE2 "vstr zoom"
Alright, so humans are setup lets look at zombies. Now we want a script that will change our attack from the fast attack to normal when we change to a throwing knife. To do that, we will make another script that will have our two weapon attack speeds bound to mouse1 (normal, and +/-;wait). We will then write another script that changes these stats as we change to our throwing knife. That looks something like this:
//zombie.cfg
Set cg_fov "110"
//faster knife
set knifestab1 "+attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack; wait 9; +attack; -attack;"
set knifestab2 "+attack; -attack;"
set knifestab "vstr knifestab1;"
bind MOUSE1 "vstr knifestab;"
//Toggle zoomin and knife throw
set knifethrow1 "+button3; -button3; cg_fov 90; set knifestab "vstr knifestab2"; set knifethrow "vstr knifethrow2";"
set knifethrow2 "+button3; -button3; cg_fov 110; set knifestab "vstr knifestab1"; set knifethrow "vstr knifethrow1";"
set knifethrow "vstr knifethrow1"
bind MOUSE2 "vstr knifethrow"
understanding this script will help you use it (it is easy to get your attack state -fast or regular- confused). Remember that with this method you can always go back to the z or x key and reset your binds back to normal. Since this is the method I ascribe to and you have been a great audience (assuming you have read this all the way through) I have attached the needed files to drop into your q3ut4 folder without you needing to open up your text editor at all. Human mode is bound to X, Zombie Mode is bound to Z. Test it out, see what you think, figure out what works for you.