I used to use switch statement too, but same result
PHP Code:
public StartRespawnCheck(id)
{
id -= TASKID
if(is_user_connected(id))
{
if(!is_user_alive(id) && !is_user_bot(id))
{
if(is_in_a_team(id))
{
/*switch( cs_get_user_team(id) )
{
case CS_TEAM_T, CS_TEAM_CT :
{*/
ExecuteHamB(Ham_CS_RoundRespawn, id);
return;
}
set_task(get_pcvar_float(pCvarRespawnDelayOnServerJoin), "StartRespawnCheck", id + TASKID)
} else return;
}
}
stock is_in_a_team(id)
{
if(cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T)
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
//public PlayerKilledPost(victim, attacker, shouldgib)
public OnCBasePlayer_Killed_Post(id)
{
if(!is_user_connected(id))
return;
if(is_user_alive(id))
return;
if(task_exists(id + TASKID))
remove_task(id + TASKID)
set_task(get_pcvar_float(pCvarRespawnDelayOnDeath), "StartRespawnCheck", id + TASKID)
}
Same goes for playerkilledpost, nothing changed, and also ExecuteHam instead of HamB.
__________________