- Added `ReloadAdminsEveryMapChange` - Reloading sql admins on map start
- Ability to use any valid steamid instead of steamid64
- Fixed chat commands when gagged
- Votes now respect `UseChatMenu` config setting
This commit is contained in:
Dawid Bepierszcz
2024-06-09 17:55:33 +02:00
parent 962529e445
commit 00facafdcb
13 changed files with 105 additions and 62 deletions

View File

@@ -205,8 +205,11 @@ public partial class CS2_SimpleAdmin
public HookResult OnCommandSay(CCSPlayerController? player, CommandInfo info)
{
if (player is null || !player.IsValid || player.IsBot || player.IsHLTV || info.GetArg(1).StartsWith($"/")
|| info.GetArg(1).StartsWith($"!") && info.GetArg(1).Length >= 12)
if (player is null || !player.IsValid || player.IsBot || player.IsHLTV)
return HookResult.Continue;
if (info.GetArg(1).StartsWith($"/")
|| info.GetArg(1).StartsWith($"!"))
return HookResult.Continue;
if (info.GetArg(1).Length == 0)
@@ -220,8 +223,11 @@ public partial class CS2_SimpleAdmin
public HookResult OnCommandTeamSay(CCSPlayerController? player, CommandInfo info)
{
if (player is null || !player.IsValid || player.IsBot || player.IsHLTV || info.GetArg(1).StartsWith($"/")
|| info.GetArg(1).StartsWith($"!") && info.GetArg(1).Length >= 12)
if (player is null || !player.IsValid || player.IsBot || player.IsHLTV )
return HookResult.Continue;
if (info.GetArg(1).StartsWith($"/")
|| info.GetArg(1).StartsWith($"!"))
return HookResult.Continue;
if (info.GetArg(1).Length == 0)
@@ -257,6 +263,9 @@ public partial class CS2_SimpleAdmin
public void OnMapStart(string mapName)
{
if (Config.ReloadAdminsEveryMapChange)
AddTimer(3.0f, () => ReloadAdmins(null));
var path = Path.GetDirectoryName(ModuleDirectory);
if (Directory.Exists(path + "/CS2-Tags"))
{