Cancel OnRunCommand

Discussion in 'Rust Development' started by Spoon, Mar 2, 2015.

  1. Is there anyway to cancel OnRunCommand i've tried:
    Code:
        def OnRunCommand(self, arg):
            data = arg.GetString(0, 'text')
            if data.startswith('/'):
                self.OnPlayerChat(arg)
                return False
    
    I've built my own command system in python so it does not use oxide to register commands but when i type
    /help i get the following
    http://gyazo.com/c226acb03872da9e6e1c1ac302f5a0e1
    Is there anyway to stop it saying Unknown command /help
     
    Last edited by a moderator: Mar 2, 2015
  2. Wulf

    Wulf Community Admin

    Is there a reason why you aren't using Oxide to register commands? That seems a bit pointless.
     
  3. i use my own admin system that uses your forum group from my website as your power(admin) level to assign commands. so i do not use rusts owner moderator user as admin ranks either.
     
  4. Wulf

    Wulf Community Admin

    That still doesn't explain why you'd need to make your own command registration system. You can use the Oxide command system any way you'd like, the Rust auth level system is just what most authors use. Oxide has its own permissions and group system, but nobody has used it yet.
     
  5. This is just the command system i've used on every game i've hosted a server for it ties all the commands to my website so admins can view all there commands from our echelon also ingame when you type /help it list all the command you have access to then if you want to know how to use a command you can type /help command eg. /help tempban will output <name> <duration> <reason> - Temporarily ban a player.
     
  6. Wulf

    Wulf Community Admin

    Right, but I still don't see why that would required you to write your own. All of that can be done without writing your own command system.

    To answer your original question though, it's an unknown command as you never registered the command with Oxide. You'd likely have to modify Oxide's core to stop that message. You should be able to cancel chat commands though using the OnPlayerChat function.
     
  7. Fixed it i did.
    Code:
        def OnRunCommand(self, arg):
            data = arg.GetString(0, 'text')
            if data.startswith('/'):
                arg.cmd.namefull = ''
     
  8. Wulf

    Wulf Community Admin

    Keep in mind that your plugin would need to execute before all other plugins you are using to catch all of the commands.
     
  9. all my plugins register there commands through this plugin
     
    Last edited by a moderator: Mar 2, 2015