Due to the fact that the developers of the game blocked the possibility of using ddraw for users, there was an idea to bypass the lock, giving all players administrator rights, as well as making filter commands. I tried to filter commands using the OnServerCommand binding, but if the administrator uses a locked command created in the game, for example: hile.calltome, the lock does not work and the NollExceptionReference error appears. How to implement an idea that filters all game teams? These are my code attempts:
Code:object OnServerCommand(ConsoleSystem.Arg arg) { BasePlayer player = arg.Player(); if (player != null) //Player commands filter { var command = arg.cmd.Name.ToUpper(); // Allowed console command list if (command.StartsWith("HELP") || command.StartsWith("REMOVER")) { return null; } if (command.StartsWith("SAY")) { var args = arg.GetString(0, null).ToUpper(); if (!args.StartsWith("/")) { return null; } else { // Allowed chat command list if (args.StartsWith("/HELP") || args.StartsWith("/INFO") || args.StartsWith("/REMOVER")) { return null; } } } return false; //Block all other player teams } return null; //Allow all server commands }
Solved Blocking game commands?
Discussion in 'Rust Development' started by WarriorForRust, Jul 17, 2017.