Raised This Month: $51 Target: $400
 12% 

[ANY] Voice Amount Anti-lag [Updated 10-May-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
snoopy174
Member
Join Date: May 2016
Old 10-13-2018 , 14:01   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #71

Quote:
Originally Posted by Divin12 View Post
Tested on cs:go server:
Now is based on teams, If sm_voiceamount_number "3" max 3 people can speak at Terrorist Team, max 3 people can speak at Counter-Terrorist Team and max 3 people can speak at Spec + small update (compilation problems: public bool:OnClientSpeakingEx --> public int OnClientSpeakingEx)
If appear errors please post here.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <voiceannounce_ex>
#include <basecomm>
#include <cstrike>



new Handle:cvar_amount INVALID_HANDLE;
new 
Handle:cvar_mute INVALID_HANDLE;
new 
Handle:cvar_version INVALID_HANDLE;

new 
Max_Amount;

new 
Handle:g_CVarAdmFlag;
new 
g_AdmFlag;
new 
Float:muteado;

public 
Plugin:myinfo =
{
    
name "SM Voice Amount",
    
author "Franc1sco steam: franug Edited by DiviN",
    
description "Prevents lag when everyone talks at once",
    
version "v1.4.1",
    
url "http://servers-cfg.foroactivo.com/"
};

public 
OnPluginStart()
{
    
LoadTranslations("voiceamount.phrases");


    
g_CVarAdmFlag CreateConVar("sm_voiceamount_adminflag""0""Admin flag required to have inmunity. 0 = feature disable. Can use a b c ....");

    
cvar_amount CreateConVar("sm_voiceamount_number""2""Number of people who can talk at the same time");

    
cvar_mute CreateConVar("sm_voiceamount_mutetime""1.0""Time for the temporal mute (1.0 = 1 second)");

    
cvar_version CreateConVar("sm_voiceamount_version""v1.4.1"_FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);

    
// Hooking cvar change
    
HookConVarChange(cvar_amountOnCVarChange);
    
HookConVarChange(cvar_versionOnCVarChange);
    
HookConVarChange(g_CVarAdmFlagOnCVarChange2);
    
HookConVarChange(cvar_muteOnCVarChange);
}

public 
OnCVarChange2(Handle:convar_hndl, const String:oldValue[], const String:newValue[])
{
    
g_AdmFlag ReadFlagString(newValue);
}

public 
OnCVarChange(Handle:convar_hndl, const String:oldValue[], const String:newValue[])
{
    
GetCVars();
}

public 
OnConfigsExecuted()
{
    
GetCVars();
}

public 
int OnClientSpeakingEx(client)
{    
        if( !(
BaseComm_IsClientMuted(client)) )
        {
            new 
speaking 0;
            new 
speakingct 0;
            new 
speakingspec 0;
            for (new 
1<= MaxClientsi++)
                if (
IsClientInGame(i) && !IsFakeClient(i) && IsClientSpeaking(i) && !BaseComm_IsClientMuted(i))
                    if(
GetClientTeam(i) == CS_TEAM_T){
                        ++
speaking;
                    }
                    else
                    if(
GetClientTeam(i) == CS_TEAM_CT){
                        ++
speakingct;
                    }
                    else
                    if(
GetClientTeam(i) == CS_TEAM_SPECTATOR){
                        ++
speakingspec;
                    }

            if ((
GetClientTeam(client) == CS_TEAM_T)&&(speaking Max_Amount))
            {    
                
BaseComm_SetClientMute(clienttrue);
                
CreateTimer(muteadodesmuteclient);
                
PrintHintText(client"%t""voice blocked");
            }
            if((
GetClientTeam(client) == CS_TEAM_CT)&&(speakingct Max_Amount))
            {
                
BaseComm_SetClientMute(clienttrue);
                
CreateTimer(muteadodesmuteclient);
                
PrintHintText(client"%t""voice blocked");
            }
            if ((
GetClientTeam(client) == CS_TEAM_SPECTATOR)&&(speakingspec Max_Amount))
            {
                
BaseComm_SetClientMute(clienttrue);
                
CreateTimer(muteadodesmuteclient);
                
PrintHintText(client"%t""voice blocked");
            }
        }
}

public 
Action:desmute(Handle:timerany:client)
{
    if (
IsClientInGame(client) && !IsFakeClient(client) &&    BaseComm_IsClientMuted(client))
        
BaseComm_SetClientMute(clientfalse);
}

// Get new values of cvars if they has being changed
public GetCVars()
{
    
Max_Amount GetConVarInt(cvar_amount);
    
ResetConVar(cvar_version);
    
muteado GetConVarFloat(cvar_mute);



can't compile

https://pp.userapi.com/c850628/v8506...IlnrcdWkZA.jpg
snoopy174 is offline
Send a message via Skype™ to snoopy174
wolvez04
Senior Member
Join Date: Feb 2016
Location: Andora
Old 12-09-2019 , 03:22   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #72

This plugin has bugs and is perm muting by BaseComm natives
__________________
Hiring developers of all sorts for small or big jobs.
Paying nicely. Just PM for any available jobs.

wolvez04 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-09-2019 , 05:41   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #73

Quote:
Originally Posted by wolvez04 View Post
This plugin has bugs and is perm muting by BaseComm natives
What bugs?
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
wolvez04
Senior Member
Join Date: Feb 2016
Location: Andora
Old 12-09-2019 , 13:47   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #74

Quote:
Originally Posted by Franc1sco View Post
What bugs?
It's muting players permanently instead of 1 second like its supposed to.
__________________
Hiring developers of all sorts for small or big jobs.
Paying nicely. Just PM for any available jobs.

wolvez04 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-09-2019 , 17:25   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #75

Quote:
Originally Posted by wolvez04 View Post
It's muting players permanently instead of 1 second like its supposed to.
Are you using some different basecomms plugin? sm plugins list?
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
wolvez04
Senior Member
Join Date: Feb 2016
Location: Andora
Old 12-14-2019 , 21:44   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #76

Quote:
Originally Posted by Franc1sco View Post
Are you using some different basecomms plugin? sm plugins list?
"Basic Comm Control" (1.10.0.6455) by AlliedModders LLC
__________________
Hiring developers of all sorts for small or big jobs.
Paying nicely. Just PM for any available jobs.

wolvez04 is offline
September
Senior Member
Join Date: Jul 2015
Location: Russian Federation
Old 01-05-2020 , 09:04   Re: [ANY] Voice Amount Anti-lag
Reply With Quote #77

Guys, I can't find the plugin, it used to be on this forum.
When the admin speaks in voice chat, the other players could not speak, that is, they fell silent for a while while the admin speaks. Help me find the plugin.
September is offline
Send a message via Skype™ to September
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 05-09-2020 , 20:43   Re: [ANY] Voice Amount Anti-lag [Updated 10-May-2020]
Reply With Quote #78

Version 1.5

-Updated syntax (Thanks to @alejandrosc)
-Removed spam on sourcebans when this plugin is running.
-Improved logic and code.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:17.


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