2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2024-12-28 15:45:37 +03:00
metamod-r/metamod/src/sdk_util.cpp

29 lines
563 B
C++
Raw Normal View History

2016-07-26 03:22:47 +03:00
#include "precompiled.h"
2016-07-26 19:31:47 +03:00
char *UTIL_VarArgs(char *format, ...)
2016-07-26 03:22:47 +03:00
{
2016-07-26 19:31:47 +03:00
va_list argptr;
static char string[1024];
2016-07-26 03:22:47 +03:00
va_start(argptr, format);
2016-07-26 19:31:47 +03:00
Q_vsnprintf(string, sizeof(string), format, argptr);
2016-07-26 03:22:47 +03:00
va_end(argptr);
return string;
}
// UTIL_LogPrintf - Prints a logged message to console.
// Preceded by LOG: ( timestamp ) < message >
void UTIL_LogPrintf(char *fmt, ...)
2016-07-26 03:22:47 +03:00
{
2016-07-26 19:31:47 +03:00
va_list argptr;
2017-01-06 22:33:36 +03:00
char string[1024];
2016-07-26 03:22:47 +03:00
va_start(argptr, fmt);
2016-07-26 19:31:47 +03:00
Q_vsnprintf(string, sizeof(string), fmt, argptr);
va_end(argptr);
2016-07-26 03:22:47 +03:00
// Print to server console
ALERT(at_logged, "%s", string);
2016-07-26 03:22:47 +03:00
}