/me integrated on line chat
#1

Hello everyone,
I've been trying to make an "integrated" /me on the chat, but i'm just failing.
I've tried to use str_replace but nothing...
What I want is something like this:

Hi, how are you? *-Smiling-*
Now i've lost the code that I used, what it need to do is to change colore between the * * making the chat text purple, and after the second * back to white like:
Hi, how are you? *-Smiling-* It's ages from the last time we met.
Reply
#2

https://sampwiki.blast.hk/wiki/Colors_List#Color_embedding
Reply
#3

I've used:
Код:
str_replace("*-", "*-{C2A2DA}", text); //text is the string from OnPlayerText
str_replace("-*", "-*{C8C8C8}", text);
But the text still be only white when the message is sent
Reply
#4

I've done this:
Код:
if(strfind(text, "*-", true) != -1)
			    {
					format(stringx, sizeof(stringx), "%s", str_replace("*-", "{C2A2DA}*-", text));
					if(strfind(stringx, "-*", true) != -1)
					{
					    format(stringy, sizeof(stringy), "%s", str_replace("-*", "-*{C8C8C8}", stringx));
					}
					else
					{
					    format(stringy, sizeof(stringy), "%s", stringx);
					}
			    }
				else
				{
				    format(stringy, sizeof(stringy), "%s", text);
				}
				format(string, sizeof(string), "Sconosciuto dice: %s", stringy);
And it works like this:
Hi *-Smiling-*
But when I try to use more *- -* the 2nd, 3rd etc.. doesn't change color like this:
Hi *-Smiling-* How are you? *-Smiling again-*
Can anyone help ?
Reply
#5

Up.. someone can help me?
Reply


Forum Jump:


Users browsing this thread: