I found this somewhere, maybe it is the solution to this problem
PHP Code:
public client_death(g_attacker, g_victim, wpnindex, hitplace, TK)
{
if (is_user_alive(g_victim) || !is_user_connected(g_victim) || !is_user_connected(g_attacker) || g_victim == g_attacker )
return PLUGIN_HANDLED;
remove_task(g_victim+TASK_IDLESOUND)
g_isAlive[g_victim] = false;
if (TK == 0 && g_attacker != g_victim && g_isZombie[g_attacker])
{
client_cmd(0, "spk %s", INFECTION)
new szPlayerName[32]
get_user_name(g_victim, szPlayerName, 31)
set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 5.0, 0.1, 0.2, 1)
show_hudmessage(0, "%L", LANG_SERVER, "INFECT_ANNOUNCE", szPlayerName);
}
set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1)
if (g_isZombie[g_victim])
{
show_hudmessage(g_victim, "%L", LANG_SERVER, "DEATH_ZOMBIE", g_iZombieTime);
set_task(float(g_iZombieTime), "Respawn_Player", g_victim+TASK_RESPAWN)
}
else if (g_iInfectTime)
{
show_hudmessage(g_victim, "%L", LANG_SERVER, "DEATH_HUMAN", g_iInfectTime);
cs_set_user_team(g_victim, CS_TEAM_T)
g_isZombie[g_victim] = true
set_task(float(g_iInfectTime), "Respawn_Player", g_victim+TASK_RESPAWN)
}
return PLUGIN_CONTINUE;
}
public Respawn_Player(id)
{
id-=TASK_RESPAWN
if (!g_isConnected[id] || g_isAlive[id])
return PLUGIN_HANDLED
if (((g_boolCanBuild || g_boolPrepTime) && cs_get_user_team(id) == CS_TEAM_CT) || cs_get_user_team(id) == CS_TEAM_T)
{
ExecuteHamB(Ham_CS_RoundRespawn, id)
//Loop the task until they have successfully spawned
if (!g_isAlive[id])
set_task(3.0,"Respawn_Player",id+TASK_RESPAWN)
}
return PLUGIN_HANDLED
}
__________________