A few questions...
1, I placed your code in my GSC file and it works as advertised. Only I do not have a knife. No weapons at all.
2. What do you mean by "Turning my map into a mod"? Is this what I have done?
All I really want is when players play this map, all they have is a knife. The map will be a small, knife only map.
And thanks for your replies, they are very informative, and greatly appreciated.
I just tried this and I have concluded the following: as the knife is actually in the weapon files, if you remove ALL weapons, there is nothing to define a knife.
So, how do you get around it? I would say, that a custom weapon file is needed - one which has no models for weapons, only defining the knife. But, and this is a big "but", this will make your map more into a mod than is advisable.
What do I mean "making your map into a mod":
a map is a level for players to play on; with COD4, you cannot run a custom map without a mod folder; although you need the folder, you don't actually have to use any mod files - just the folder in order to launch custom maps; So, theoretically, you could make your map and include whatever you like in it - weapon files and all; but the problem is other users will want to try your map with the various mods around. Including any kind of scripts which control weapon behaviour, or including weapon files in your map, will break some of the mods around. It would break my mod (Demon mod) for example, and it would break the Openwarfare and X4 mods.As such, admins who really want to run those mods will abandon your map. this will severely limit the admins who are willing to run your map.
Most mods actually have "knife only" features (mine doesn't). If you want to design your map with knife only you can do that. Just advise people to use a particular mod in order to enjoy your map the way you think it is best played.
Having said all that, again: if you really want to do this, I could probably create a custom weapon file which will give you the knife-only effect you are looking for.