alias für managefactionranks

This commit is contained in:
hydrant
2020-03-25 20:18:18 +01:00
parent 2f70a60c22
commit d90f59f43a
2 changed files with 10 additions and 2 deletions

View File

@@ -2005,6 +2005,8 @@ namespace ReallifeGamemode.Server.Commands
case "fvehicle": case "fvehicle":
if (player.IsInVehicle) if (player.IsInVehicle)
{ {
string fIdStr = option1 + " " + option2;
int? factionId = null; int? factionId = null;
try try
{ {
@@ -2454,7 +2456,7 @@ namespace ReallifeGamemode.Server.Commands
#endregion #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) public void CmdFactionManageFactionRanks(Player player, int factionID)
{ {
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)

View File

@@ -49,7 +49,13 @@ namespace ReallifeGamemode.Server
.Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0) .Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0)
.ToArray(); .ToArray();
var registeredCommands = methods.Select(c => c.GetCustomAttribute<CommandAttribute>().CommandString); var cmdAttributes = methods.Select(c => c.GetCustomAttribute<CommandAttribute>()).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(); IAPI apiInstance = new RageAPI();
eventHandler = new EventHandler(apiInstance); eventHandler = new EventHandler(apiInstance);