Auto swap


(nikita) #1

in the source some weapons defined such as panzer to swap to other weapon after a shot.

is it possable and how , if player pickup a weapon, to auto swap to that new weapon (thompson)?
for exemple if i am using MP40
then i pickup a thompson, NOT INSTEAD of the mp40 but with it
how do i make it swap to that thompson, i am trying to make that a player can pickup all weapons, so far its working but now i want auto swap to new weapon that u picked up

so to summary my question:
how do i enable player to auto swap the old weapon in his hand to a new weapon that he picked up?


(dvldrmmr) #2

havent tried this, but after you pickup the new weapon, add an event to switch to the weap you just picked up … i dont know the event name off hand, but its defined in a header file, bg_public.h i think … hope this helps …


(kamikazee) #3

In CG_OutOfAmmoChange, cg_weapons.c line 7352 is a snippet of code which makes the game switch to another weapon after the panzerfaust is fired. There is code along the lines of this to switch:

cg.weaponSelect = newWeapon;
CG_FinishWeaponChange( cg.predictedPlayerState.weapon, cg.weaponSelect );