#include <amxmodx>
#include <fakemeta>
new amx_deadtalk;
public plugin_init()
{
register_plugin("[CS] Dead Alltalk", "0.1", "Allied");
register_forward(FM_Voice_SetClientListening, "fwdSetVoice", false);
amx_deadtalk = register_cvar("amx_deadtalk", "1");
return PLUGIN_CONTINUE;
}
public fwdSetVoice(receiver, sender, bool:bListen)
{
if( !get_pcvar_num(amx_deadtalk) || receiver == sender || !is_user_connected(receiver) || !is_user_connected(sender) )
{
return FMRES_IGNORED;
}
if( !is_user_alive(receiver) && !is_user_alive(sender) && get_user_team(receiver) != get_user_team(sender) )
{
engfunc(EngFunc_SetClientListening, receiver, sender, 1);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}