mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 10:43:23 +00:00
1.4.5a
- 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:
17
Events.cs
17
Events.cs
@@ -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"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user