Sursa:
Code: Select all
public ShowHUD(taskid)
{
static id
id = ID_SHOWHUD;
//new message[128]
// Player died?
if (!g_isalive[id])
{
// Get spectating target
id = pev(id, PEV_SPEC_TARGET)
// Target not alive
if (!g_isalive[id]) return;
}
// Format classname
static class[32]
if (g_zombie[id]) // zombies
{
if (g_nemesis[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_NEMESIS")
else
copy(class, charsmax(class), g_zombie_classname[id])
}
else // humans
{
if (g_survivor[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SURVIVOR")
else
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_HUMAN")
}
// Spectating someone else?
if (id != ID_SHOWHUD)
{
// Show name, health, class, and ammo packs
set_dhudmessage(255, 255, 255, HUD_SPECT_X, HUD_SPECT_Y, -0.78, 0.80, 0.1, 1.0, 1.0)
show_dhudmessage(ID_SHOWHUD, "..:: [Spectating %s]^n[Health: %i] [Class: %s] [Armor: %i]^n[Forum: %s] ::..", g_playername[id], pev(ID_SHOWHUD, pev_health), class, pev(ID_SHOWHUD, pev_armorvalue), FORUMNAME)
}
else
{
new color[3]
if(g_nemround)
{
color[0] = 255
color[1] = 0
color[2] = 0
}
else if(g_survround)
{
color[2] = 255
color[0] = 0
color[1] = 0
}
else if(g_plagueround)
{
color[0] = 199
color[1] = 21
color[2] = 133
}
else
{
color[0] = 0
color[1] = 255
color[2] = 0
}
set_dhudmessage(color[0], color[1], color[2], -1.0, 0.85, 0.1, 1.0, 1.0)
show_dhudmessage(ID_SHOWHUD, "..:: [Health: %i] [Class: %s] [Armor: %i] ::..^n[ Forum: %s ]", pev(ID_SHOWHUD, pev_health), class, pev(ID_SHOWHUD, pev_armorvalue), FORUMNAME)
}
}