ColouredText not work !
#1

That what I did -

PHP код:
    new text2[256], Length strlen(string);
     if(
Length 135)
     {
     if(
Length 270) return scm(playeridred"!too long"), 0;
          new 
string21024 ];
          new 
string31024 ];
          
//
          
strmid(text2string0Length 2);
          
format(string2sizeof(string2), "%s"text2);
          
scmToAll(0xFFFFFFAA,ColouredText(string2));
          
          
strmid(text2stringLength 2Length);
          
format(string3sizeof(string3), "%s"text2);
          
scmToAll(0xFFFFFFAA,ColouredText(string3));
     }
     else
     
scmToAll(redColouredText(string)); 
This is the function that I seen here -


PHP код:
stock ColouredText(text[])
{
    
enum
        colorEnum
        
{
            
colorName[16],
            
colorID[7]
        }
    ;
    new
        
colorInfo[][colorEnum] =
        {
            { 
"BLUE",           "1B1BE0" },
            { 
"PINK",           "E81CC9" },
            { 
"YELLOW",         "DBED15" },
            { 
"LIGHTGREEN",     "8CED15" },
            { 
"LIGHTBLUE",      "15D4ED" },
            { 
"RED",            "FF0000" },
            { 
"GREY",           "BABABA" },
            { 
"WHITE",          "FFFFFF" },
            { 
"ORANGE",         "DB881A" },
            { 
"GREEN",          "37DB45" },
            { 
"PURPLE",         "7340DB" }
        },
        
string[(128 32)],
        
tempString[16],
        
pos = -1,
        
x
    
;
    
strmid(stringtext0128sizeof(string));
    for( ; 
!= sizeof(colorInfo); ++x)
    {
        
format(tempStringsizeof(tempString), "#%s"colorInfo[x][colorName]);
        while((
pos strfind(stringtempStringtrue, (pos 1))) != -1)
        {
            new
                
tempLen strlen(tempString),
                
tempVar,
                
pos
            
;
            
format(tempStringsizeof(tempString), "{%s}"colorInfo[x][colorID]);
            if(
tempLen 8)
            {
                for(new 
j!= (tempLen); ++j)
                {
                    
strins(string" "pos);
                }
            }
            for( ; ((
string[i] != 0) && (tempVar != 8)) ; ++i, ++tempVar)
            {
                
string[i] = tempString[tempVar];
            }
            if(
tempLen 8)
            {
                
strdel(stringi, (+ (tempLen 8)));
            }
            
= -1;
        }
    }
    return 
string;

The problem - I doing "(red) check" and the message sending regulary, without the red color, why ?

THANKS !
Reply
#2

You missed 0x.
pawn Код:
0xFF0000
Reply
#3

Where? O.O
Reply
#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
#5

I think you don't know what are you talking about ....... the ColouredText writing without 0x..

and it's give me error to -
error 018: initialization data exceeds declared size
{ "BLUE", "0x1B1BE0" },
Reply
#6

I changed it to my colors -

PHP код:
new const cArray[][2][]=
{
    {
"BLUE",        "1B1BE0"},
    {
"PINK",       "E81CC9"},
    {
"YELLOW",      "DBED15"},
    {
"LIGHTGREEN",     "8CED15"},
    {
"LIGHTBLUE",     "15D4ED"},
    {
"RED",       "FF0000"},
    {
"GREY",     "BABABA"},
    {
"WHITE",      "FFFFFF"},
    {
"ORANGE",      "DB881A"},
    {
"GREEN",       "37DB45"},
    {
"PURPLE",     "7340DB"}
}; 
when I do (red) check it's don't send the message .......

when I write regular message it's send wird message :X
Reply
#7

JUMP

The stock that I gave here is good but what I do, not good, but why? :\
Reply
#8

JUMP
Reply
#9

You good man
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)