aopell/MCCBL

Command Arguments

Closed this issue · 0 comments

Add support for more command arguments in custom commands:

string[] args = chatMessage.Split(new string[] { chatMessage.TrimStart().Split(' ')[0] }, StringSplitOptions.None)
//Starting with arg1 replace all arguments with given arguments
for(int i = 1; i < args.length; i++)
{
  if(command.Contains("{arg" + i + "}")
  {
    command.Replace("{arg" + i + "}", args[i]);
  }
}