Rainbow chat
#1

How to make a rainbow chat?

Reply
#2

How would it look like?

Like if you chat your text color is different?
Reply
#3

Lorenc_

Reply
#4

pawn Код:
stock SendRainbowMessage(playerid, const text[]) // RyDeR`
{
new
color_Red,
color_Green,
color_Blue,
string[256]
;
for(new i = strlen(text), j = i; i > 0; --i)
{
color_Red = floatround((0xFF * floatsin((i / (j / 3.0)), radian)));
color_Green = floatround((0xFF / j) * i);
color_Blue = floatround((0xFF / j) * (j - i));

format(string, sizeof(string), "%s{%06x}%c", string, color_Red << 16 | color_Green << 8 | color_Blue, text[j - i]);

if(strlen(string) > 128)
{
SendClientMessage(playerid, -1, string);
string = "";
}
}
return SendClientMessage(playerid, -1, string);
}
Reply
#5

Indeed, here:
http://forum.sa-mp.com/showthread.ph...74#post1112874
Reply
#6

Quote:
Originally Posted by OKStyle
string[256]
*sigh*.... Change that to 128, 150 if you use color embedding.
Reply
#7

Quote:
Originally Posted by OKStyle
Посмотреть сообщение
pawn Код:
stock SendRainbowMessage(playerid, const text[]) // RyDeR`
{
new
color_Red,
color_Green,
color_Blue,
string[256]
;
for(new i = strlen(text), j = i; i > 0; --i)
{
color_Red = floatround((0xFF * floatsin((i / (j / 3.0)), radian)));
color_Green = floatround((0xFF / j) * i);
color_Blue = floatround((0xFF / j) * (j - i));

format(string, sizeof(string), "%s{%06x}%c", string, color_Red << 16 | color_Green << 8 | color_Blue, text[j - i]);

if(strlen(string) > 128)
{
SendClientMessage(playerid, -1, string);
string = "";
}
}
return SendClientMessage(playerid, -1, string);
}

and this ?>


Reply
#8

Quote:
Originally Posted by [ADM]Madon
Посмотреть сообщение
and this ?>


You know you could create your own thread for asking what you want instead of bumping someone's an old thread.

They are textdraws and sprites.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)