Prevent basecommands from printing to disconnected clients (#1138)

This commit is contained in:
sneak-it
2020-02-06 22:32:16 -08:00
committed by GitHub
parent 4a8c869b7e
commit b6a6387f16
+7 -2
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;