AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   restrict command to client in console (https://forums.alliedmods.net/showthread.php?t=333375)

evans 07-07-2021 15:51

restrict command to client in console
 
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..."

}


Sreaper 07-07-2021 21:54

Re: restrict command to client in console
 
You would have to recompile Sourcemod for that. The developers specifically made it so you can’t block those.

evans 07-08-2021 17:49

Re: restrict command to client in console
 
1 Attachment(s)
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...

Marttt 07-08-2021 20:17

Re: restrict command to client in console
 
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).

evans 07-09-2021 10:06

Re: restrict command to client in console
 
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.

Maxximou5 07-09-2021 11:10

Re: restrict command to client in console
 
Quote:

Originally Posted by evans (Post 2752330)
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.

evans 07-09-2021 12:43

Re: restrict command to client in console
 
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.


All times are GMT -4. The time now is 19:08.

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