Kod:
// Show HUD Task
public ShowHUD(taskid)
{
static id
id = ID_SHOWHUD;
// 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], red, green, blue
if (g_zombie[id]) // zombies
{
red = 200
green = 250
blue = 0
if (g_nemesis[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_NEMESIS")
else if (g_assassin[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_ASSASSIN")
else
copy(class, charsmax(class), g_zombie_classname[id])
}
else // humans
{
red = 0
green = 200
blue = 255
if (g_survivor[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SURVIVOR")
else if (g_sniper[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SNIPER")
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_hudmessage(255, 255, 255, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L %s^nHP: %d - AP: %d - %L %s - %L %d^nLevel: %i | XP: %i / %i", ID_SHOWHUD, "SPECTATING", g_playername[id], pev(id, pev_health), get_user_armor(id), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id], get_user_level(id), get_user_xp(id), get_user_max_level(id))
}
else
{
new szHP[ 32 ], szAP[ 32 ], szArmor[ 32 ], szXP [ 32 ], szMAXLEVEL [ 32 ]
AddCommas(pev(ID_SHOWHUD, pev_health), szHP, charsmax(szHP))
AddCommas(g_ammopacks[ID_SHOWHUD], szAP, charsmax(szAP))
AddCommas(pev(ID_SHOWHUD, pev_armorvalue), szArmor, charsmax(szArmor))
AddCommas(get_user_xp(ID_SHOWHUD), szXP, charsmax(szXP))
AddCommas(get_user_max_level(ID_SHOWHUD), szMAXLEVEL, charsmax(szMAXLEVEL))
// Show health, class and ammo packs
set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "=>>Nick: %s^n=>>%L: %s^n=>>Armor: %s^n=>>%L %s^n=>>%L %s^n=>>Level: %i / 100^n=>>XP: %i / %i", g_playername[id], id, "ZOMBIE_ATTRIB1", szHP, szArmor, ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", szAP, get_user_level(ID_SHOWHUD), szXP, szMAXLEVEL)
//ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "=>>Nick: %s^n=>>%L: %d^n=>>Armor: %d^n=>>%L %s^n=>>%L %d^n=>>Level: %i / 100^n=>>XP: %i / %i^n=>>XP(-): %i", g_playername[id], id, "ZOMBIE_ATTRIB1", szHP, szArmor, ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", szAP, get_user_level(ID_SHOWHUD), get_user_xp(ID_SHOWHUD), get_user_max_level(ID_SHOWHUD), needed_next_lvl_xp(ID_SHOWHUD))
}
}
sorun çözülmüştür, sorun veriyi string değilde integer olarak göstertmemmiş