Raised This Month: $32 Target: $400
 8% 

Disable command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 03-12-2019 , 11:59   Disable command
Reply With Quote #1

How can I disable a command from being executed? (dont want to use admin_overrides.cfg)
Tried to hook an event at start with new flags but I dont like that way.
TrullSin is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 03-12-2019 , 13:07   Re: Disable command
Reply With Quote #2

You can give commands to admin groups.

addons/sourcemod/configs/admin_groups.cfg
PHP Code:
Groups
{
    
"admin"
    
{
        
"flags"            "abcdfghjk"
        "immunity"        "92"
        "Overrides" 
//"[override1]" "[allow|deny]"
        
{
            
"sm_map"    "deny"
            "sm_votemap"    "allow"
        
}
    }


has the admin group:
You cannot use sm_map.
You can use sm_votemap.
__________________
alphaearth is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-12-2019 , 13:09   Re: Disable command
Reply With Quote #3

You can do one of the following:

1. Edit the source code and add a check to disable the command inside the callback.
2. Comment out the line that registers the command.
3. Use overrides to deny anyone access to the command except for "z" (root) flag.
4. Use a command listener. (This won't work if the plugin registering the command loads before the plugin with this command listener.)

The override system is meant for cases like this so I don't know why you wouldn't want to use it. It's easy and convenient for what you're asking.
__________________
Psyk0tik is offline
Reply



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