Ok, next thing. I am trying to set this up so that when you have lvl4 heavy, a panzer, and a thompson, after you fire a panzer, it will switch to the thompson instead of a grenade. I know that EV_NOAMMO is called, which client-side uses to set the next weapon to be a pistol, and next a grenade. There’s got to be a way to instead not call that event, but do a manual switch to a thompson instead. Problem is I can’t get it working
It’ll switch to the thompson for a split second (the picture of your current weapon, anyway), then switch to a grenade. Any ideas?
Level 4 Heavy Weapons, Panzer/Thompson combo
jaybird
(jaybird)
#1
Chruker
(Chruker)
#2
In cg_weapons.c find the function CG_OutOfAmmoChange
And then find the section that looks like this:
// JPW NERVE -- early out if we just fired Panzerfaust, go to pistola, then grenades
if (cg.weaponSelect == WP_PANZERFAUST) {
// CHRUKER: Actually use a SMG first if we got it
for( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) {
// CHRUKER: Make sure we don't reselect the panzer. (That took me a while to figure that out :-)
if (weapBanksMultiPlayer[3][i] != WP_PANZERFAUST && CG_WeaponSelectable(weapBanksMultiPlayer[3][i])) { // find a smg
cg.weaponSelect = weapBanksMultiPlayer[3][i];
CG_FinishWeaponChange(cg.predictedPlayerState.weapon, cg.weaponSelect);
return;
}
}
for( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) {
if (CG_WeaponSelectable(weapBanksMultiPlayer[2][i])) { // find a pistol
cg.weaponSelect = weapBanksMultiPlayer[2][i];
CG_FinishWeaponChange(cg.predictedPlayerState.weapon, cg.weaponSelect);
return;
}
}
for( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) {
if (CG_WeaponSelectable(weapBanksMultiPlayer[4][i])) { // find a grenade
cg.weaponSelect = weapBanksMultiPlayer[4][i];
CG_FinishWeaponChange(cg.predictedPlayerState.weapon, cg.weaponSelect);
return;
}
}
}
This is the changed part.
jaybird
(jaybird)
#3
I am so sorry, I should have said so and I didn’t. I need this to be server-side only. Thanks for your reply though! But, any ideas how to make this thing switch with server code?