mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Update Events.cs
This commit is contained in:
parent
719caeafef
commit
9712f04e38
1 changed files with 18 additions and 2 deletions
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()}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue