AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   How to set talk when he dead ? (https://forums.alliedmods.net/showthread.php?t=231789)

wangningyu 12-20-2013 11:22

How to set talk when he dead ?
 
I found the sdk , there is fours option:
#define SPEAK_NORMAL 0
this is only talk when there alive , if team player death ,the dead player just listen without talk with team.

#define SPEAK_MUTED 1
this like shutup , he can't listen and talk with anybody.

#define SPEAK_ALL 2
this like sv_alltalk 1, it can say and listen with all player(T and CT)

#define SPEAK_LISTENALL 4
this just listen all player(T and CT)


I want just team talk each other when dead or alive , and the same team.

register_event("DeathMsg","death","a")
register_event("ResetHUD","alive","b")

public death()
{
// ....
}

public alive(id)
{
// ....
}

Is anybody can help me please.

Thanks for your reply !

Don_Collione 12-22-2013 22:13

Re: How to set talk when he dead ?
 
Try

PHP Code:

#include <amxmodx>
#include <fakemeta>

new amx_deadtalk;

public 
plugin_init()
{
    
register_plugin("Dead Alltalk""0.1""Exolent");
    
    
register_forward(FM_Voice_SetClientListening"fwdSetVoice"0);
    
    
amx_deadtalk register_cvar("amx_deadtalk""1"00.0);
    
    return 
PLUGIN_CONTINUE;
}

public 
fwdSetVoice(receiversenderbool: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_SetClientListeningreceiversender1);
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;




All times are GMT -4. The time now is 20:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.