View Full Version: [code]Knife Ammo Display (quick fix)

wolfers >>Coding Alliance >>[code]Knife Ammo Display (quick fix)


<< Prev | Next >>

Deathshead- 02-28-2005
[code]Knife Ammo Display (quick fix)
This is a simple fix that makes the statusbar display 0 ammo when the knife is out. Simply replace the DrawAmmo routine with: /* =============== = = DrawAmmo = =============== */ void DrawAmmo (void) { char noammo=0; switch (gamestate.weapon) { case wp_knife: LatchNumber (27,16,2,noammo); break; case wp_pistol: case wp_machinegun: case wp_chaingun: LatchNumber (27,16,2,gamestate.ammo); break; } } With further editting (which I can't be stuffed doing right at this moment), you can make the area blank when the knife is out. There you go -Deathshead

Conner94- 02-28-2005

Using yours as a base, I found out how to show no ammo with the knife. /* =============== = = DrawAmmo = =============== */ void DrawAmmo (void) { switch (gamestate.weapon) { case wp_knife: StatusDrawPic (27,16,N_BLANKPIC); StatusDrawPic (28,16,N_BLANKPIC); break; case wp_pistol: case wp_machinegun: case wp_chaingun: LatchNumber (27,16,2,gamestate.ammo); break; } } / As you can see, I simply took out the "char noammo" and had blank pics drawn instead. This is what I used for WarStorm, though is there an even easier way? The only other way I have been shown takes far more memory, so I didn't use that one. No bugs as of now, exept it will currently only work with 1 to 2 digits.

Deathshead- 02-28-2005

Yeah, I thought of using a blank string. Yours is pretty good though!

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.