[C++] addChatMessage

whoonga

Active member
Joined
Nov 6, 2014
Messages
52
Reaction score
0
This code is defently not working pls help me!:
Code:
		bool addChatMessage(DWORD textColor, char *text)
		{
			if (m_dwSAMPBase)
			{
				DWORD chatinfo = m_dwSAMPBase + 0x212A6C;
				DWORD func = m_dwSAMPBase + 0x7A4F0;

				__asm mov eax, dword ptr[chatinfo]
				__asm mov ecx, dword ptr[eax]
				__asm push 0
				__asm push textColor
				__asm push 0
				__asm push text
				__asm push 8
				__asm call func
				return true;
			}
		}
 

Bugman

Active member
Joined
Aug 14, 2014
Messages
68
Reaction score
0
Thats the right pointer?  Samp Version
 

whoonga

Active member
Joined
Nov 6, 2014
Messages
52
Reaction score
0
Bugman link said:
Thats the right pointer?  Samp Version
SAMP Version R1
and i think they're right. Or do you have another one?  :imoverit:
 
P

pa0neix

Guest
addMessageToChatWindow for SA:MP 0.3.7

Code:
void addToChatWindow(char *text, DWORD textColor)
{
	if (!m_dwSAMPBase)
		return;
	if (!text)
		return;

	DWORD	chatinfo = m_dwSAMPBase + 0x21A0E4;
	DWORD	func = m_dwSAMPBase + 0x64010;
	
	__asm
	{
		MOV eax, dword ptr[chatinfo]
			MOV ecx, dword ptr[eax]
			PUSH 0
			PUSH textColor
			PUSH 0
			PUSH text
			PUSH 8
			CALL func
	}
}
Code:
void addMessageToChatWindow(DWORD Color, const char *text, ...)
{
	if (m_dwSAMPBase != 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);
	}
}

Enjoy  :urtheman:
 
Top