|
public fm_voice_forward(receiver, sender, listen)
{
if(receiver==sender) return FMRES_IGNORED;
new alltalk=get_cvar_num("sv_alltalk");
if(alltalk) return FMRES_IGNORED;
if(!is_user_connected(receiver) || !is_user_connected(sender)) return FMRES_IGNORED;
if(g_player_muted[sender] && get_user_flags(sender)&ADMIN_IMMUNITY==0) //如果此人被禁止讲话
{
engfunc(EngFunc_SetClientListening, receiver, sender, 0);
return FMRES_SUPERCEDE;
}
new CsTeams:rt=cs_get_user_team(receiver);
new CsTeams:st=cs_get_user_team(sender);
if(rt==st || rt==CS_TEAM_UNASSIGNED || rt==CS_TEAM_SPECTATOR)
//观察员可以听到所有人的讲话,如果想观察员只能听到观察员的讲话,则将上句改为:if(rt==st)
engfunc(EngFunc_SetClientListening, receiver, sender, 1);
else
engfunc(EngFunc_SetClientListening, receiver, sender, 0);
|
|