Raised This Month: $75 Target: $400
 18% 

setinfo command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Billingsgate
New Member
Join Date: Jan 2025
Old 01-23-2025 , 23:32   setinfo command
Reply With Quote #1

Hello, please tell me how you can block the setinfo command? I try this way, but it doesn't work out:

Code:
#pragma semicolon 1
#pragma newdecls required

char
	sFile[PLATFORM_MAX_PATH];

public void OnPluginStart()
{
	BuildPath(Path_SM, sFile, sizeof(sFile), "logs/client_console.log");
}

public Action OnClientCommand(int client, int args)
{
	char cmd[16];
	GetCmdArg(0, cmd, sizeof(cmd));
	
	char argstr[128];
	GetCmdArgString(argstr, sizeof(argstr));
	
	if(argstr[0])
	{
			LogToFile(sFile, "-> [%s %s]", cmd, argstr);
			PrintToChatAll("-> [%s %s]", cmd, argstr);
	}
	else
	{
		LogToFile(sFile, "--> [%s]", cmd);
		PrintToChatAll("-> [%s]", cmd);
	}
	return Plugin_Continue;
}
__________________
...
Billingsgate is offline
Nullifidian
AlliedModders Donor
Join Date: Jan 2006
Old 01-24-2025 , 08:08   Re: setinfo command
Reply With Quote #2

Can't block it. If could, then it be something like this:

PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>

public Plugin myinfo = {
    
name "block_setinfo",
    
author "",
    
description "block setinfo",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart() {
    
RegConsoleCmd("setinfo"cmd_blockSetinfo);
}

public 
Action cmd_blockSetinfo(int clientint args) {
    
ReplyToCommand(client"You are not allowed to use this command!");
    return 
Plugin_Handled;

Nullifidian is offline
little_froy
Senior Member
Join Date: May 2021
Old 01-24-2025 , 09:53   Re: setinfo command
Reply With Quote #3

Quote:
Originally Posted by Nullifidian View Post
Can't block it. If could, then it be something like this:

PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>

public Plugin myinfo = {
    
name "block_setinfo",
    
author "",
    
description "block setinfo",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart() {
    
RegConsoleCmd("setinfo"cmd_blockSetinfo);
}

public 
Action cmd_blockSetinfo(int clientint args) {
    
ReplyToCommand(client"You are not allowed to use this command!");
    return 
Plugin_Handled;

"setinfo" is a client command, server side can not block it.
little_froy is offline
Nullifidian
AlliedModders Donor
Join Date: Jan 2006
Old 01-24-2025 , 10:08   Re: setinfo command
Reply With Quote #4

Quote:
Originally Posted by little_froy View Post
"setinfo" is a client command, server side can not block it.
Yes. Just showing him how he can do it in the future for some other command that maybe he wants to block.
Nullifidian 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 10:23.


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