1. I have an error when i put {0} for exemple in server.Broadcast

    Code:
    ["HealedBroadcast"] = "<color=olive>{2}</color><color=green> were </color><color=red>healed</color><color=green> for </color><color=red>{0} health</color><color=green> by </color><color=olive>{1}</color>",
    Code:
    server.Broadcast(lang.GetMessage("HealedBroadcast", this, null));
    Code:
    at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0
    at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0
    at System.String.Format (System.String format, System.Object[] args) [0x00000] in :0
    at Oxide.Game.Rust.Libraries.Server.Broadcast (System.String message, System.String prefix, UInt64 userId, System.Object[] args) [0x00000] in :0
    at Oxide.Game.Rust.Libraries.Covalence.RustServer.Broadcast (System.String message, System.String prefix, System.Object[] args) [0x00000] in :0
    at Oxide.Game.Rust.Libraries.Covalence.RustServer.Broadcast (System.String message) [0x00000] in :0
    at Oxide.Plugins.SlayforRust.HealCommand (IPlayer player, System.String command, System.String[] args) [0x00000] in :0
    at Oxide.Plugins.SlayforRust.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in :0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0 
    How can I put in Inside ??
    (i'm new and I don't know too much)..

    Thanks for all the answers
     
  2. Wulf

    Wulf Community Admin

    You need to format it before sending it else send the actual args to be formatted. Right now Oxide is trying to format it for you as it has placeholders that are intended to be formatted such as {0}.
     
  3. Code:
    server.Broadcast(String.Format(lang.GetMessage("HealedBroadcast", this, null)));
    Is it like that?
     
  4. Wulf

    Wulf Community Admin

    You still aren't providing any arguments to use with the formatting. The {0} and such can't be replaced when nothing is being provided.