Temp fix for command messages
This commit is contained in:
parent
dbd2f7e348
commit
c78c503cad
1 changed files with 17 additions and 0 deletions
17
CS2-Tags.cs
17
CS2-Tags.cs
|
|
@ -111,6 +111,14 @@ public class CS2_Tags : BasePlugin
|
|||
|
||||
Server.PrintToChatAll(ReplaceTags($" {prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}"));
|
||||
|
||||
if (info.GetArg(1).StartsWith("!"))
|
||||
{
|
||||
CBasePlayerPawn pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex((int)player.EntityIndex!.Value.Value));
|
||||
var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value;
|
||||
|
||||
NativeAPI.IssueClientCommand(playerIndex, $"css_{info.GetArg(1).Replace("!", "")}");
|
||||
}
|
||||
|
||||
return HookResult.Handled;
|
||||
}
|
||||
|
||||
|
|
@ -128,8 +136,17 @@ public class CS2_Tags : BasePlugin
|
|||
string prefix = permissionTag["prefix"]?.ToString() ?? "";
|
||||
string nickColor = permissionTag["nick_color"]?.ToString() ?? "";
|
||||
string messageColor = permissionTag["message_color"]?.ToString() ?? "";
|
||||
|
||||
Server.PrintToChatAll(ReplaceTags($" {prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}"));
|
||||
|
||||
if (info.GetArg(1).StartsWith("!"))
|
||||
{
|
||||
CBasePlayerPawn pawn = new CBasePlayerPawn(NativeAPI.GetEntityFromIndex((int)player.EntityIndex!.Value.Value));
|
||||
var playerIndex = (int)pawn.Controller.Value.EntityIndex!.Value.Value;
|
||||
|
||||
NativeAPI.IssueClientCommand(playerIndex, $"css_{info.GetArg(1).Replace("!", "")}");
|
||||
}
|
||||
|
||||
return HookResult.Handled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue