AutoBroadcast

Moved

Total Downloads: 8,943 - First Release: Oct 26, 2014 - Last Update: Feb 27, 2017

5/5, 20 likes
  1. Wulf

    Wulf Community Admin

    Try something a bit more unique for the keys that isn't numbers.
     

  2. I've tried only texts and the same error happens
    {
    "This": "We're testing",
    "Testing": "Just for test",
    "Test": "Another test",
    "Just": "Testing the test"
    }
     
  3. Wulf

    Wulf Community Admin

    Do you have messages in another language with less keys?
     
  4. I just have English language
     
  5. Wulf

    Wulf Community Admin

    Did you reload the plugin after changing the messages? Basically what the error is saying is that you have less messages than what it counted.
     
  6. Yeah, I've unloaded and loaded again, also reloaded :/
     
  7. Hello Wulf. I do really appreciate your effort. I installed your plugin 12 hours ago. I have been trying to fix this issue since then with no avail.
    I have edited the "example" messages in the code itself to (Just part of your code):

    Code:
            void OnServerInitialized()
            {
                LoadDefaultConfig();            if (lang.GetLanguages(this).Length == 0 || lang.GetMessages(lang.GetServerLanguage(), this)?.Count == 0)
                {
                    lang.RegisterMessages(new Dictionary<string, string>
                    {
                       "Message1": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla.",
                        "Message2": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla.",
                        "Message3": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
                        "Message4": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
                        "Message5": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
                        "Message6": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla"
                    }, this, lang.GetServerLanguage());
                }
    I have also added the ".json" file to every language folder there is in my oxide folder with edited versions.. An example:
    Code:
    {
      "Message1": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
      "Message2": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
      "Message3": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
      "Message4": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
      "Message5": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
      "Message6": "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla"
    }
    And it is working fine ingame except for the fact that it shows the "example" messages you inserted in the original code. These messages are not anywhere to be found in the "adjusted" code of yours (Only adjusted the messages).
    What seems to be wrong?

    Regards,
     
  8. Wulf

    Wulf Community Admin

    It can't pull from something that doesn't exist, so it'd have to exist in one of the oxide/lang files.
     
  9. I'm pretty sure these "example" messages don't exist anywhere. I adjusted the files one by one and to my surprise that message is still broadcasting from god knows where :p

    This might help:

    Code:
        Line 96: 13:52 [Info] AutoBroadcast was compiled successfully in 1817ms
        Line 97: 13:52 [Info] Loaded plugin AutoBroadcast v1.0.8 by Wulf/lukespragg
        Line 117: 14:23 [Error] Error while compiling: AutoBroadcast.cs(83,66): error CS1525: Unexpected symbol `Random'
        Line 307: 16:43 [Error] Error while compiling: AutoBroadcast.cs(83,66): error CS1525: Unexpected symbol `Random'
     
  10. Wulf

    Wulf Community Admin

    Looks like you edited it wrongly and is no longer compiling, which is why it is still using the old messages.
     
  11. Can i put colour on the mesages or no ?
     
  12. Wulf

    Wulf Community Admin

    Yes, either via Unity styling or Covalence styling.

    Unity:
    Code:
    <color=red>Hi</color>
    Code:
    <color=#FF0000>Hi</color>
    Covalence:
    Code:
    [#FF0000]Hi[/#]
     
  13. Suggestion* add an option to be able to run the prefix in order to send a command for other plugins. (for my example) I'm considering adding some commands in my in game shop and when a player buys something it could announce a global chat message saying "Someone just bought a random heli" or something just by executing in console something like this:

    Code:
    {
      "ExampleMessage": "This is an example. Change it, remove it, translate it, whatever!",
      "AnotherExample": "This is another example, notice the comma at the end of the line above..."
    }
    Console command:
    ab.ExampleMessage run

    then shoots a message like "This is an example. Change it, remove it, translate it, whatever!" in chat
     
  14. It shows only te Default Examples--Meg's. I edit it in the /en folder, still the same msg. cant change it...
     
  15. Wulf

    Wulf Community Admin

    What are the exact changes you made?
     
  16. all i did was editing the data in the folder lang/en.
     
  17. Wulf

    Wulf Community Admin

    Okay, but what are the exact changes you made?
     
  18. Hey man,

    i loaded ur plugin and it works finr with one message. if i added second one and randomize Messages ist only shoes the second. ok i dod something wrong i thougth. but after deleting config, lang and .cs file and loading the plugin new it still Shows the old second message but there is defaultmassege in lang :-/

    did i missed something?

    best regards
     
  19. Wulf

    Wulf Community Admin

    Sounds like you're using the same key for the new messages, but I'd need to see the changes you made exactly.
     
  20. after the issues i delete all data and load plugin new. in lang file ist still the Default example message but he Shows up my last message before unload. how Comes? i´m sure i deleted all old files before new load.

    best regards