View Single Post
Author Message
evans
Senior Member
Join Date: May 2021
Location: OnSmokeDetonate();
Old 07-07-2021 , 15:51   restrict command to client in console
Reply With Quote #1

Hello guys,

is there someone who can help with this? I'm running public counter strike source server and want restrict console commands to clients from security reasons. For example if i want to deny meta list or sm plugins list commands to clients and echo some message like "This is unavailable" or something instead of output the list. I know it's possible cause i saw that on some servers. Is there any plugin for that or custom code is needed? I tried to write something but i'm missing sourcepawn knowledge how to write it into some plugin ((( . If anyone could help me with that you will be awesome. Thank you.

P.S. This is rough skeleton how i think it should look like... (maybe i'm wrong)

Code:
public void OnPluginStart()
{
	RegConsoleCmd("meta version", Command_Test);
	RegConsoleCmd("meta list", Command_Test);
	RegConsoleCmd("sm", Command_Test);
	RegConsoleCmd("sm plugins", Command_Test);
	RegConsoleCmd("sm plugins list", Command_Test);
	RegConsoleCmd("sm plugins 11", Command_Test);
	RegConsoleCmd("sm plugins 22", Command_Test);
	RegConsoleCmd("sm plugins 33", Command_Test);
}
 
public Action Command_Test(int client, int args)
{
    char arg[128];
    char full[256];
 
    GetCmdArgString(full, sizeof(full));
 
    if (client)
    {
        Action OnClientSayCommand("Command from client: %N", client);
	}
     
    return Plugin_Handled;
    CPrintToChatAll("Argument %d: %s", i, arg);
	echo "This is secret..."

}

Last edited by evans; 07-07-2021 at 15:56.
evans is offline