Changed adminchat to teamchat
This commit is contained in:
parent
90ca6c1ac2
commit
f3a1200492
1 changed files with 15 additions and 1 deletions
16
Events.cs
16
Events.cs
|
|
@ -16,7 +16,7 @@ namespace CS2_SimpleAdmin
|
|||
RegisterListener<OnClientDisconnect>(OnClientDisconnect);
|
||||
RegisterListener<OnMapStart>(OnMapStart);
|
||||
AddCommandListener("say", OnCommandSay);
|
||||
AddCommandListener("say_team", OnCommandSay);
|
||||
AddCommandListener("say_team", OnCommandTeamSay);
|
||||
}
|
||||
|
||||
private HookResult OnCommandSay(CCSPlayerController? player, CommandInfo info)
|
||||
|
|
@ -28,12 +28,26 @@ namespace CS2_SimpleAdmin
|
|||
return HookResult.Handled;
|
||||
}
|
||||
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
private HookResult OnCommandTeamSay(CCSPlayerController? player, CommandInfo info)
|
||||
{
|
||||
if (player == null || !player.IsValid || info.GetArg(1).Length == 0) return HookResult.Continue;
|
||||
|
||||
if (gaggedPlayers.Contains((int)player.Index))
|
||||
{
|
||||
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.Handled;
|
||||
}
|
||||
|
||||
return HookResult.Continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue