hi,
idk why my user will not be respawned and will be kicked because of channel overflowe.
PHP Code:
RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage");
public hook_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(idattacker == 0 || is_user_connected(idattacker))
{
return HAM_SUPERCEDE;
}
else
{
if(checkAutoRespawn(this, damage))
{
return HAM_SUPERCEDE;
}
}
}
stock checkAutoRespawn(this, Float:damage)
{
if(get_pcvar_num(sv_autorespawn))
{
health[this] -= damage;
if(health[this] < 1.0)
{
set_pev(this, pev_health, 0.0);
set_pev(this, pev_deadflag, DEAD_RESPAWNABLE);
dllfunc(DLLFunc_Spawn, this);
return 1;
}
}
return 0;
}
__________________