1. Hi. I am trying to make a plugin that block a command. I don't use the plugin Command Block, because I need a plugin that do that but in C#

    This is what I have:
    Code:
            void OnRunCommand(ConsoleSystem.Arg arg, BasePlayer player)
            {
                if (comnd == "somecommand")
                {
                    return false;
                }
            }
    It does not work. I don't know what to do.

    Thank you.
     
  2. Wulf

    Wulf Community Admin

    Why do you need a plugin to be in C#? The Lua version should work just fine.

    Code:
    object OnRunCommand(ConsoleSystem.Arg arg)
    {
        if (arg?.connection != null && arg.cmd.namefull == "global.spectate") return true;
        return null;
    }
     
  3. Amazing @Wulf.

    I need it on C# because I am making a plugin that replace status command. I am trying to style it.

    Thank you Wulf!!!!!
     
  4. Wulf

    Wulf Community Admin

    Code:
    object OnRunCommand(ConsoleSystem.Arg arg)
    {
        if (arg?.connection !=null && arg.cmd.namefull == "global.status")
        {
            Puts("Yay status command works!");
        }
        return null;
    }
     
  5. error CS1525: Unexpected symbol `object'
    error CS1525: Unexpected symbol `object' ?
     
  6. Wulf

    Wulf Community Admin

    Please show me your full plugin, the code example works.
     
  7. yes ı can
     

    Attached Files:

    • aaa.png
      aaa.png
      File size:
      128.5 KB
      Views:
      34
  8. Wulf

    Wulf Community Admin

    That isn't a full plugin, that's just my code snippet. You need to put it inside a plugin.
     
  9. where is the command block plugin :(
     
  10. Wulf

    Wulf Community Admin

  11. Thank you so much. <3