08.10.2011, 22:42
Using y_va from YSI. This function returns the formatted string!
Example:
Another thing I just made is strcatf, it appends a formatted string to a string, without using a buffer in-between!
pawn Код:
stock sprintf(szFormat[], va_args<>) {
static
s_szBuffer[512]
;
va_format(s_szBuffer, sizeof (s_szBuffer), szFormat, va_start<1>);
return s_szBuffer;
}
pawn Код:
SendRconCommand(sprintf("weather %d", weather));
pawn Код:
stock strcatf(szDest[], szFormat[], iMaxLength = sizeof(szDest), va_args<>) {
new
iLength = strlen(szDest)
;
va_format(szDest[iLength], iMaxLength - iLength, szFormat, va_start<3>);
}