ColouredText not work !
#4

try this

Код:
stock ColouredText(text[]) 
{ 
    enum 
        colorEnum 
        { 
            colorName[16], 
            colorID[7] 
        } 
    ; 
    new 
        colorInfo[][colorEnum] = 
        { 
            { "BLUE",           "0x1B1BE0" }, 
            { "PINK",           "0xE81CC9" }, 
            { "YELLOW",         "0xDBED15" }, 
            { "LIGHTGREEN",     "0x8CED15" }, 
            { "LIGHTBLUE",      "0x15D4ED" }, 
            { "RED",            "0xFF0000" }, 
            { "GREY",           "0xBABABA" }, 
            { "WHITE",          "0xFFFFFF" }, 
            { "ORANGE",         "0xDB881A" }, 
            { "GREEN",          "0x37DB45" }, 
            { "PURPLE",         "0x7340DB" } 
        }, 
        string[(128 + 32)], 
        tempString[16], 
        pos = -1, 
        x 
    ; 
    strmid(string, text, 0, 128, sizeof(string)); 

    for( ; x != sizeof(colorInfo); ++x) 
    { 
        format(tempString, sizeof(tempString), "#%s", colorInfo[x][colorName]); 

        while((pos = strfind(string, tempString, true, (pos + 1))) != -1) 
        { 
            new 
                tempLen = strlen(tempString), 
                tempVar, 
                i = pos 
            ; 
            format(tempString, sizeof(tempString), "{%s}", colorInfo[x][colorID]); 

            if(tempLen < 8) 
            { 
                for(new j; j != (8 - tempLen); ++j) 
                { 
                    strins(string, " ", pos); 
                } 
            } 
            for( ; ((string[i] != 0) && (tempVar != 8)) ; ++i, ++tempVar) 
            { 
                string[i] = tempString[tempVar]; 
            } 
            if(tempLen > 8) 
            { 
                strdel(string, i, (i + (tempLen - 8))); 
            } 
            x = -1; 
        } 
    } 
    return string; 
}
Reply


Messages In This Thread
ColouredText not work ! - by tal_peretz - 28.06.2011, 00:12
Re: ColouredText not work ! - by =WoR=Varth - 28.06.2011, 00:25
Re: ColouredText not work ! - by tal_peretz - 28.06.2011, 09:31
Re: ColouredText not work ! - by CrazyBlob - 28.06.2011, 10:49
Re: ColouredText not work ! - by tal_peretz - 28.06.2011, 11:15
Re: ColouredText not work ! - by tal_peretz - 28.06.2011, 12:19
Re: ColouredText not work ! - by tal_peretz - 28.06.2011, 20:28
Re: ColouredText not work ! - by tal_peretz - 29.06.2011, 11:14
Re: ColouredText not work ! - by tal_peretz - 29.06.2011, 12:04

Forum Jump:


Users browsing this thread: 1 Guest(s)