Thread: [Project]C2
View Single Post
Old 05.12.2006, 20:41   #11
HongK
Архивный участник
 
Join Date: Jun 2005
Posts: 258
Default

For debugging purposes or if you are just generally interested in outputting text to the server console, you can use this function:

Code:
void ConsoleMessage(WCHAR * pMessage)
{

	DWORD message = (DWORD)pMessage;
	__asm
	{
		push	message
		push	0		//Message colors: 0 for black, 2 for red
		push	18AA81D8h
		call	LOG_ADD		//DWORD * to address of log_add function
		add	esp, 0Ch	//fix stack pointer
	}

}
You'll need to create a pointer to the address of the log function elsewhere like in a header file. The address is 0x0053EEE0. That function will accept a WCHAR * for text you want to have displayed in l2Servers console.

Possible reasons for wanting to do this:

1. Just to look cool when loading ExUser lol

2. Debugging

3. Prompting admins when something bad happens or whatever your mind can think of
HongK is offline