I'm trying to get some kind of deathmatch effect going in a dod plugin I'm making. But whatever I try, players won't respawn while dead. Respawning while still alive works great, but once I'm dead using the standard spawn function doesn't work.
I've tried calling the spawn function twice using set_task. I've tried setting the deadflag to 3. I'm absolutely sure my respawning function is being called.
Here's the code I'm using atm:
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <dodx>
new PLUGIN[] = "respawn mod"
new VERSION[] = "1.00"
new AUTHOR[] = "Odd2k"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_respawn", "cmd_respawn", ADMIN_SLAY, "")
register_statsfwd(XMF_DEATH)
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
entity_set_int(id, EV_INT_deadflag, 3)
set_task(0.5, "cmd_respawn", victim)
set_task(0.7, "cmd_respawn", victim)
}
public cmd_respawn(id)
{
spawn(id)
}