I have problem on my server.
Problem is here:
Code:
// Last human
if (g_zombie[id] && fnGetHumans() == 1)
{
client_cmd(id, "say /zmenu")
}
if (g_isalive[id] && !g_zombie[id] && !g_survivor[id] && fnGetHumans() == 1)
{
if(fnGetZombies() == 0)
{
return;
}
if (!g_lasthuman[id])
{
lasthumanto(id)
set_task(0.2, "lasthumanhud")
client_cmd( 0, "mp3 play %s", mp3_last_human );
// Last human forward
ExecuteForward(g_fwUserLastHuman, g_fwDummyResult, id);
// Reward extra hp
}
g_lasthuman[id] = true
}
else
g_lasthuman[id] = false
}
}
public lasthumanto(id)
{
zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
fm_set_user_health(id, pev(id, pev_health) + get_pcvar_num(cvar_humanlasthp))
set_user_armor(id, get_user_armor(id) +50)
set_hudmessage( 10, 105, 200, -1.0, 0.15, 1, 0.02, 5.0, 0.01, 0.1, 2);
new name[32]
get_user_name(id, name, 31)
ShowSyncHudMsg(0, g_iHudChannel[HUDID_OSTATNI], "%s is lasthuman !", name)
}
All Code at the end (function lasthumanto(id)) have bug. If begin a new round, so display this hud message to all players and chat message + armor & health to random player (every round). Why? This hud message must work only if lasthuman, not at roundstart. How i fix this bug?