Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Help] Ammo Problem

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Fri Mar 11, 2005 3:46 pm    Post subject: [Help] Ammo Problem Reply with quote

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
View user's profile Send private message Visit poster's website
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Tue Mar 15, 2005 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Tue Mar 15, 2005 3:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.