30.08.2012, 06:46
Hi guys
Finally I found the "IntToHex" function, and when I use it to convert colors like: 0xFFFFFFFF into HEX colors, like 'FFFFFF' it gave me errors:
Lines:
And here is the "IntToHex" function:
What is the problem?
Finally I found the "IntToHex" function, and when I use it to convert colors like: 0xFFFFFFFF into HEX colors, like 'FFFFFF' it gave me errors:
Код:
D:\RAS\Build 26\gamemodes\RAS.pwn(11477) : error 035: argument type mismatch (argument 1) D:\RAS\Build 26\gamemodes\RAS.pwn(11477) : error 006: must be assigned to an array D:\RAS\Build 26\gamemodes\RAS.pwn(13648) : error 006: must be assigned to an array
Код:
11477: mysql_get_field( "ChatColor", Field ); PlayerInfo[ extraid ][ p_TextColor ] = IntToHex( Field ); 13648: PlayerInfo[ playerid ][ p_TextColor ] = IntToHex( 0xFFFFFFFF );
pawn Код:
stock IntToHex( number )
{
new
m = 1,
depth = 0
;
while ( number >= m )
{
m = m*16;
depth++;
}
depth--;
new
str[ 125 ]
;
for ( new i = depth; i >= 0; i-- )
{
str[i] = ( number & 0x0F) + 0x30; // + (tmp > 9 ? 0x07 : 0x00)
str[i] += (str[i] > '9') ? 0x07 : 0x00;
number >>= 4;
}
str[ 8 ] = '\0';
return str;
}