Securing Your Server Without Master Server Authentication - Very handy scripts provided by FunkySwerve
For colored chat text, I personally use an include file to add a ColorText() function in my module's OnPlayerChat script. I have the chat script look for specific characters at the start of the entered text (// double slashes for grey "OOC" text, .. double periods for "emotes"), then colorize the rest of the text string before replacing the output text (SetChatMessage()?).
I'll see about digging into my chat script to try to dig up the specific code for the text coloring. It's embedded somewhere in the middle of about 1000 lines of code.
Not sure on the original source of the include file...probably a generous poster on the old BioWare boards. I've been using it for years.
Edit: Forum seem to be able to properly handle the code for the include file. Link:
inc_colortext.nss (right-click and "Save Link As..." to download.
color chat sample
// Colorized Onchat text
// merge into your own onplayerchat script
#include "inc_colortext"
void main()
{
string sInput = GetPCChatMessage();
string sFirst = GetStringLeft(sInput, 1);
string sLast = GetStringRight(sInput, 1);
if (sFirst == "*" && sLast == "*") // Special Text Type 1
{
sInput = ColorText(sInput, 255, 0, 255);
SetPCChatMessage(sInput);
}
else if (sFirst == "(" && sLast == ")") // Special Text Type 2
{
sInput = ColorText(sInput, 200, 200, 200);
SetPCChatMessage(sInput);
}
}
Modifié par The Amethyst Dragon, 08 novembre 2011 - 07:50 .