View Single Post
DJPlaya
Senior Member
Join Date: Nov 2014
Location: Germany
Old 07-29-2020 , 12:03   Re: [EXTENSION] ConColors (v1.0 12/17/2018) (Windows only)
Reply With Quote #3

Quote:
Originally Posted by enderandrew View Post
Could you do syntax highlighting with this for connect messages in a given color, errors in another color, etc?
Hi again, idk why i always meet you in so many different Threads ^^
Ime not sure, but if i understand correctly, you do can set the Message Color of everything.
Instead of hooking out the connect message and then reprinting it, this should also do the trick(and is a bit simpler):
Code:
OnClientConnect()
{
	SetConsolePrintColor(RED IDK you know what i mean)
	RequestFrame(Frame)
}

public action Frame()
{
	SetConsolePrintColor(Default Color Here)
}
This isent failsafe since every message send in that frame does get colored, but yea.

The only other Way i could think of is hooking the Server Console Print, its propably possible todo this with PTAH or DHooks, here is some Pseudocode:
Code:
OnPluginStart()
{
	PTaH(PTaH_ServerConsolePrint, Hook, ServerConsolePrint);
}

public Action ServerConsolePrint(const char[] sMessage, LoggingSeverity severity)
{
	if(StrCmp(sMessage, "connected")) // Message to highlight goes here
	{
		ColorPrintToServer(BACKGROUND COLOR, FOREGROUND COLOR, sMessage)
		return Plugin_Handled;
	}

	else
		return Plugin_Continue;
}
__________________
My biggest Projects: Kigen AC Redux, Forlix Floodcheck Redux
DJPlaya is offline
Send a message via Skype™ to DJPlaya