css_asay and @message

This commit is contained in:
daffyyyy
2023-12-06 02:39:08 +01:00
parent fdbf1b1a5c
commit 29fe968155
3 changed files with 30 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Admin;
using CounterStrikeSharp.API.Modules.Commands;
using CounterStrikeSharp.API.Modules.Entities;
using CounterStrikeSharp.API.Modules.Utils;
using static CounterStrikeSharp.API.Core.Listeners;
namespace CS2_SimpleAdmin
@@ -26,6 +28,14 @@ namespace CS2_SimpleAdmin
return HookResult.Handled;
}
if (info.GetArg(1).StartsWith("@") && AdminManager.PlayerHasPermissions(player, "@css/chat"))
{
foreach (var p in Utilities.GetPlayers().Where(p => p.IsValid && !p.IsBot && !p.IsHLTV && AdminManager.PlayerHasPermissions(p, "@css/chat")))
{
p.PrintToChat($" {ChatColors.Lime}(ADMIN) {ChatColors.Default}{player.PlayerName}: {info.GetArg(1)}");
}
}
return HookResult.Continue;
}