View Full Version: [Help] Ammo Problem

wolfers >>Coding Alliance >>[Help] Ammo Problem


<< Prev | Next >>

Conner94- 03-11-2005
[Help] Ammo Problem
When shooting a new ammo, it goes below zero. I am using a reloading code, but the same rules apply for the ammo. Can anyone help?

Deathshead- 03-15-2005

This is code directly from my game, and is used in BrotherTank's CheckWeaponChange routine. It checks to see if you have ammo for a weapon, if yes, returns true, no, returns false. // Checks to make sure you have ammo for weapon // returns "true" if yes and "false" if no int ChkAtkAmmo (int weapon) { switch (weapon) { case wp_knife: return 1; case wp_pistol: if (ammotype.ammo1 > 0 ) return 1; case wp_machinegun: if (ammotype.ammo2 > 0 ) return 1; case wp_chaingun: if (ammotype.ammo3 > 0 ) return 1; break; } return 0; } This is for my source, so you'd need to edit it to suit your needs, and you'd need to call it in the correct places. See Working with Weapons thread for more help (in DHW).

Conner94- 03-15-2005

thanks! I'll try it.

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