AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Voice chat control (https://forums.alliedmods.net/showthread.php?t=171951)

Elusive138 11-13-2011 02:15

Voice chat control
 
I have the following code (yes, this is for a jailbreak mod), based on something Exolent posted:

PHP Code:

// Thanks Exolent > https://forums.alliedmods.net/showpost.php?p=760466&postcount=2
#pragma semicolon 1
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

public plugin_init() {
    
register_plugin("Voice Control""1.0D""Elusive");
    
    
register_forward(FM_Voice_SetClientListening"FwdSetClientListening");
}

public 
FwdSetClientListening(receiversenderbool:listen) {
    if (!
is_user_connected(receiver) || !is_user_connected(sender))
        return 
FMRES_IGNORED;
    
    if (!
is_user_admin(sender) && (!is_user_alive(sender) || cs_get_user_team(sender) != CS_TEAM_CT)) {
        
engfunc(EngFunc_SetClientListeningreceiversenderfalse);
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;


But for some reason it does not want to work. I wish to block everyone except admins and alive CTs from using voice chat, but everyone should be able to hear those selected groups. As it is, with a two player test neither of us could hear each other - he was a normal player in T, I was an admin in CT. Worse, he gets reliable channel overflows, possibly something to do with SetClientListening being false when he spawns, on the map jail_sanctuary.

I have tried variations, especially one ending with
PHP Code:

        engfunc(EngFunc_SetClientListeningreceiversendertrue);
        return 
FMRES_SUPERCEDE

instead of
PHP Code:

        return FMRES_IGNORED

which seems to work but:
  • Why do I have to add that, when Exolent did not (see above for link)
  • There are still reliable channel overflows
Any help or explanations would be appreciated.

Thanks.

Elusive138 12-06-2011 06:58

Re: Voice chat control
 
Bump?

Elusive138 01-17-2012 03:30

Re: Voice chat control
 
Bump - Anyone?

A plugin by shadow.hk, which uses the same general method (also from Exolent), did not work either.


All times are GMT -4. The time now is 08:26.

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