public void Users(ISender sender, ArgumentList args) { var add = args.TryPop("add"); //xuser add username var forced = args.TryPop("-f"); var save = args.TryPop("-save"); if (add) { var username = args.GetString(0); Player user = null; var matches = Server.FindPlayerByPart(username); if (matches.Count == 1) { user = matches.ToArray()[0]; } if (user == null && !forced) { throw new CommandError(Languages.NoPlayersAndForce); } var trueUser = user == null ? username : (user.Name ?? username); if (XmlParser.HasUser(trueUser)) { throw new CommandError(Languages.DefinitionsExist + Languages.User); } XmlParser.AddUser(trueUser); if (save) { XmlParser.Save(); } sender.sendMessage( String.Format("`{0}` {1}", trueUser, Languages.HasBeenCreated) ); } else { throw new CommandError("{0} - xuser add [-f -save] username", Languages.ArgumentsExpected); } }