This is a direct replacement for those long winded "if" statement routines that people have been posting for changing weapons. I find this a little better to work with for Weapons Changing as it allows much more flexibility.
Open the "wl_agent.c" file and search for "void CheckWeaponChange". Replace the routine with the following:
::: CODE :::
void CheckWeaponChange (void)
{ int kbuttons[5]={sc_1,sc_2,sc_3,sc_4,sc_5};
int i;
for (i=0;i<5;i++)
if ((Keyboard[kbuttons[i]]) && (i <= gamestate.bestweapon) && (i != gamestate.weapon))
{
gamestate.weapon = gamestate.chosenweapon = i;
// Change weapon sound ala MCS suggestion
if(gamestate.chosenweapon > 0) SD_PlaySound(MYCHGSND); // Weapon Change Sound
DrawWeapon ();
DrawAmmo ();
return;
}
}
This could easily be modified to allow for more weapons without all those nasty 'if' statements and also be modified to do the 2 weapons from one key.
I won't do the work for you, but this is a pretty good base to start from.
Greg
BrotherTank