1. 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
            }
     
    Last edited by a moderator: Jul 17, 2017
  2. Wulf

    Wulf Community Admin

    I would not suggest granting them admin, there are client-only commands that the server cannot intercept.
     
  3. I changed the code a bit, now everything works correctly. All unnecessary commands are blocked.
     
  4. Wulf

    Wulf Community Admin

    Client-only commands won't be; ie. noclip. ;)
     
  5. You are right, noclip all spoiled))