revert: range syntax instead of Substring

This commit is contained in:
StefanX
2023-12-03 18:19:33 +02:00
parent bce6bd4348
commit 86378324a7

View File

@@ -296,7 +296,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
[RequiresPermissions("@css/chat")] [RequiresPermissions("@css/chat")]
public void OnAdminSayCommand(CCSPlayerController? caller, CommandInfo command) public void OnAdminSayCommand(CCSPlayerController? caller, CommandInfo command)
{ {
Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Messages.AdminSayPrefix}".Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName) + command.GetCommandString.Substring(command.GetCommandString.IndexOf(' ')))); Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Messages.AdminSayPrefix}".Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName) + command.GetCommandString[command.GetCommandString.IndexOf(' ')..]));
} }
[ConsoleCommand("css_psay", "Private message a player.")] [ConsoleCommand("css_psay", "Private message a player.")]