/me integrated on line chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /me integrated on line chat (
/showthread.php?tid=449093)
/me integrated on line chat -
Sk1lleD - 07.07.2013
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.
Re: /me integrated on line chat -
Konstantinos - 07.07.2013
https://sampwiki.blast.hk/wiki/Colors_List#Color_embedding
Re: /me integrated on line chat -
Sk1lleD - 07.07.2013
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
Re: /me integrated on line chat -
Sk1lleD - 07.07.2013
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 ?
Re: /me integrated on line chat -
Sk1lleD - 09.07.2013
Up.. someone can help me?