Add PrintToConsoleAll (#601)

This commit is contained in:
Michael Flaherty 2017-04-18 04:29:47 -07:00 committed by Nicholas Hastings
parent e880471296
commit a36dafb906

View File

@ -210,6 +210,28 @@ native void PrintToServer(const char[] format, any ...);
*/
native void PrintToConsole(int client, const char[] format, any ...);
/**
* Sends a message to every client's console.
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
stock void PrintToConsoleAll(const char[] format, any ...)
{
char buffer[254];
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
SetGlobalTransTarget(i);
VFormat(buffer, sizeof(buffer), format, 2);
PrintToConsole(i, "%s", buffer);
}
}
}
/**
* Reples to a message in a command.
*