I see. I did this:
PHP Code:
#include <superheromod>
public plugin_init()
{
register_plugin("Respawn", "1.0", "Jelle")
}
public sh_client_death(victim)
{
if ( is_user_connected(victim) )
{
//Make engine think the player is respawned:
set_pev(victim, pev_deadflag, DEAD_RESPAWNABLE)
set_pev(victim, pev_iuser1, 0)
dllfunc(DLLFunc_Think, victim)
//Move corpse out of map
engfunc(EngFunc_SetOrigin, victim, Float:{-4800.0, -4800.0, -4800.0})
//now spawn
set_task(0.5, "spawned", victim)
}
}
public spawned(victim)
{
//did he disconnect during those 0.5 seconds?
if ( is_user_connected(victim) )
{
ExecuteHam(Ham_CS_RoundRespawn, victim)
dllfunc(DLLFunc_Spawn, victim)
client_print(victim, print_chat, "You have been respawned!")
}
}
Not sure if it works thou. I can't test it before tomorrow.
__________________