Raised This Month: $89 Target: $400
 22% 

[L4D2] I want to clear the [cvar] message in the server chat window.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
login101
Member
Join Date: Sep 2017
Old 07-22-2019 , 15:49   [L4D2] I want to clear the [cvar] message in the server chat window.
Reply With Quote #1

Suppresses ConVars from printing to clients when they change.


I used the plugin,
A message is displayed.


Is there any other way? ㅠ

Last edited by login101; 07-22-2019 at 16:09.
login101 is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 07-22-2019 , 21:30   Re: [L4D2] I want to clear the [cvar] message in the server chat window.
Reply With Quote #2

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "Quiet ConVar Changer",
    
description "Quietly change a ConVar's value.",
    
author "Psyk0tik (Crasher_3637)",
    
version "1.0",
    
url "http://forums.alliedmods.net/"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_qcvar"Command_QuietCvarADMFLAG_CONVARS"sm_qcvar <ConVar> <Value> - Quietly change a ConVar's value");
}

public 
Action Command_QuietCvar(int clientint args)
{
    if (
args || args 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_qcvar <ConVar> <Value> - Quietly change a ConVar's value");
        return 
Plugin_Handled;
    }

    
char sConVar[64];
    
GetCmdArg(1sConVarsizeof(sConVar));
    
ConVar cvSetting FindConVar(sConVar);
    if (
cvSetting != null)
    {
        switch (
args)
        {
            case 
1:
            {
                
char sValue[64];
                
cvSetting.GetString(sValuesizeof(sValue));
                
ReplyToCommand(client"[SM] Value of cvar \"%s\": \"%s\""sConVarsValue);
            }
            case 
2:
            {
                
char sValue[64];
                
GetCmdArg(2sValuesizeof(sValue));
                
int iFlags cvSetting.Flags;
                if (
iFlags FCVAR_NOTIFY)
                {
                    
cvSetting.Flags iFlags & ~FCVAR_NOTIFY;
                    
cvSetting.SetString(sValue);
                    
cvSetting.Flags iFlags|FCVAR_NOTIFY;
                }
                else
                {
                    
cvSetting.SetString(sValue);
                }

                
//LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, sConVar, sValue);
            
}
        }

        
delete cvSetting;
        return 
Plugin_Handled;
    }

    
ReplyToCommand(client"[SM] Invalid ConVar: %s"sConVar);
    return 
Plugin_Handled;

I've had this plugin for awhile.

Instead of sm_cvar use sm_qcvar
__________________
AFK like JFK

Last edited by Crasher_3637; 07-22-2019 at 21:32.
Crasher_3637 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
Old 07-22-2019 , 23:38   Re: [L4D2] I want to clear the [cvar] message in the server chat window.
Reply With Quote #3

The sourcemod.cfg has stuff regarding that

Code:
// Specifies how admin activity should be relayed to users.  Add up the values
// below to get the functionality you want.
// 1: Show admin activity to non-admins anonymously.
// 2: If 1 is specified, admin names will be shown.
// 4: Show admin activity to admins anonymously.
// 8: If 4 is specified, admin names will be shown.
// 16: Always show admin names to root users.
// --
// Default: 13 (1+4+8)
sm_show_activity 16
I think using 16 will only show stuff to the root users "z" flag maybe
__________________

Last edited by Lux; 07-22-2019 at 23:38.
Lux is offline
login101
Member
Join Date: Sep 2017
Old 07-22-2019 , 23:51   Re: [L4D2] I want to clear the [cvar] message in the server chat window.
Reply With Quote #4

Quote:
Originally Posted by Crasher_3637 View Post
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "Quiet ConVar Changer",
    
description "Quietly change a ConVar's value.",
    
author "Psyk0tik (Crasher_3637)",
    
version "1.0",
    
url "http://forums.alliedmods.net/"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_qcvar"Command_QuietCvarADMFLAG_CONVARS"sm_qcvar <ConVar> <Value> - Quietly change a ConVar's value");
}

public 
Action Command_QuietCvar(int clientint args)
{
    if (
args || args 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_qcvar <ConVar> <Value> - Quietly change a ConVar's value");
        return 
Plugin_Handled;
    }

    
char sConVar[64];
    
GetCmdArg(1sConVarsizeof(sConVar));
    
ConVar cvSetting FindConVar(sConVar);
    if (
cvSetting != null)
    {
        switch (
args)
        {
            case 
1:
            {
                
char sValue[64];
                
cvSetting.GetString(sValuesizeof(sValue));
                
ReplyToCommand(client"[SM] Value of cvar \"%s\": \"%s\""sConVarsValue);
            }
            case 
2:
            {
                
char sValue[64];
                
GetCmdArg(2sValuesizeof(sValue));
                
int iFlags cvSetting.Flags;
                if (
iFlags FCVAR_NOTIFY)
                {
                    
cvSetting.Flags iFlags & ~FCVAR_NOTIFY;
                    
cvSetting.SetString(sValue);
                    
cvSetting.Flags iFlags|FCVAR_NOTIFY;
                }
                else
                {
                    
cvSetting.SetString(sValue);
                }

                
//LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, sConVar, sValue);
            
}
        }

        
delete cvSetting;
        return 
Plugin_Handled;
    }

    
ReplyToCommand(client"[SM] Invalid ConVar: %s"sConVar);
    return 
Plugin_Handled;

I've had this plugin for awhile.

Instead of sm_cvar use sm_qcvar

I'll try it later. Thank you very much for giving me the answer. Thanks to you guys, l4d2 has fun.
login101 is offline
login101
Member
Join Date: Sep 2017
Old 07-23-2019 , 00:29   Re: [L4D2] I want to clear the [cvar] message in the server chat window.
Reply With Quote #5

Quote:
Originally Posted by Lux View Post
The sourcemod.cfg has stuff regarding that

Code:
// Specifies how admin activity should be relayed to users.  Add up the values
// below to get the functionality you want.
// 1: Show admin activity to non-admins anonymously.
// 2: If 1 is specified, admin names will be shown.
// 4: Show admin activity to admins anonymously.
// 8: If 4 is specified, admin names will be shown.
// 16: Always show admin names to root users.
// --
// Default: 13 (1+4+8)
sm_show_activity 16
I think using 16 will only show stuff to the root users "z" flag maybe


I'll try it in the evening.
login101 is offline
Reply


Thread Tools
Display Modes

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:03.


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