Forum

Don´t drop weapon when ammo 0

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Don´t drop weapon when ammo 0

Postby Stealth Kill » Fri Jun 20, 2008 8:58 pm

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.
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby MDave » Fri Jun 20, 2008 9:07 pm

In W_CheckNoAmmo:
Code: Select all
   if (self.weapon == IT_MY_AWESOME_WEAPON_OF_DOOM)
      return TRUE;

And in the functions where you change weapons, for example:
Code: Select all
   else if (self.impulse == 109)
   {
      fl = IT_MY_AWESOME_WEAPON_OF_DOOM;
//      if (self.ammo_strawberries < 1)
//         am = 1;
   }

comment out those 2 lines ;)

And one last thing, add a check in the weapons firing function like the following:
Code: Select all
/*
================
W_ThrowStrawberry
================
*/
void() W_ThrowStrawberry =
{

    if (self.ammo_strawberries == 0)
    {
       sprint (self, "You have no strawberries! Go and buy some more fool!\n");
       return;
    }
User avatar
MDave
 
Posts: 76
Joined: Mon Dec 17, 2007 7:08 pm

Postby Stealth Kill » Fri Jun 20, 2008 10:01 pm

loooool

Thank you :D
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest