| View previous topic :: View next topic |
| Author |
Message |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Fri Mar 11, 2005 3:46 pm Post subject: [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? _________________ My Wolfenstein Website:
http://www.wolf94.cjb.net
Status: Falling apart over a product I ordered that is taking forever to arrive. |
|
| Back to top |
|
 |
Deathshead Corporal

Joined: 18 Feb 2005 Posts: 87
|
Posted: Tue Mar 15, 2005 9:59 am Post subject: |
|
|
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.
| Code: |
// 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). _________________ Myspace
VampireFreaks
Music4Life
Wolfing Time |
|
| Back to top |
|
 |
Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Tue Mar 15, 2005 3:47 pm Post subject: |
|
|
thanks! I'll try it. _________________ My Wolfenstein Website:
http://www.wolf94.cjb.net
Status: Falling apart over a product I ordered that is taking forever to arrive. |
|
| Back to top |
|
 |
|