mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 02:41:55 +00:00
Update Events.cs
This commit is contained in:
20
Events.cs
20
Events.cs
@@ -193,10 +193,18 @@ namespace CS2_SimpleAdmin
|
||||
{
|
||||
if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return;
|
||||
|
||||
if (mutedPlayers.Contains((int)player.Index))
|
||||
{
|
||||
if (mutedPlayers.TryTake(out int removedItem) && removedItem != (int)player.Index)
|
||||
{
|
||||
mutedPlayers.Add(removedItem);
|
||||
}
|
||||
}
|
||||
|
||||
player.VoiceFlags = VoiceFlags.Normal;
|
||||
|
||||
MuteManager _muteManager = new(dbConnectionString);
|
||||
_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
||||
//MuteManager _muteManager = new(dbConnectionString);
|
||||
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
||||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||
}
|
||||
}
|
||||
@@ -220,6 +228,14 @@ namespace CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
|
||||
if (mutedPlayers.Contains((int)player.Index))
|
||||
{
|
||||
if (mutedPlayers.TryTake(out int removedItem) && removedItem != (int)player.Index)
|
||||
{
|
||||
mutedPlayers.Add(removedItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (TagsDetected)
|
||||
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.Index.ToString()}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user