How can I prevent a player from spawning in The Specialists dm ?
I tried:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#define BEEP "misc/beep2.wav"
public plugin_precache()
{
precache_sound(BEEP)
register_forward (FM_PlayerPreThink, "fn_hookprethink")
return PLUGIN_HANDLED
}
public plugin_init() {
register_plugin("Block Spawn Test", "1", "...")
register_concmd("tog_atk", "toggle_attack")
}
new bool:allow_spawn = true;
public toggle_attack(id,level,cid)
{
allow_spawn = !allow_spawn
emit_sound(id,0,BEEP,1.0,ATTN_NORM,0,PITCH_NORM)
return PLUGIN_HANDLED
}
public fn_hookprethink(id)
{
if(!is_user_alive(id) && !allow_spawn && (get_user_button (id) & IN_ATTACK))
{
entity_set_int (id,EV_INT_button,get_user_button (id) & ~IN_ATTACK)
client_print(id,print_chat,"You may not spawn.")
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
The toggle function works, and right after death, if I +attack I get the "You may not spawn." message, but I can still respawn.
What should I do to block respawning in ts ?