How can I respawn a player 1 second after death?
PHP Code:
public death() {
new attacker = read_data(1);
new victim = read_data(2);
new headshot = read_data(3)
new weapon[11]
read_data(4, weapon, 11)
if(equal(weapon, "grenade"))
return PLUGIN_CONTINUE
if(attacker == victim)
return PLUGIN_CONTINUE
if(headshot)
return PLUGIN_CONTINUE
new origin[3]
get_user_origin(victim, origin, 0) //remember the position
if(random_num(1,10) == 2) { //10% chance
set_task(0.9, "lstchn", victim, origin, 3)
}
return PLUGIN_CONTINUE
}
public lstchn(victim, origin[3]) {
spawn(victim)
}
The code above gives me the error: [FUN] Entity out of range (4804).
Tried ExecuteHamB(Ham_CS_RoundRespawn,victim), same error.
Also tried
http://forums.alliedmods.net/showpos...4&postcount=19 and I get another error: [FAKEMETA] Invalid entity