1. How does the the Covalence Command brace work or how does it compare for example?
    Code:
    [Command("test")]
    void test(IPlayer player, string command, string[] args)
    { } // Does this one work as both console and chat command?[ChatCommand("test")]
    void test(BasePlayer player, string command, string[] args)
    { }[ConsoleCommand("test")]
    void test(ConsoleSystem.arg args)
    { }
     
  2. Wulf

    Wulf Community Admin

    It would work as both a console and chat command, though you may need a prefix for console right now as the assumed global. isn't working as far as I know.
     
  3. I see so I would need to set it as plugin.test or something so it would be

    /Plugin.test ingame
    And plugin.test in console?
     
  4. Wulf

    Wulf Community Admin

    No, you can add multiple commands. Rust console commands require a prefix, but global. should be the default if you don't specify one, just not sure if it's working right now. So you'd only need to specify a prefix (global., server., etc.) if it isn't working.
     
  5. oh okay. so lets say I did prefix it with server. I wouldnt have to prefix the chat command would I?
     
  6. Wulf

    Wulf Community Admin

    Correct. [Command("test", "global.test") would allow for "test" to be used in the chat and console. Ideally you wouldn't need the 2nd one though.
     
  7. Okay. Sounds easy enough thanks @Wulf
     
  8. Another question. Since im a noob. Im trying to do somthing for lets say a command arg isn't set to return a value. for example.

    Code:
    if (args[1] != null)
    {
    string defaultaction = "player";
    } else
    { string defaultaction = args[1]}
    am I doing this right?

    Might be a topic for a new thread.
     
  9. Wulf

    Wulf Community Admin

    Code:
    var action = args[1] ?? "player";
    That might work fine, else try something like:
    Code:
    var action = !string.IsNullOrEmpty(args[1]) ? args[1] : "player";
    Both of those may error with ArgumentOutOfRangeException, so as a last resort:
    Code:
    var action = args.Length >= 2 ? args[1] : "player";
     
  10. I got it working with this instead maybe you have an idea to clean it up?

    Code:
    case "player":
                        if (args.Length == 1) { SendReply(player, $"[<color=#6275a4>{Name}</color>]: Invalid Arguments Ex. <color=green>/{command} player</color> <color=red>{player.displayName}</color>"); return; }
                        var target = rust.FindPlayer(args[1]); if (!target) { SendReply(player, $"Player <color=purple>{args[1]}</color> - Was not found"); return; }                    if (args.Length == 3) { if (args[2] == "player" || args[2] == "stash" || args[2] == "tc" || args[2] == "all") { defaultAction = args[2]; } else { SendReply(player, $"{args[2]} is a invalid action, please use: player | stash | tc | all"); return; } }                    string activated;
                        radar(target, defaultAction, defaulttime, defaultdistance, boxheight);
                        if (IsRadar(target)) { activated = "Activated"; } else { activated = "Disabled"; }
                        SendReply(player, $"[<color=#6275a4>{Name}</color>]: You have successfully <color=green>{activated}</color> <color=#6275a4>{Name}</color> for <color=yellow>{target.displayName}</color>");
                        break;
     
  11. Wulf

    Wulf Community Admin

    That would take the fun out of learning. ;)
     
  12. It would. ;)
    [DOUBLEPOST=1470365279][/DOUBLEPOST]I would love for you to try Admin Radar when i'm done with it I don't know if you actually play rust or not
     
  13. Another bump on the road. When you added IsGod to godmode how did you make it callback so fast. for some reason I can't make it so that AdminPanel reads IsRadar from AdminRadar correctly without setting a delay timer
     
  14. Wulf

    Wulf Community Admin

    I'd need to see your code, but all IsGod does is check the dictionary of users set as god.
     
  15. Some how I think I messed myself up on that. I was doing the exact same thing as Godmode was but everytime I took the refresh cui timer out I took the refresh cui part out completely ;) Silly me
     
  16. How can I go about using covalence.RegisterCommand. I can't figure out the callback
     
  17. Wulf

    Wulf Community Admin

    That isn't a valid option, here are the methods below.

    You can either use attributes:
    Code:
    [Command("testcmd")]
    void TestCommand(IPlayer player, string command, string[] args)
    {
        // Stuff happens here
    }
    Or register multiple with the same attribute:
    Code:
    [Command("testcmd", "othercmd")]
    void TestCommand(IPlayer player, string command, string[] args)
    {
        // Stuff happens here
    }
    And even add a permission if you'd like:
    Code:
    [Command("testcmd", "othercmd"), Permission("perm.name")]
    void TestCommand(IPlayer player, string command, string[] args)
    {
        // Stuff happens here
    }
    Or you can manually register a permission now:
    Code:
    void Init()
    {
        AddCovalenceCommand("version" , "VersionCommand");
    }
    Or you can register multiple manually for the command method:
    Code:
    void Init()
    {
        AddCovalenceCommand(new[] { "oxide.version", "version" }, "VersionCommand");
    }
     
  18. I was attempting to register custom command names from a config. I just did the rust method and forwarded the method to a covalence method
     
  19. Wulf

    Wulf Community Admin

    The proper way to do that is in my examples above.
     
  20. I will look into that. Thanks wulf