PDA

View Full Version : Ammo and HUD's


aspie
8th Nov 2001, 02:04 AM
Can someone please explain the code that draws the ammo ammounts on the screen. Well actually i know how to draw it to the screen, i need to know how to obtain it.

I only have 5 weapons presumably in slots 1-5.

Thanks in advance!

ca
9th Nov 2001, 03:07 AM
To get the ammo count of a player's current weapon ammo count just look ref something like this:

Player.Weapon.AmmoType.AmmoAmmount

To find the ammo for a specific weapon in a Player's inventory you would have to do something like this:

local MyWeapon weap;

weap = MyWeapon(Player.FindInventoryType(class'MyWeapon'));
if (weap != None)
{
// deal with ammo ammount here
//weap.AmmoType.AmmoAmount
}

Does that help?

aspie
9th Nov 2001, 05:21 AM
Works great. Thanks for the help.