#_G api to disable a command?

1 messages · Page 1 of 1 (latest)

lean otter
#

Prefer no plugin, so I was wondering how you can disable a command via a script using adonis api?

celest elk
#

access the 'Admin' table using the Access API (you'll have to change the settings to enable it, refer to the G_Access setting and enabling Admin to true if you haven't already), something like below should work, and for GetCommand the prefix appears to be needed, you could also just access "Commands" and directly find the table and set "Disabled" just like below:

local Admin = _G.Adonis.Access("verysecurekey_hopefully", "Admin")
local found, cmd = Admin.GetCommand(":cmds")
if found then
    cmd.Disabled = true
    Admin.CacheCommands()
end

not sure why no one gave a solution like above, was pretty easy to do

lean otter
#

also thank you!