mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 10:43:23 +00:00
1.7.3a
【UPDATE 1.7.3a】
🆕 What's new and what's changed:
- Fixed problem when you can't add admin because of the same group names on multiple servers from now on it takes in order -> server id and if there is no -> global
- Added ability to add penalties via SteamID
- Added ability to display penalty messages only for admins (ShowActivityType = 3)
- Reverted OnClientConnect to EventPlayerFullConnect
This commit is contained in:
@@ -409,8 +409,19 @@ internal static class Helper
|
||||
// _ => arg
|
||||
// };
|
||||
// }
|
||||
var validPlayers = GetValidPlayers().Where(c => c is { IsValid: true, IsBot: false });
|
||||
|
||||
foreach (var controller in GetValidPlayers().Where(c => c is { IsValid: true, IsBot: false }))
|
||||
if (!validPlayers.Any())
|
||||
return;
|
||||
|
||||
if (CS2_SimpleAdmin.Instance.Config.OtherSettings.ShowActivityType == 3)
|
||||
{
|
||||
validPlayers = validPlayers.Where(c =>
|
||||
AdminManager.PlayerHasPermissions(new SteamID(c.SteamID), "@css/kick") ||
|
||||
AdminManager.PlayerHasPermissions(new SteamID(c.SteamID), "@css/ban"));
|
||||
}
|
||||
|
||||
foreach (var controller in validPlayers.ToList())
|
||||
{
|
||||
var currentMessageArgs = (string[])formattedMessageArgs.Clone();
|
||||
|
||||
@@ -421,8 +432,7 @@ internal static class Helper
|
||||
currentMessageArgs[i] = CS2_SimpleAdmin.Instance.Config.OtherSettings.ShowActivityType switch
|
||||
{
|
||||
1 => arg.Replace("CALLER", AdminManager.PlayerHasPermissions(new SteamID(controller.SteamID), "@css/kick") || AdminManager.PlayerHasPermissions(new SteamID(controller.SteamID), "@css/ban") ? callerName : CS2_SimpleAdmin._localizer["sa_admin"]),
|
||||
2 => arg.Replace("CALLER", callerName ?? CS2_SimpleAdmin._localizer["sa_console"]),
|
||||
_ => arg
|
||||
_ => arg.Replace("CALLER", callerName ?? CS2_SimpleAdmin._localizer["sa_console"]),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -452,7 +462,6 @@ internal static class Helper
|
||||
formattedMessageArgs[i] = CS2_SimpleAdmin.Instance.Config.OtherSettings.ShowActivityType switch
|
||||
{
|
||||
1 => arg.Replace("CALLER", CS2_SimpleAdmin._localizer["sa_admin"]),
|
||||
2 => arg.Replace("CALLER", callerName ?? CS2_SimpleAdmin._localizer["sa_console"]),
|
||||
_ => arg
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user