return ret;
}
+string AmmoNameFromWeaponentity(entity wpn)
+{
+ string ammoitems = "batteries";
+ switch((wpn.m_weapon).ammo_field)
+ {
+ case ammo_shells: ammoitems = ITEM_Shells.m_name; break;
+ case ammo_nails: ammoitems = ITEM_Bullets.m_name; break;
+ case ammo_rockets: ammoitems = ITEM_Rockets.m_name; break;
+ case ammo_cells: ammoitems = ITEM_Cells.m_name; break;
+ case ammo_plasma: ammoitems = ITEM_Plasma.m_name; break;
+ case ammo_fuel: ammoitems = ITEM_JetpackFuel.m_name; break;
+ }
+ return ammoitems;
+}
+
string formatmessage(entity this, string msg)
{
float p, p1, p2;
entity cursor_ent;
string escape;
string replacement;
- string ammoitems;
p = 0;
n = 7;
- ammoitems = "batteries";
- switch((PS(this).m_weapon).ammo_field)
- {
- case ammo_shells: ammoitems = ITEM_Shells.m_name; break;
- case ammo_nails: ammoitems = ITEM_Bullets.m_name; break;
- case ammo_rockets: ammoitems = ITEM_Rockets.m_name; break;
- case ammo_cells: ammoitems = ITEM_Cells.m_name; break;
- case ammo_plasma: ammoitems = ITEM_Plasma.m_name; break;
- case ammo_fuel: ammoitems = ITEM_JetpackFuel.m_name; break;
- }
-
WarpZone_crosshair_trace(this);
cursor = trace_endpos;
cursor_ent = trace_ent;
case "y": replacement = NearestLocation(cursor); break;
case "d": replacement = NearestLocation(this.death_origin); break;
case "w": replacement = ((this.(weaponentity).m_weapon == WEP_Null) ? ((this.(weaponentity).m_switchweapon == WEP_Null) ? Weapons_from(this.(weaponentity).cnt) : this.(weaponentity).m_switchweapon) : this.(weaponentity).m_weapon).m_name; break;
- case "W": replacement = ammoitems; break;
+ case "W": replacement = AmmoNameFromWeaponentity(this.(weaponentity)); break;
case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break;
case "s": replacement = ftos(vlen(this.velocity - this.velocity_z * '0 0 1')); break;
case "S": replacement = ftos(vlen(this.velocity)); break;