- string ammoitems = "batteries";
- switch (wep.ammo_type)
- {
- case RES_SHELLS: ammoitems = ITEM_Shells.m_name; break;
- case RES_BULLETS: ammoitems = ITEM_Bullets.m_name; break;
- case RES_ROCKETS: ammoitems = ITEM_Rockets.m_name; break;
- case RES_CELLS: ammoitems = ITEM_Cells.m_name; break;
- case RES_PLASMA: ammoitems = ITEM_Plasma.m_name; break;
- case RES_FUEL: ammoitems = ITEM_JetpackFuel.m_name; break;
- }
- return ammoitems;
+ float myhealth = floor(GetResource(this, RES_HEALTH));
+ if(myhealth == -666)
+ return "spectating";
+ else if(myhealth == -2342 || (myhealth == 2342 && mapvote_initialized))
+ return "observing";
+ else if(myhealth <= 0 || IS_DEAD(this))
+ return "dead";
+ return ftos(myhealth);
+}
+
+string WeaponNameFromWeaponentity(entity this, .entity weaponentity)
+{
+ entity wepent = this.(weaponentity);
+ if(!wepent)
+ return "none";
+ else if(wepent.m_weapon != WEP_Null)
+ return wepent.m_weapon.m_name;
+ else if(wepent.m_switchweapon != WEP_Null)
+ return wepent.m_switchweapon.m_name;
+ return "none"; //Weapons_from(wepent.cnt).m_name;