Inside3D!
     

Donīt drop weapon when ammo 0

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Fri Jun 20, 2008 8:58 pm    Post subject: Donīt drop weapon when ammo 0 Reply with quote

Hi,
where can i change it, that the player doesnīt lose his weapon if
self.currentammo is 0?

W_CheckNoAmmo doesnīt do anything.
Back to top
View user's profile Send private message
MDave



Joined: 17 Dec 2007
Posts: 75

PostPosted: Fri Jun 20, 2008 9:07 pm    Post subject: Reply with quote

In W_CheckNoAmmo:
Code:

   if (self.weapon == IT_MY_AWESOME_WEAPON_OF_DOOM)
      return TRUE;

And in the functions where you change weapons, for example:
Code:

   else if (self.impulse == 109)
   {
      fl = IT_MY_AWESOME_WEAPON_OF_DOOM;
//      if (self.ammo_strawberries < 1)
//         am = 1;
   }

comment out those 2 lines Wink

And one last thing, add a check in the weapons firing function like the following:
Code:

/*
================
W_ThrowStrawberry
================
*/
void() W_ThrowStrawberry =
{

    if (self.ammo_strawberries == 0)
    {
       sprint (self, "You have no strawberries! Go and buy some more fool!\n");
       return;
    }
Back to top
View user's profile Send private message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Fri Jun 20, 2008 10:01 pm    Post subject: Reply with quote

loooool

Thank you Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming 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 © 2004 phpBB Group