void SAMP::addToChatWindow(char *text, DWORD textColor)
{
traceLastFunc("addToChatWindow()");
if (g_pStatic->g_dwSAMPAddr == NULL)
return;
if (!text)
return;
DWORD chatinfo = g_pStatic->g_dwSAMPAddr + 0x21A0E4;
DWORD func = g_pStatic->g_dwSAMPAddr + 0x64010;
__asm
{
MOV eax, dword ptr[chatinfo]
MOV ecx, dword ptr[eax]
PUSH 0
PUSH textColor
PUSH 0
PUSH text
PUSH 8
CALL func
}
}
void SAMP::addMessageToChatWindow(DWORD Color, const char *text, ...)
{
traceLastFunc("addMessageToChatWindow()");
if (g_pStatic->g_dwSAMPAddr != NULL)
{
va_list ap;
if (text == NULL)
return;
char tmp[512];
memset(tmp, 0, 512);
va_start(ap, text);
vsnprintf(tmp, sizeof(tmp) - 1, text, ap);
va_end(ap);
addToChatWindow(tmp, Color);
}
}