FormatException in custom commandSolved

For some reason i get with this code that error below. I tested some stuff but happens all time idk why.

  [ChatCommand("home")]
    void setHome(BasePlayer player, string command, string[] args)
        {     
        if (args.Length.Equals(1))
        {
            PrintToChat(player, string.Format(msg("Teleport", command)));         
         }
        else
            {
                PrintToChat(player, string.Format(msg("InvalidUsage", "Use /sethome 'Home name' !")));
            }
     }
Failed to call hook 'setHome' on plugin 'TeleportPlugin v1.0.0' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.)
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ff] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in <e1a80661d61443feb3dbdaac88eeb776>:0
  at System.String.Format (System.String format, System.Object[] args) [0x00020] in <e1a80661d61443feb3dbdaac88eeb776>:0
Looks like it has everything to do with your string.Format usage, nothing to do with the chat command itself and args.

Make sure that the format you are using has variables for replacement. Ex. "You teleported with {0}" and string.Format("Teleport", command)
 void Init()
        {
            LoadDefaultConfig();
            lang.RegisterMessages(new Dictionary<string, string>
            {
                //chat
                ["Teleport"] = "<color=#ff0000>Teleport!</color> You have teleported to <color=#66FF33>{0}</color> !",

                ["InvalidUsage"] = "<color=#ff0000>Invalid Params!</color> {0}!",

                ["Home_Valid"] = "<color=#ff0000>Home Valid!</color>\nName: {0}!",
                ["Home_Found"] = "<color=#ff0000>Home Found!</color>\nName: {0}!",
            }, this);
        }

 string msg(string key, string id = null) => lang.GetMessage(key, this, id);
The issue is with string.Format and your msg method; you're trying to pass arguments to it to format but it doesn't handle that.

I.e. string.Format(msg("Teleport", command)) is not actually passing anything to string.Format, you're passing it to msg instead.

Wrong: string.Format(msg("Teleport", command))
Correct: string.Format(msg("Teleport"), command)
In response to Wulf ():
The issue is with string.Format and your msg method; you're trying to pass arguments to it to format...
Thanks i missed that and it works now correctly
Locked automatically