public ShowHUD(taskid)
{
static id, color[3];
id = ID_SHOWHUD;
if (!zp_get_user_zombie(id)){
color[0] = 0;
color[1] = 255;
color[2] = 0;
} else if(zp_get_user_zombie(id)){
color[0] = 255;
color[1] = 0;
color[2] = 0;
} else if(get_user_team(id) == 3){
color[0] = 255;
color[1] = 255;
color[2] = 255;
}
set_hudmessage(color[0], color[1], color[2], 0.44, 0.09, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD,"^n^n[ Level: %d | EXP: %d / %d ]^n^n^n",g_level[id], level_exp[id], g_level_exp[id])
}
/ Niestety hud pozostaje zielony lub czerwony w zależności, kim jesteśmy w danej rundzie - Ludzie, czy też Zombi. Ponadto nie pokazuje informacji levela oraz expa gracza, tylko Nasz własny.
Możesz spróbować dalej to zrobić po swojemu, bo ja przez czas odkąd udostępniłem, to próbowałem sam zrobić i jakimś cudem udało mi się zrobić po swojemu tak:
public ShowHUD(taskid)
{
static id
id = ID_SHOWHUD;
// Player died?
if (!is_user_alive(id))
{
// Get spectating target
id = pev(id, PEV_SPEC_TARGET)
// Target not alive
if (!is_user_alive(id)) return;
}
if (!zp_get_user_zombie(id))
{
set_hudmessage(0, 255, 0, 0.44, 0.09, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD,"^n^n[ Level: %d | EXP: %d / %d ]^n^n^n",g_level[id], level_exp[id], g_level_exp[id])
}
if (id != ID_SHOWHUD)
{
set_hudmessage(255, 255, 255, 0.44, 0.09, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD,"^n^n[ Level: %d | EXP: %d / %d ]^n^n^n",g_level[id], level_exp[id], g_level_exp[id])
}
else
if(zp_get_user_zombie(id))
{
set_hudmessage(255, 0, 0, 0.44, 0.09, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD,"^n^n[ Level: %d | EXP: %d / %d ]^n^n^n",g_level[id], level_exp[id], g_level_exp[id])
}
if (id != ID_SHOWHUD)
{
set_hudmessage(255, 255, 255, 0.44, 0.09, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD,"^n^n[ Level: %d | EXP: %d / %d ]^n^n^n",g_level[id], level_exp[id], g_level_exp[id])
}
}
I o dziwo działa tak jak chce, jednakże jeśli masz chęci, to możesz spróbować zrobić inaczej, chętnie dodam Twoje rozwiązanie i postawię łapkę za dobrze wykonaną robotę 