Please anyone help me
How to block a command in console.
The command 'craft.add' have a bug to craft 999999 C4
Please help me, i have used the args.cmd.namefull and not work ;-;
Blocking a console command?
Discussion in 'Rust Development' started by Daat, Mar 17, 2018.
-
Code:
private object OnServerCommand(ConsoleSystem.Arg arg) { if (arg.Player() == null) return null; if (arg.cmd?.Name == null) return null; if (arg.cmd.Name == "craft.add") { return false; } return null; }
-
Not work ;-;
-
Wulf Community Admin
You can use the CommandBlock plugin for this, otherwise the code provided above should work fine.
-
The commandblock of the 2016 not work to block craft.add ;--; and this command too
[DOUBLEPOST=1521355762][/DOUBLEPOST]I wanted to edit in assembly-csharp.dll but every time I will compile this same error occurs:
https://i.imgur.com/biKWOZN.pngLast edited by a moderator: Mar 18, 2018 -
craft.add is nor useable by anyone. It may be if you are an admin, otherwise this command has no use.
-
Try this:
Code:private List<string> blackCmd = new List<string>() { "craft.add" }; private object OnServerCommand(ConsoleSystem.Arg arg) { if (arg.Connection == null) return null; foreach (var cmd in blackCmd) return arg.Player().IsAdmin ? (object)null : arg.cmd?.Name != cmd; return null; }
-
Code:return /* this name needs some work */ blackCmd.Contains(arg.cmd?.Name) ? false : (object)null;