@ Connor:
Will supercede in pre block the victim from dying to?
Example:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "Ham_Killed_Pre", 0) // Player isn't death yet
RegisterHam(Ham_Killed, "player", "Ham_Killed_Post", 1) // Player is death
// Other stuff
}
public Ham_Killed_Pre(victim, attacker, shouldgib) // Player isn't death, block it
return HAM_SUPERCEDE // Blocks stuff from happening
public Ham_Killed_Post(victim, attacker, shouldgib) // Player is death, respawn him
ExecuteHamb(Ham_CS_RoundRespawn, victim) // Respawns the victim
if you want a bigger delay use set_task like this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "Ham_Killed_Pre", 0) // Player isn't death yet
RegisterHam(Ham_Killed, "player", "Ham_Killed_Post", 1) // Player is death
// Other stuff
}
public Ham_Killed_Pre(victim, attacker, shouldgib) // Player isn't death, block it
return HAM_SUPERCEDE
public Ham_Killed_Post(victim, attacker, shouldgib) // Player is death, respawn him
set_task(5.0, "respawn", victim)
public respawn(id)
ExecuteHamB(Ham_CS_RoundRespawn, id)
__________________