Posts: 363
Threads: 90
Joined: Nov 2010
Reputation:
0
Hi!
I wanted to know how to change color in determined texts...
Like "Hi guys! *-Moving my hand-*
How can I change the color of the text that is into the * * ?
Thanks
Posts: 2,593
Threads: 34
Joined: Dec 2007
Posts: 363
Threads: 90
Joined: Nov 2010
Reputation:
0
I know how to do that...
But I want to do when a player send a message like "Hello *-Raising the hand-*" and the text in ** in purple! I don't know how to do that.
Posts: 363
Threads: 90
Joined: Nov 2010
Reputation:
0
I KNOW THAT.
I want to Know if someone write something into ** THAT becomes purple!!
This on OnPlayerChat!!!
Posts: 450
Threads: 52
Joined: Jun 2012
Reputation:
0
Hmm.. I'll make something and post in a few minutes, will not test it though.
Posts: 734
Threads: 8
Joined: Jun 2009
Well yours *untested* function gave me cryptic crashdetect errors,
anyways here alanhutch, try this:
pawn Code:
stock FilterAsterisk(msg[], msglen = sizeof(msg))
{
new i = 0, asteriskPair = 0;
while (msg[i] != '\0')
{
if (msg[i] == '*')
{
if (asteriskPair == 0)
{
asteriskPair++;
strdel(msg, i, i+1);
strins(msg, "{800080}", i, msglen);
}
else
{
asteriskPair = 0;
strdel(msg, i, i+1);
strins(msg, "{FFFFFF}", i, msglen);
}
}
i++;
}
}
Use it like "FilterAsterisk(text)" though I suggest create a new array under OnPlayerText 144 cells long to hold this new formatted text.