Retrieving a message from a language fileSolved
Hello, so im new to this stuff and when i tried to make a language file it gave me that error when i tried calling a command that uses a message:

Failed to call hook 'Cmd1' on plugin 'WarnSystem v0.1.9' (IndexOutOfRangeException: Index was outside the bounds of the array.)
at Oxide.Plugins.WarnSystem.Cmd1 (Oxide.Core.Libraries.Covalence.IPlayer player, System.String cmd, System.String[] args) [0x00025] in <0e0a4d4155be4c4980a5b3d05bf0accc>:0
at Oxide.Plugins.WarnSystem.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00086] in <0e0a4d4155be4c4980a5b3d05bf0accc>: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


What i used to call the message:
player.Reply(lang.GetMessage("player_not_found", this, null));


and creating the file:
        private new void LoadDefaultMessages()
        {
            lang.RegisterMessages(new Dictionary<string, string>
            {
                ["warnMessage"] = "{targetName} was warned by {sender} for {reason}",
                ["player_not_found"] = "That player could not be found."
            }, this);
        }
        ​
Have you verified the file exists and the attempt to access they key is after the file is created?
The issue isn't with your Lang API usage, it's with your finding and usage of the IPlayer. To be more specific, you are trying to find a player and then you're trying to use that player, but you're likely accessing the find results wrong. Without seeing that specific code you have though, it's hard to tell you exactly.
Locked automatically