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

What do I delete from this blob of sourcepawn to get rid of the announcement in chat?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ClassicHopper
Junior Member
Join Date: Jul 2017
Old 12-15-2017 , 22:32   What do I delete from this blob of sourcepawn to get rid of the announcement in chat?
Reply With Quote #1

Trying to get rid of "[SM] Console: Changed cvar "sv_cheats" to "0"" for example.
Huge blob of code below, skip past for a part of which I assume is more accurate.
Code:
public Action:Command_Cvar(client, args)
{
	if (args < 1)
	{
		if (client)
		{
			ReplyToCommand(client, "[SM] Usage: sm_cvar  [value]");
		}
		else
		{
			ReplyToCommand(client, "[SM] Usage: sm_cvar  [value]");
		}
		return Action:3;
	}
	new String:cvarname[64];
	GetCmdArg(1, cvarname, 64);
	new var1;
	if (client && .2920.StrEqual(cvarname, "protect", true))
	{
		if (args < 2)
		{
			ReplyToCommand(client, "[SM] Usage: sm_cvar  ");
			return Action:3;
		}
		GetCmdArg(2, cvarname, 64);
		.17740.ProtectVar(cvarname);
		ReplyToCommand(client, "[SM] %t", "Cvar is now protected", cvarname);
		return Action:3;
	}
	new ConVar:hndl = FindConVar(cvarname);
	if (hndl)
	{
		if (!.17872.IsClientAllowedToChangeCvar(client, cvarname))
		{
			ReplyToCommand(client, "[SM] %t", "No access to cvar");
			return Action:3;
		}
		new String:value[256];
		if (args < 2)
		{
			ConVar.GetString(hndl, value, 255);
			ReplyToCommand(client, "[SM] %t", "Value of cvar", cvarname, value);
			return Action:3;
		}
		GetCmdArg(2, value, 255);
		new var2;
		if (.2920.StrEqual(cvarname, "servercfgfile", false) || .2920.StrEqual(cvarname, "lservercfgfile", false))
		{
			new pos = StrContains(value, ";", true);
			if (pos != -1)
			{
				value[pos] = MissingTAG:0;
			}
		}
		if (ConVar.Flags.get(hndl) & 32 != 32)
		{
			ShowActivity2(client, "[SM] ", "%t", "Cvar changed", cvarname, value);
		}
		else
		{
			ReplyToCommand(client, "[SM] %t", "Cvar changed", cvarname, value);
		}
		LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, cvarname, value);
		ConVar.SetString(hndl, value, true, false);
		return Action:3;
	}
	ReplyToCommand(client, "[SM] %t", "Unable to find cvar", cvarname);
	return Action:3;
}
where I'm focusing
Code:
		if (ConVar.Flags.get(hndl) & 32 != 32)
		{
			ShowActivity2(client, "[SM] ", "%t", "Cvar changed", cvarname, value);
		}
		else
		{
			ReplyToCommand(client, "[SM] %t", "Cvar changed", cvarname, value);
		}
		LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, cvarname, value);
		ConVar.SetString(hndl, value, true, false);
		return Action:3;
	}
	ReplyToCommand(client, "[SM] %t", "Unable to find cvar", cvarname);
	return Action:3;
}
Do I only remove \/?
Code:
LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, cvarname, value);
ClassicHopper is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-15-2017 , 23:02   Re: What do I delete from this blob of sourcepawn to get rid of the announcement in c
Reply With Quote #2

...you do know that the basecommands source is shipped with SourceMod and you didn't have to decompile it to get said source code, right?

Edit:

Anyway, to answer the question, just modify cfg/sourcemod/sourcemod.cfg and change the sm_show_activity setting to control what you want players to see.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-15-2017 at 23:07. Reason: Removed extra word
Powerlord is offline
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 05:14.


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