- Added custom command to menu
- Better ungag/unmute/unsilence handling
- Fixed css_psay from console
This commit is contained in:
Dawid Bepierszcz
2024-03-02 22:16:38 +01:00
parent 7d5166cf4b
commit da6fb2fc22
8 changed files with 87 additions and 53 deletions

View File

@@ -254,32 +254,37 @@ public partial class CS2_SimpleAdmin
Server.NextFrame(() =>
{
foreach (CCSPlayerController player in Helper.GetValidPlayers())
try
{
if (playerPenaltyManager.IsSlotInPenalties(player.Slot))
foreach (CCSPlayerController player in Helper.GetValidPlayers())
{
if (!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) && !playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
player.VoiceFlags = VoiceFlags.Normal;
if (!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) && !playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
if (playerPenaltyManager.IsSlotInPenalties(player.Slot))
{
if (TagsDetected)
Server.ExecuteCommand($"css_tag_unmute {player!.SteamID}");
}
if (!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) && !playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
player.VoiceFlags = VoiceFlags.Normal;
if (
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence) &&
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) &&
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag)
)
{
player.VoiceFlags = VoiceFlags.Normal;
if (!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) && !playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence))
{
if (TagsDetected)
Server.ExecuteCommand($"css_tag_unmute {player!.SteamID}");
}
if (TagsDetected)
Server.ExecuteCommand($"css_tag_unmute {player!.SteamID}");
if (
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence) &&
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) &&
!playerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag)
)
{
player.VoiceFlags = VoiceFlags.Normal;
if (TagsDetected)
Server.ExecuteCommand($"css_tag_unmute {player!.SteamID}");
}
}
}
}
catch (Exception) { }
});
playerPenaltyManager.RemoveExpiredPenalties();