From e7847da1fc8361b3beebf7db28ceb373368c37db Mon Sep 17 00:00:00 2001 From: Lennart Kampshoff Date: Wed, 19 Sep 2018 13:53:17 +0200 Subject: [PATCH] Add /gotoxyz Command, Add /ipl Command to manage IPLs --- Server/Commands/Admin.cs | 43 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/Server/Commands/Admin.cs b/Server/Commands/Admin.cs index 51a3fd57..2f0dd635 100644 --- a/Server/Commands/Admin.cs +++ b/Server/Commands/Admin.cs @@ -29,7 +29,7 @@ namespace reallife_gamemode.Server.Commands NAPI.Chat.SendChatMessageToAll(publicMessage); } - [Command("veh", "~m~Benutzung:~s~ /veh [Fahrzeug] (Farbe 1) (Farbe 2)")] + [Command("veh", "~m~Benutzung: ~s~/veh [Fahrzeug] (Farbe 1) (Farbe 2)")] public void CmdAdminVeh(Client player, VehicleHash hash, int color1 = 111, int color2 = 111) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) @@ -88,7 +88,7 @@ namespace reallife_gamemode.Server.Commands player.Vehicle.Delete(); } - [Command("goto", "~m~Benutzung:~s~ /goto [Name]")] + [Command("goto", "~m~Benutzung: ~s~/goto [Name]")] public void CmdAdminGoto(Client player, string name) { if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) @@ -105,5 +105,44 @@ namespace reallife_gamemode.Server.Commands return; } } + + [Command("gotoxyz", "~m~Benutzung: ~s~/gotoxyz [X] [Y] [Z]")] + public void CmdAdminGotoxyz(Client player, float x, float y, float z) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + + player.Position = new Vector3(x, y, z); + } + + [Command("ipl", "~m~Benutzung: ~s~/ipl [Load / Remove] [Name]")] + public void CmdAdminIpl(Client player, string option, string name) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + + option = option.ToLower(); + + if(option == "load") + { + NAPI.World.RequestIpl(name); + player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich geladen"); + } + else if(option == "remove") + { + NAPI.World.RemoveIpl(name); + player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich entladen"); + } + else + { + player.SendChatMessage("~m~Benutzung: ~s~/ipl [Load / Remove] [Name]"); + } + } } }