17.11.2012, 16:35
The problem is the string! If you try to get the hex color as a string. It wont ever work for you anywhere.
You need to get the integer value of the hex color from the string first using the function below.
EDIT:
That function can easily be made! Deleting a 3DTextLabel and Creating it again with the given color , with the same name.
You need to get the integer value of the hex color from the string first using the function below.
pawn Код:
stock hexstr(string[]) // By ******
{
new ret,val,i;
if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) i = 2;
while (string[i])
{
ret <<= 4;
val = string[i++] - '0';
if (val > 0x09) val -= 0x07;
if (val > 0x0F) val -= 0x20;
if (val < 0x01) continue;
if (val < 0x10) ret += val;
}
return ret;
}
That function can easily be made! Deleting a 3DTextLabel and Creating it again with the given color , with the same name.