Basically I am trying to make a system where you reload using
magazines.  So instead of showing 30 - 120 ammo down at the bottom I
want it to say 30 - 4 or whatever.  I also wanted to make it to where
if you reload with 4 ammo in the magazine that when you reload, you
recycle the magazines so if you have 4 clips, you shoot 15 bullets,
then reload 4 times, your back to a clip with 15/30 bullets in it.  To
do this I started by making a structure like so:

typedef struct magazine{ int AmmoLeft };

Then I added an instance of that structure ( magazine magazine[4]; )
in the CWeaponMP5 and 2 new ints called CurrentMagazine and
NextMagazine.  Now I have several questions.

One is where do I place the initialization of the amount of ammo in
the clip.  For instance I first put magazine[0].AmmoLeft = 30; in the
CWeaponMP5::Deploy, but then I realized that that would be called
every time I switched from shotgun and then back.

Another Question is what should I use to subtract ammo from my clip,
should I add in the Reload Function a line that says
magazine[CurrentMagazine].AmmoLeft -= pPlayer->m_iShotsFired, or in
primary fire should I add a call that just says
magazine[CurrentMagazine].AmmoLeft--;.

In the reload function there is a call to DefaultReload.  This looks
like it is based strictly on the default ammo, so should i just
comment that out and in CWeaponSDK::Reload just add the code to send
the animation events and such.

Also what file is the code that controls the Ammo display on the hud
modified? hud_numericdisplay.cpp?.

P.S. When I add a DevMsg("test.\n"); in the CWeaponMP5::PrimaryAttack,
it always prints out the message twice... why is that?

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to