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

restrict command to client in console


Post New Thread Reply   
 
Thread Tools Display Modes
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
Sreaper
髪を用心
Join Date: Nov 2009
Old 07-07-2021 , 21:54   Re: restrict command to client in console
Reply With Quote #2

You would have to recompile Sourcemod for that. The developers specifically made it so you can’t block those.
Sreaper is offline
evans
Senior Member
Join Date: May 2021
Location: OnSmokeDetonate();
Old 07-08-2021 , 17:49   Re: restrict command to client in console
Reply With Quote #3

Hello Sreaper, thanks for your answer. Please join and look for example to doompact.net CS:S ZM server. Try to write sm plugins or sm plugins list to the console after join. You will get output "how about no?" instead of list of plugins... I really wonder how they did that then? I'm looking for the same solution. Or is it possible they made it just for specific users only? I don't get it...thank you

P.S. Look at the jpg i attached...
Attached Images
File Type: jpg sm.jpg (39.7 KB, 56 views)

Last edited by evans; 07-08-2021 at 18:02.
evans is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-08-2021 , 20:17   Re: restrict command to client in console
Reply With Quote #4

He already explained that you need to recompile SM to do that.
Also, you probably won't get a plug-in-play answer here about it since is prohibited (blocked by design).
__________________
Marttt is offline
evans
Senior Member
Join Date: May 2021
Location: OnSmokeDetonate();
Old 07-09-2021 , 10:06   Re: restrict command to client in console
Reply With Quote #5

Marttt, i can read. My question is still how they did that? Are you trying to tell me that some admins got source code of sourcemod and recompiled the whole sourcemod for such little thing to forbid these commands?? I don't want to believe that....really?? Who would bother with recompiling whole sourcemod because of that?? I thought there should be other easier solution....
Can you post me a private message if it is forbidden? Thx.

P.S. On the other hand it would mean that even the server administrator on the server console can't use sm plugins command ?? Am i right?? Or did they "illegaly" rewrite sourcemod to use this on the server console only? Can someone make it clear for me? Thank you guys.

Last edited by evans; 07-09-2021 at 10:28.
evans is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-09-2021 , 11:10   Re: restrict command to client in console
Reply With Quote #6

Quote:
Originally Posted by evans View Post
Marttt, i can read. My question is still how they did that? Are you trying to tell me that some admins got source code of sourcemod and recompiled the whole sourcemod for such little thing to forbid these commands?? I don't want to believe that....really??
Yes. It is not difficult either.

Providing that answer on forums isn't something that should be given. It is considered a "dick move" to do what you're asking. Someone else can explain why if you need to know more. There is generally never a good enough reason to do this.

Your question has been answered many times, you just have to search on DuckDuckGo or Google.
Maxximou5 is offline
evans
Senior Member
Join Date: May 2021
Location: OnSmokeDetonate();
Old 07-09-2021 , 12:43   Re: restrict command to client in console
Reply With Quote #7

Ok Maxximou5... Really thank you for your answer, You are the KING!!! Hmmm.....but Yes, i agree. This is really dick move and selfish. You' re right, absolutely.....My only interrest was how did they do that. Now i know and i will not use that sm plugin blocker then! Let's see everyone which plugins is using and who did so hard efforts to make that plugins and appreciate him !!!

If i missed something, Pls someone else explain me why, yes, i need to know more...thank you again Maxximou5.

Last edited by evans; 07-09-2021 at 13:10.
evans 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 18:16.


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