Prevent basecommands from printing to disconnected clients (#1138)

This commit is contained in:
sneak-it 2020-02-07 01:32:16 -05:00 committed by Asher Baker
parent c6df989061
commit 6d3e4e756f

View File

@ -395,10 +395,15 @@ public Action Command_Rcon(int client, int args)
if (client == 0) // They will already see the response in the console. if (client == 0) // They will already see the response in the console.
{ {
ServerCommand("%s", argstring); ServerCommand("%s", argstring);
} else { }
else
{
char responseBuffer[4096]; char responseBuffer[4096];
ServerCommandEx(responseBuffer, sizeof(responseBuffer), "%s", argstring); ServerCommandEx(responseBuffer, sizeof(responseBuffer), "%s", argstring);
ReplyToCommand(client, responseBuffer); if (IsClientConnected(client))
{
ReplyToCommand(client, responseBuffer);
}
} }
return Plugin_Handled; return Plugin_Handled;