1. This is the plugin in the current state, very simple
    Code:
    using Oxide.Core.Plugins;
    namespace Oxide.Plugins
    {
        [Info("RespawnMessages", "Kappasaurus", 0.2)]
        [Description("Make customized notes players view on respawn!")]    class RespawnMessages : RustPlugin
        {
            [PluginReference]
            Plugin PopupNotifications;
            void LoadDefaultConfig()
            {
                Config.Clear();
                Config["RespawnMessage"] = "Hey, try not to die this time!";
                Config["PopupEnabled"] = false;
                Config["ChatEnabled"] = true;
                Config.Save();
            }        void OnPlayerRespawn(BasePlayer player)
            {
                if ((bool)Config["PopupEnabled"] == true)
                {
                    PopupNotifications?.Call("CreatePopupNotification", Config["RespawnMessage"].ToString());
                }
                if ((bool)Config["ChatEnabled"] == true)
                {
                    SendReply(player, Config["RespawnMessage"].ToString());
                }
            }
            [ChatCommand("rmessage")]
            void TestCommand(BasePlayer player, string command, string[] args)
            {
                SendReply(player, "<size=22><color=#cd422b>Respawn Messages v0.1</color></size>");
                SendReply(player, "<size=12>Created by </size><size=14>Kappasaurus</size><size=12> with the help of </size><size=14>DylanSMR</size>");
            }
        }
    }
    
    I know how to setup a chat command, so I plan to do something like "/rmessage ChatEnabled" true, but how do I set it so the true (or what ever value there is) writes to the config? Mainly I just need to know how to change it with a command, I don't need to know how to create a new command.
     
  2. Code:
            [ConsoleCommand("test")]
            void test(ConsoleSystem.Arg arg)
            {
                Config["StarterMultiplyer"] = arg.Args[0];
                Config.Save();
            }
    That is a example of how you can do it. So say I did "test 30.0" it would set it like:
    Code:
    {
      "RateOnLevel": 0.1,
      "StarterMultiplyer": "30.0"
    }
    [DOUBLEPOST=1467746979][/DOUBLEPOST]Of course mine is a float so 30.0 works with it. Otherwise you could do 5, "Or a string"
     
  3. well /rm will give credit, how do I make it so I could do /rm set <message> would set the message? because if I make the chat command "rm set", it just triggers /rm
    @DylanSMR
     
  4. For that you would do a switch(args[0]) . You can look in my IGather plugin for a example.
     
  5. Hey kappa. Just call it as /rmset or /rm_set
    It's always the easiest solution as we can't really send the "" to allow for the spaces..
     
  6. Well there is a way, using classes.
    Look at LaserHydra's code, he uses a method for BetterChat, for example /group set blabla
     
  7. Wulf

    Wulf Community Admin

    That space offsets the second part, the second part becomes an argument just like the blabla is. There are numerous plugins that do this.