🆕  **What's new and what's changed:**
```diff
+ Added `css_hidecomms` command - Disable showing penalties when player connect
+ Added customizable commands in `Commands.json` file in plugin config directory
  - U can disable command by removing aliases or rename/add more aliases (remember to not remove key, edit only Aliases)
+ Added missing `Console` translation `sa_console`
+ Added `LogCommand` to api
```
This commit is contained in:
Dawid Bepierszcz
2024-09-29 18:29:04 +02:00
parent 702a0315b8
commit 32520c7e84
19 changed files with 361 additions and 207 deletions

View File

@@ -180,43 +180,12 @@ public class PlayerManager
}
}
/*
if (CS2_SimpleAdmin._localizer != null)
{
if (mutesList[PenaltyType.Gag].Count == 0)
mutesList[PenaltyType.Gag].Add(CS2_SimpleAdmin._localizer["sa_player_penalty_info_no_active_gag"]);
if (mutesList[PenaltyType.Mute].Count == 0)
mutesList[PenaltyType.Mute].Add(CS2_SimpleAdmin._localizer["sa_player_penalty_info_no_active_mute"]);
if (mutesList[PenaltyType.Silence].Count == 0)
mutesList[PenaltyType.Silence].Add(CS2_SimpleAdmin._localizer["sa_player_penalty_info_no_active_silence"]);
}
*/
/*
await Server.NextFrameAsync(() =>
{
CS2_SimpleAdmin.Instance.AddTimer(3.0f, () =>
{
player.SendLocalizedMessage(CS2_SimpleAdmin._localizer, "sa_player_penalty_info",
[
player.PlayerName,
CS2_SimpleAdmin.PlayersInfo[userId].TotalBans,
CS2_SimpleAdmin.PlayersInfo[userId].TotalGags,
CS2_SimpleAdmin.PlayersInfo[userId].TotalMutes,
CS2_SimpleAdmin.PlayersInfo[userId].TotalSilences,
CS2_SimpleAdmin.PlayersInfo[userId].TotalWarns,
string.Join("\n", mutesList.SelectMany(kvp => kvp.Value)),
string.Join("\n", warnsList)
]);
});
*/
await Server.NextFrameAsync(() =>
{
foreach (var admin in Helper.GetValidPlayers()
.Where(p => (AdminManager.PlayerHasPermissions(p, "@css/kick") ||
AdminManager.PlayerHasPermissions(p, "@css/ban")) &&
p.Connected == PlayerConnectedState.PlayerConnected))
p.Connected == PlayerConnectedState.PlayerConnected && !CS2_SimpleAdmin.AdminDisabledJoinComms.Contains(p.SteamID)))
{
if (CS2_SimpleAdmin._localizer != null && admin != player)
admin.SendLocalizedMessage(CS2_SimpleAdmin._localizer, "sa_admin_penalty_info",