diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 3ff2e8e2..00a8e244 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -2005,6 +2005,8 @@ namespace ReallifeGamemode.Server.Commands case "fvehicle": if (player.IsInVehicle) { + string fIdStr = option1 + " " + option2; + int? factionId = null; try { @@ -2454,7 +2456,7 @@ namespace ReallifeGamemode.Server.Commands #endregion // - [Command("managefactionranks", "~m~Benutzung: ~s~/managefactionranks [Fraktions-ID]")] + [Command("managefactionranks", "~m~Benutzung: ~s~/managefactionranks [Fraktions-ID]", Alias = "mfr")] public void CmdFactionManageFactionRanks(Player player, int factionID) { if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index 051044d5..34df3cdd 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -49,7 +49,13 @@ namespace ReallifeGamemode.Server .Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0) .ToArray(); - var registeredCommands = methods.Select(c => c.GetCustomAttribute().CommandString); + var cmdAttributes = methods.Select(c => c.GetCustomAttribute()).ToList(); + + var registeredCommands = cmdAttributes.Select(c => c.CommandString).ToList(); + cmdAttributes.Where(c => c.Alias?.Any() ?? false).ToList().ForEach(a => + { + registeredCommands.AddRange(a.Alias.Split(',')); + }); IAPI apiInstance = new RageAPI(); eventHandler = new EventHandler(apiInstance);