SA-MP Forums Archive
0xFFFFFFAA to {FFFFFF} - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 0xFFFFFFAA to {FFFFFF} (/showthread.php?tid=600312)



0xFFFFFFAA to {FFFFFF} - YouServ - 06.02.2016

Hi,

I have a variable "Color" contains 0xFFFFFFAA. I want to transform contains to "{FFFFFF}". How ?

PHP код:
SendClientMessageEx(playerid, -1"{%06x}test"ClanInfoPlayerInfo[playerid][pClan] ][Couleur] >>> 8); 
This script don't work, why ?


Re: 0xFFFFFFAA to {FFFFFF} - YouServ - 06.02.2016

Fixed.

Maked a little function :

PHP код:
stock GetColor(string[])
{
    new
        
new_string[124],
        
new_string2[124];
        
    
strmid(new_stringstring28);
    
format(new_string2sizeof(new_string2), "{%s}"new_string);
    return 
new_string2;

----------------------------------------
PHP код:
GetColor(0x00767CFF); 
return
Код:
{00767C}



Re: 0xFFFFFFAA to {FFFFFF} - AbyssMorgan - 06.02.2016

Faster
PHP код:
stock GetColor(color){
    new 
string[10];
    
format(string,sizeof(string),"{%06x}",(color >>> 8));
    return 
string;