Im trying to do this in C#:
Code:function PLUGIN:Init() self.LoadDefaultConfig() command.AddChatCommand(self.Config.Command, self.Object, cmdCommand) endfunction PLUGIN:LoadDefaultConfig() self.Config.Command = self.Config.Command or "test" endfunction PLUGIN:cmdCommand(player, cmd, args) rust.SendChatMessage(player, cmd .. " Command activated!") end
Config set Chatcommands in C#
Discussion in 'Rust Development' started by LaserHydra, Jun 28, 2015.
-
It is the exact same as if you were doing it in lua.
var command = Interface.Oxide.GetLibrary<Command>();
command.AddChatCommand("Test", this, "MethodName"); -
so you can also do it like that, I though you can only do [ChatCommand(command)] void cmdCommand()
Thanks
