CounterStrikeSharp
CounterStrikeSharp copied to clipboard
EventPlayerChat.Text only includes the first piece of a say bind
Given a bind is created as bind <key> say multiple space separated words or bind <key> say "multiple space separated words"
NOTE The bind "appears" to remove the quotes around the message in the say command, the chat box interprets say with n arguments as space separated
https://github.com/roflmuffin/CounterStrikeSharp/blob/7b45a884d461c362f21f6aa101515a3757402795/src/core/managers/chat_manager.cpp#L65
I've fixed this in one of my plugins where I listen to the say and say_team commands (src below), but as a result of issues with RemoveCommandListener, I'm trying to replicate the same behavior in the event handler instead.
public static string GetArgRest(this CommandInfo info, int startIndex)
{
var args = new List<string>();
while (startIndex < info.ArgCount)
args.Add(info.GetArg(startIndex++));
return string.Join(" ", args);
}