-kllr2001-
Veteran X
I want an AmmoHUD for PRESTO, thats exactly like the one that is included in VikingPack...
//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();
-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?
// 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"
·liquid· said:getItemType(%itemName);
%weapon = getMountedItem(0);
PuwWuw said:are those weapons scripted?
Originally posted by PuwWuw
you need to add table data to the ammo script for lookup purposes.