Sends randomly configured chat messages every X amount of seconds
First Release: Oct 26, 2014
- Last Update: Feb 27, 2017
Try something a bit more unique for the keys that isn't numbers.
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"
Do you have messages in another language with less keys?
I just have English language
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.
Yeah, I've unloaded and loaded again, also reloaded :/
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):
if (lang.GetLanguages(this).Length == 0 || lang.GetMessages(lang.GetServerLanguage(), this)?.Count == 0)
lang.RegisterMessages(new Dictionary<string, string>
}, 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:
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?
It can't pull from something that doesn't exist, so it'd have to exist in one of the oxide/lang files.
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
This might help:
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'
Looks like you edited it wrongly and is no longer compiling, which is why it is still using the old messages.
Can i put colour on the mesages or no ?
Yes, either via Unity styling or Covalence styling.
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:
"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..."
then shoots a message like "This is an example. Change it, remove it, translate it, whatever!" in chat
It shows only te Default Examples--Meg's. I edit it in the /en folder, still the same msg. cant change it...
What are the exact changes you made?
all i did was editing the data in the folder lang/en.
Okay, but what are the exact changes you made?
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?
Sounds like you're using the same key for the new messages, but I'd need to see the changes you made exactly.
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.