Hi
How does Oxide behave when dealing with two plugins that each have a hook handler for the same chat command. For example:
Will both run? Is there a way to determine the order in which they will run?Code:class Foo : RustPlugin { [ChatCommand("foobar")] void foobarCommand() { ... } }class Bar : RustPlugin { [ChatCommand("foobar")] void foobarCommand() { ... } }
Say if Foo went first, is there a way for Foo to tell Oxide to not let Bar run?
Thanks
Overriding a chat command?
Discussion in 'Rust Development' started by DogManJr, Mar 23, 2017.
-
Wulf Community Admin
Whatever plugin loads last will replace the command registered by the other.
-
Okay thanks.
So is there a way to get a list of all commands currently registered? -
Wulf Community Admin
-
The most straightforward way would be to just have all other plugins loaded first, then load yours on and if you see a warning in the console saying a command was overwritten then you have your answer. It's not perfect but it works!
For my own plugins that I know could interfere with others, I tend to add a prefix before the command. It's not the greatest solution because it makes the users type more but at least it avoids these conflict issues.
Ex. /dogmanhelp instead of /help