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 (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;
|
player.VoiceFlags = VoiceFlags.Normal;
|
||||||
|
|
||||||
MuteManager _muteManager = new(dbConnectionString);
|
//MuteManager _muteManager = new(dbConnectionString);
|
||||||
_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
//_ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 1);
|
||||||
}, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
}, 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)
|
if (TagsDetected)
|
||||||
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.Index.ToString()}");
|
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.Index.ToString()}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue