From 702a0315b871421ea2bd6c5045c99bea89913319 Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:44:12 +0200 Subject: [PATCH] Fixed gag --- CS2-SimpleAdmin/Events.cs | 8 ++++---- CS2-SimpleAdmin/Helper.cs | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CS2-SimpleAdmin/Events.cs b/CS2-SimpleAdmin/Events.cs index 04b8736..3747c07 100644 --- a/CS2-SimpleAdmin/Events.cs +++ b/CS2-SimpleAdmin/Events.cs @@ -151,10 +151,10 @@ private HookResult OnCommandSayNew(CCSPlayerController? player, CommandInfo info return HookResult.Continue; if (info.GetArg(1).Length == 0) - return HookResult.Handled; - + return HookResult.Stop; + if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence)) - return HookResult.Handled; + return HookResult.Stop; if (command != "say_team" || !info.GetArg(1).StartsWith($"@")) return HookResult.Continue; @@ -178,7 +178,7 @@ private HookResult OnCommandSayNew(CCSPlayerController? player, CommandInfo info } } - return HookResult.Handled; + return HookResult.Stop; } /*public HookResult OnCommandSay(CCSPlayerController? player, CommandInfo info) diff --git a/CS2-SimpleAdmin/Helper.cs b/CS2-SimpleAdmin/Helper.cs index 7f16053..cd23122 100644 --- a/CS2-SimpleAdmin/Helper.cs +++ b/CS2-SimpleAdmin/Helper.cs @@ -607,7 +607,6 @@ public static DateTime ActualDateTime() { TimeZoneInfo timezone = TimeZoneInfo.FindSystemTimeZoneById(timezoneId); DateTime userTime = TimeZoneInfo.ConvertTimeFromUtc(utcNow, timezone); - return userTime; } catch (TimeZoneNotFoundException)