Hello!
I've got 2 plugins. I want to call a command defined in the 1st one from the 2nd one.
In 1st plugin (Hurtworld):
In 2nd plugin (Covalence)Code:[ConsoleCommand("wipeobj")] void cmdwipe(PlayerSession session, string command, string[] args)
The error says that server is not defined, so I tried to use this instead:Code:server.RunCommand("wipeobj");
But it says "unknown command: wipeobj".Code:ConsoleManager.Instance.ExecuteCommand("wipeobj");
Calling command from another plugin?
Discussion in 'Hurtworld Development' started by gogolon, Jul 2, 2018.
-
Wulf Community Admin
There is no such thing as "server.RunCommand" in Oxide, only "server.Command" and only for Covalence plugins. "server" is only available if you have the correct references and your plugin is of type CovalencePlugin. Alternately, if your plugin is a HurtworldPlugin, then you can use covalence.Server.Command instead.
If the plugin registering the command is a Covalence plugin, then [ConsoleCommand] is not a valid attribute so the command wouldn't be registered, and the args you are using are also not valid for a Covalence plugin command. -
ok, so how to call a hurtworld plugin command from covalence plugin?
-
Wulf Community Admin
-
I am, but in the second script, which is Hurtworld Plugin. It works when you call it from the game.
-
Wulf Community Admin
-
So, what is the correct attribute?
-
Wulf Community Admin