private void RegisterWithCovalence() { Covalence library = Interface.Oxide.GetLibrary <Covalence>(null); foreach (KeyValuePair <string, Plugin.CommandInfo> commandInfo in this.commandInfos) { library.RegisterCommand(commandInfo.Key, this, new CommandCallback(this.CovalenceCommandCallback)); } }
public void AddCovalenceCommand(string[] commands, string callback, string[] perms = null) { this.AddCovalenceCommand(commands, perms, (IPlayer caller, string command, string[] args) => { this.CallHook(callback, new object[] { caller, command, args }); return(true); }); Covalence library = Interface.Oxide.GetLibrary <Covalence>(null); string[] strArrays = commands; for (int i = 0; i < (int)strArrays.Length; i++) { string str = strArrays[i]; library.RegisterCommand(str, this, new CommandCallback(this.CovalenceCommandCallback)); } }