[T1 Request] AmmoHUD

yeah here it is I guess..I dunno didn't really test it just kinda stuck it together..should work tho
Code:
//AMMO HUD by HotCheese

function AmmoHUD::Update()
{       %weapon = getMountedItem(0);
	if (%weapon == 21)
		HUD::AddTextLine("AmmoHUD","<F2>" @ getItemCount("Disc"));
	//if it's a cg we gotta make it update faster to keep up with the rate of fire
	else if (%weapon == 13) {
                HUD::AddTextLine("AmmoHUD","<F2>" @ getItemCount("Bullet"));
                return ".1";
        }
	else if (%weapon == 17)
		HUD::AddTextLine("AmmoHUD","<F2>" @ getItemCount("Grenade Ammo"));
	else if (%weapon == 19)
		HUD::AddTextLine("AmmoHUD","<F2>" @ getItemCount("Mortar Ammo"));
	else if (%weapon == 15)
		HUD::AddTextLine("AmmoHUD","<F2>" @ getItemCount("Plasma Bolt"));
	else
                HUD::AddTextLine("AmmoHUD","<f2>~");
        return 1;
}

function AmmoHUD::Create() {
        HUD::New("AmmoHUD","AmmoHUD::Update","50%-32 50%-32 24 16");
        HUD::Display("AmmoHUD");
}
AmmoHUD::Create();
 
Last edited:
Hotcheese, how do you know the weapons number?
for instance

Disc = if (%weapon == 21)

How would I go about finding the number for each gun?
 
-kllr2001- said:
Hotcheese, how do you know the weapons number?
for instance

Disc = if (%weapon == 21)

How would I go about finding the number for each gun?

Code:
// Armors
// 2 = "Light Armor"
// 3 = "Medium Armor"
// 4 = "Heavy Armor"
//
// Weapons
// 11, "Blaster"
// 13, "Chaingun"
// 15, "Plasma Gun"
// 17, "Grenade Launcher" 
// 19, "Mortar" 
// 21, "Disc Launcher" 
// 22, "Laser Rifle" 
// 24, "ELF Gun" 
//
// Ammo
// 14, "Plasma Bolt" 
// 16, "Grenade Ammo" 
// 18, "Mortar Ammo" 
// 20, "Disc" 
// 12, "Bullet" 
//
// Backpacks
// 27, "Inventory Station" 
// 28, "Ammo Station" 
// 29, "Energy Pack" 
// 30, "Repair Pack" 
// 31, "Shield Pack" 
// 32, "Sensor Jammer Pack" 
// 33, "Motion Sensor" 
// 34, "Ammo Pack" 
// 35, "Pulse Sensor" 
// 36, "Sensor Jammer" 
// 37, "Camera" 
// 38, "Turret" 
//
// Misc
// 39, "Repair Kit" 
// 40, "Mine" 
// 41, "Grenade" 
// 23, "Targeting Laser" 
// 42, "Beacon" 
//
// Vehicles
// 5, "Scout" 
// 6, "LPC" 
// 7, "HPC"
 
ok now i got a new problem...

I was adding different guns to the ammo hud, and I got most of them to work, except for guns that look like this...

shotgun.jpg



and


hyperdisc.jpg



I added all the correct information for both guns, but it still isnt showing, I think it has something to do with this bit of code, thats not making the above 2 guns work...

Code:
%weapon = getMountedItem(0);


Help anyone?
 
Back
Top