Rainbow text
#3

pawn Код:
GetColor(colorcount)
{
    static const Colors[] = {
        0x0071BD00,
        0xFF00FE00,
        0x78227D00,
        0x00930900,
        0x00FF0100,
        0xFFFF0400,
        0xFACB0100,
        0xFF7C0000,
        0xFE000000,
        0xD5030400
    };

    if(colorcount >= sizeof(Colors)) return -1;

    return (Colors[colorcount] >>> 8);
}

CMD:announce(playerid,params[])
{
    if(!IsPlayerAdminLevel(playerid, 1)) SendClientMessage(playerid, RED, "You Have To Be Admin To Use This Command");
    else if(isnull(params)) SendClientMessage(playerid, RED, "SYNTAX /announce [text]");
    else{
        new str[144],name[MAX_PLAYER_NAME + 1],pos,colorcount,color[9];
        strcat(str,params);
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        while((pos = strfind(str," ",true,pos+1))
        {
            colorcount %= 10;
            format(color,sizeof color,"{%06x}",GetColor(colorcount++));
            strins(str,color,pos+1);
        }
        format(string,sizeof str,"[ADMIN:%s] %s",name,str);
        SendClientMessageToAll(PINK, str);
        SendClientMessage(playerid, LIGHTBLUE, "MessageSent");
    }
    return 1;
}
Chat supports only 144 characters.
Reply


Messages In This Thread
Rainbow text - by horsemeat - 15.09.2013, 15:21
Re: Rainbow text - by Luis- - 15.09.2013, 15:22
Re: Rainbow text - by Jefff - 15.09.2013, 16:34
Re: Rainbow text - by horsemeat - 15.09.2013, 16:59
Re: Rainbow text - by Jefff - 15.09.2013, 17:00
Re: Rainbow text - by Konstantinos - 15.09.2013, 17:05
Re: Rainbow text - by horsemeat - 15.09.2013, 17:15
Re: Rainbow text - by Jefff - 15.09.2013, 17:26
Re: Rainbow text - by horsemeat - 15.09.2013, 17:39
Re: Rainbow text - by Jefff - 15.09.2013, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)