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

restrict command to client in console


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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


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