Messages keep strugglingNot An Issue
Hello,

Recently i installed the AutoBroadcast plugin. I managed to make some automatic broadcasts. The first time, it gave me an Json error. I 'fixed' it by putting it into the tool wich is on the plugin page. Now after a second restart, another error pops up what i really don't understand because it worked and i changed nothing.

Failed to run a 300.00 timer in 'AutoBroadcast v1.0.8' (FormatException: Input string was not in a correct format.)
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ae] in :0 
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in :0 
  at System.String.Format (System.String format, System.Object[] args) [0x00020] in :0 
  at Oxide.Plugins.AutoBroadcast.Lang (System.String key, System.String id, System.Object[] args) [0x0000e] in <211783a4df1443049ca1d6723a6b3495>:0 
  at Oxide.Plugins.AutoBroadcast.m__0 () [0x00111] in <211783a4df1443049ca1d6723a6b3495>:0 
  at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <4452f821def6406d834e4149849fe7ea>:0 ​

Thats the error that it gives me.


What does your lang file for the plugin look like currently? The error means that you have some { and } in there that it's trying to handle I believe.
{
	"<color=yellow>[PlatinumRust]</color> Welcome to PlatinumRust! Next wipe: <color=red>9 December 2018</color>.": "<color=yellow>[PlatinumRust]</color> Use <color=red>/bgrade 4</color> to automatically upgrade your buildings to armored when you place it.",
	"<color=yellow>[PlatinumRust]</color> You can set homes by using <color=red>/home add {name}</color>.": "<color=yellow>[PlatinumRust]</color> Create a clan by using <color=red>/clan create {name} {desc}</color>.",
	"<color=yellow>[PlatinumRust]</color> Make sure to join our discord server the link is in <color=red>/info</color>.": "<color=yellow>[PlatinumRust]</color> Kill players and animals to gain RP, spend those in <color=red>/s</color>.",
	"<color=yellow>[PlatinumRust]</color> Claim your free kits in <color=red>/kit</color>.": "<color=yellow>[PlatinumRust]</color> Make sure to build a strong base! There are easy ways to get raiding materials.",
	"<color=yellow>[PlatinumRust]</color> You can remove your buildings by using the <color=red>/remove</color> command.": "<color=yellow>[PlatinumRust]</color> Vote for an helicopter by using <color=red>/helivote open {1-5}</color>.",
	"<color=yellow>[PlatinumRust]</color> Make nice signs by using <color=red>/sil {url}</color> when looking at an picture frame or sign.": "<color=yellow>[PlatinumRust]</color> You can skip the night when you use <color=red>/voteday</color>",
	"<color=yellow>[PlatinumRust]</color> We offer two diffrent VIP ranks! Check them out in the <color=orange>VIP</color> tab in <color=red>/info</color>.": "<color=yellow>[PlatinumRust]</color> Make sure to follow and read the rules at <color=red>/info</color>. Also check out the Plugins tab!"
}


This is what the json editor told me to do

In response to Sticker ():
{"<color=yellow>[PlatinumRust]</color> Welcome to PlatinumRust! Next wipe: <color=r...
Your configuration was likely very wrong before using that then, as the JSON validator will just tell you if it's valid JSON or not and offer suggestions to make it so. Your configuration should have a simple key (string) before each message, not a message before another message separated with : as you have right now. I'd recommend looking at the plugin's documentation to see a basic example of this. If you have any " in your messages, they should be escaped with \ as well.
Yes i did that but the json validator told me that it was wrong so i changed it to that, ill try it

Merged post



On startup it gives me this error: 
Failed to call hook 'OnServerInitialized' on plugin 'AutoBroadcast v1.0.8' (JsonReaderException: Invalid character after parsing property name. Expected ':' but got: ,. Path '', line 2, position 111.)
  at Newtonsoft.Json.JsonTextReader.ParseProperty () [0x00116] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonTextReader.ParseObject () [0x000d8] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonTextReader.Read () [0x00053] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonReader.ReadAndAssert () [0x00000] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x000b6] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000d9] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00053] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <8fe7f8665ff548909c2f26d557e5093a>:0 
  at Oxide.Core.Libraries.Lang.GetMessageFile (System.String plugin, System.String lang) [0x00067] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Libraries.Lang.GetMessages (System.String lang, Oxide.Core.Plugins.Plugin plugin) [0x00040] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Plugins.AutoBroadcast.OnServerInitialized () [0x0002a] in :0 
  at Oxide.Plugins.AutoBroadcast.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00035] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0 ​


Merged post

I changed the code to:
{
	"<color=yellow>[PlatinumRust]</color> Welcome to PlatinumRust! Next wipe: <color=red>9 December 2018</color>.",
        "<color=yellow>[PlatinumRust]</color> Use <color=red>/bgrade 4</color> to automatically upgrade your buildings to armored when you place it.",
	"<color=yellow>[PlatinumRust]</color> You can set homes by using <color=red>/home add {name}</color>.",
        "<color=yellow>[PlatinumRust]</color> Create a clan by using <color=red>/clan create {name} {desc}</color>.",
	"<color=yellow>[PlatinumRust]</color> Make sure to join our discord server the link is in <color=red>/info</color>.",
        "<color=yellow>[PlatinumRust]</color> Kill players and animals to gain RP, spend those in <color=red>/s</color>.",
	"<color=yellow>[PlatinumRust]</color> Claim your free kits in <color=red>/kit</color>.",
        "<color=yellow>[PlatinumRust]</color> Make sure to build a strong base! There are easy ways to get raiding materials.",
	"<color=yellow>[PlatinumRust]</color> You can remove your buildings by using the <color=red>/remove</color> command.",
        "<color=yellow>[PlatinumRust]</color> Vote for an helicopter by using <color=red>/helivote open {1-5}</color>.",
	"<color=yellow>[PlatinumRust]</color> Make nice signs by using <color=red>/sil {url}</color> when looking at an picture frame or sign.",
        "<color=yellow>[PlatinumRust]</color> You can skip the night when you use <color=red>/voteday</color>",
	"<color=yellow>[PlatinumRust]</color> We offer two diffrent VIP ranks! Check them out in the <color=orange>VIP</color> tab in <color=red>/info</color>.",
        "<color=yellow>[PlatinumRust]</color> Make sure to follow and read the rules at <color=red>/info</color>. Also check out the Plugins tab!"
}​
In response to Sticker ():
Yes i did that but the json validator told me that it was wrong so i changed it to that, ill try it<...
That would not be valid JSON. Valid example:

{
	"Welcome": "<color=yellow>[PlatinumRust]</color> Welcome to PlatinumRust! Next wipe: <color=red>9 December 2018</color>.",
	"BGrade": "<color=yellow>[PlatinumRust]</color> Use <color=red>/bgrade 4</color> to automatically upgrade your buildings to armored when you place it.",
	"Homes": "<color=yellow>[PlatinumRust]</color> You can set homes by using <color=red>/home add {name}</color>.",
	"Clans": "<color=yellow>[PlatinumRust]</color> Create a clan by using <color=red>/clan create {name} {desc}</color>.",
	"Discord": "<color=yellow>[PlatinumRust]</color> Make sure to join our discord server the link is in <color=red>/info</color>.",
	"GainRP": "<color=yellow>[PlatinumRust]</color> Kill players and animals to gain RP, spend those in <color=red>/s</color>.",
	"FreeKits": "<color=yellow>[PlatinumRust]</color> Claim your free kits in <color=red>/kit</color>.",
	"StrongBase": "<color=yellow>[PlatinumRust]</color> Make sure to build a strong base! There are easy ways to get raiding materials.",
	"RemoveBuilds": "<color=yellow>[PlatinumRust]</color> You can remove your buildings by using the <color=red>/remove</color> command.",
	"HeliVote": "<color=yellow>[PlatinumRust]</color> Vote for an helicopter by using <color=red>/helivote open {1-5}</color>.",
	"CustomSigns": "<color=yellow>[PlatinumRust]</color> Make nice signs by using <color=red>/sil {url}</color> when looking at an picture frame or sign.",
	"SkipNight": "<color=yellow>[PlatinumRust]</color> You can skip the night when you use <color=red>/voteday</color>",
	"VIPRanks": "<color=yellow>[PlatinumRust]</color> We offer two diffrent VIP ranks! Check them out in the <color=orange>VIP</color> tab in <color=red>/info</color>.",
	"Rules": "<color=yellow>[PlatinumRust]</color> Make sure to follow and read the rules at <color=red>/info</color>. Also check out the Plugins tab!"
}​

Locked automatically