From 7cbfbfa9deca845da730a35c24f88757267f0948 Mon Sep 17 00:00:00 2001 From: hydrant Date: Wed, 5 May 2021 18:10:06 +0200 Subject: [PATCH] =?UTF-8?q?NoClip=20und=20Aunshow=20wieder=20f=C3=BCr=20ko?= =?UTF-8?q?pfadmins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/AdminCommands.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 85fb8670..e444c93c 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -259,7 +259,7 @@ namespace ReallifeGamemode.Server.Commands } break; case "all": - if(!player.HasData("togall")) + if (!player.HasData("togall")) { player.SetData("togip", true); player.SetData("togdeath", true); @@ -357,7 +357,7 @@ namespace ReallifeGamemode.Server.Commands [Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)] public void CmdAdminO(Player player, string message) { - if(!player.IsLoggedIn()) + if (!player.IsLoggedIn()) { return; } @@ -1790,7 +1790,8 @@ namespace ReallifeGamemode.Server.Commands [Command("spectate", "~m~Benutzung: ~s~/spectate [NAME/ID]", Alias = "spec")] public void CmdAdminSpectate(Player player, string targetname = null) { - if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + User user = player.GetUser(); + if (user.IsAdmin(AdminLevel.ADMIN)) { ChatService.NotAuthorized(player); return; @@ -1805,15 +1806,15 @@ namespace ReallifeGamemode.Server.Commands if (target == null || !target.IsLoggedIn()) { ChatService.PlayerNotFound(player); - return; + return; } - if(target.Name == player.Name) + if (target.Name == player.Name) { ChatService.ErrorMessage(player, "Du kannst dich nicht selbst spectaten"); return; } - + if (!currentStatus) { currentStatus = !currentStatus; @@ -1828,7 +1829,6 @@ namespace ReallifeGamemode.Server.Commands { player.TriggerEvent("SERVER:ADMIN_SPECTATE", target); }, 100); - } else { @@ -1836,14 +1836,15 @@ namespace ReallifeGamemode.Server.Commands player.SetData("adminUnshow", currentStatus); player.TriggerEvent("SERVER:ADMIN_STOP_SPECTATE"); player.SafeTeleport(player.GetData("specPosition")); - } + } + user.SetBlipAndNametagColor(); } [Command("aunshow", "~m~Benutzung:~s~ /aunshow")] public void CmdAdminUnshow(Player player) { User user = player.GetUser(); - if (!user.IsAdmin(AdminLevel.ADMIN)) + if (!user.IsAdmin(AdminLevel.HEADADMIN)) { ChatService.NotAuthorized(player); return; @@ -3936,7 +3937,7 @@ namespace ReallifeGamemode.Server.Commands [RemoteEvent("Noclip")] public void Noclip(Player player) { - if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + if (player.GetUser().IsAdmin(AdminLevel.HEADADMIN)) { return; }