AdvertMessages

Moved

Total Downloads: 5,741 - First Release: Dec 11, 2015 - Last Update: Nov 2, 2016

5/5, 22 likes
  1. Just wanted to say what a great little plugin and replacement for the now dead Notifier. :)
     
  2. Hello, I tryed to add some to the plugin but what happens is that the plugin is working like the original, dont assume the changes:
    Code:
            private struct Configuration
            {
                public static List<object> Messages = new List<object>
                {
                    "Welcome to our server, have fun!",
                    "<orange>Need help?<end> Try calling for an <cyan>Admin<end> here in the chat.",
                    "Please treat everybody respectfully.",
                    "Cheating will result in a <red>permanent<end> ban.",
                    "Check your position on Players Challenge Leaderboard, type /pc here in the chat"
                };
    
                public static float AdvertInterval = 5;
                public static bool BroadcastToConsole = true;
            }
     
    Last edited by a moderator: Feb 23, 2017
  3. Wulf

    Wulf Community Admin

    For this plugin, Edit the messages under the oxide/config folder, not the plugin itself.
     
  4. just wanted to say this plugin works on my 7 days to die server. did not do anything but drop it into my servers plugin folder an it started
    working.. even shows colors.. my server is hosted on gameserver.com
    thanks
     
  5. Carefull, this plugin may hang gameserver if there 2 messages... Infinity loop here:
    Code:
                    do advert = random.Next(0, Configuration.Messages.Count - 1);
                    while (advert == lastAdvert);
    
    p.s. my servers were hanging before I fixed it.
    p.p.s. there one more fix (last message in list never shown up) use random.Next(0, Configuration.Messages.Count)
     
    Last edited by a moderator: Mar 6, 2017
  6. I cant edit the config file if im editing it and replace it with the old config file and restart my server then there is still the old text in the config file... How can I change it?
     
  7. Wulf

    Wulf Community Admin

    That generally means that you are not editing it correctly, and likely creating invalid JSON formatting. I'd suggest validating your changes using a site such as www.jsonlint.com before reloading the plugin.
     
  8. Its working now thx for the tip with the website I found the mistake :D
     
  9. Yeah the same thing happened on my server. How did you fix it?
     
  10. Fast&Crude...
    Code:
                int advert = 0;
    
                if (Configuration.Messages.Count > 1)
                {
                    for (int i = 0; i < 3 && advert == lastAdvert; i++) {
                        advert = random.Next(0, Configuration.Messages.Count);
                    }
                }
    
                lastAdvert = advert;
     
  11. Addon crashed my server every time i loaded it
     
  12. Wulf

    Wulf Community Admin

  13. is there a way i can keep welcome to Supplies all in one text when it messages server? Instead of all one at a time. like to notifier like a paragraph.

    Code:
    {
      "Messages": [
        "Welcome to "Myserver", have fun!
         Be Friendly and Dont Kill New Player
         Please treat everybody respectfully.
         Do /kit for your Supplies",
        "Need help type /help
         <orange>Need help?<end> Try calling for an <cyan>admins<end> in the chat.",
        "Cheating will result in a <red>permanent<end> ban.
         Hackers will be <red>permanent<end> ban with Zero Tolerance!",
      ],
      "Settings": {
        "Adverts Interval (In Minutes)": 1.5,
        "Broadcast To Console": true
      }
    }
     
  14. Enter \n to jump to the next line.
     
  15. Code:
    {
      "Messages": [
        "Welcome to "Myserver", have fun!
         /nBe Friendly and Dont Kill New Player
         /nPlease treat everybody respectfully.
         /nDo /kit for your Supplies",
        "Need help type /help
        /n <orange>Need help?<end> Try calling for an <cyan>admins<end> in the chat.",
        /n"Cheating will result in a <red>permanent<end> ban.
         /nHackers will be <red>permanent<end> ban with Zero Tolerance!",
      ],
      "Settings": {
        "Adverts Interval (In Minutes)": 1.5,
        "Broadcast To Console": true
      }
    }

    Thanks will give a try when I get home from work. Will it be something like that above?
     
  16. Don't use a slash (/) but a backslash (\).
     
  17. Ok test and it work. Thanks
     
  18. @LaserHydra Is there a way to make this plugin work with in-game times? Or is this just based off of real-time?
     
  19. I have issues with this in that if i add lines or "adverts " they never show. I've copied the format as per the default config.

    Please advise.
    Code:
    {
      "Messages": [
        "Welcome to Rustyshire-Wars, have fun!",
        "<orange>Need help?<end> Try calling for an <cyan>admins<end> in the chat.",
        "Kill or be killed.",
        "Cheating will result in a <red>permanent<end> ban.",
        "Type /Kit to view free kits and press J to view your stats\r\n  \n Type /clan to view clans info\r\n  \n Type /Skin to change item skins\r\n  \n Type Rule to view Rules for this server!"
      ],
      "Settings": {
        "Adverts Interval (In Minutes)": 2.0,
        "Broadcast To Console": true
      }
    }
    I should elaborate ... the bottom line doesnt show in chat . But ones i edit further up do .
     
  20. Wulf

    Wulf Community Admin

    Try without the \r\n (use \n instead.)