14.06.2011, 11:13
How to make a rainbow chat?

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);
}
Originally Posted by OKStyle
string[256]
|
pawn Код:
|