SA-MP Forums Archive
[HELP] With color in Dialogs - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] With color in Dialogs (/showthread.php?tid=207186)



[HELP] With color in Dialogs - David91 - 05.01.2011

Hi,
At first I am sorry for my worse English (I'm Czech).
I have some problem with converting color to dialogs.
I need convert color from format 0x008000AA ( got from command GetPlayerColor(playerid); )
to format what i can use in dialogs {008000}
I think something like this:
Код:
stock GetPlayerColorToHex(playerid)
{
GetPlayerColor(playerid);
.
.
.
return hexcolor;    //return in FF0000
}


and then in publics ...

new string[32];
format(string, sizeof(string), "Text{%x}Text in player color ", GetPlayerColorToHex(playerid));
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_MSGBOX,string,"OK","");
But i don't know how to make it.
Could someone help me ? Pleas.
Thanks for all answers.


Re: [HELP] With color in Dialogs - David91 - 06.01.2011

Could someone help me pleas? I am rookie in Pawn...
Thanks.


Re: [HELP] With color in Dialogs - _rAped - 06.01.2011

First of all you haven't defined the variable hexcolor? Second off you haven't made HexColor return the GetPlayerColor


Re: [HELP] With color in Dialogs - David91 - 06.01.2011

Quote:
Originally Posted by _rAped
Посмотреть сообщение
First of all you haven't defined the variable hexcolor? Second off you haven't made HexColor return the GetPlayerColor
Thanks for your ansver.
Sure i have defined hexcolor (this stock was only for demonstration what I need) but thanks for notice.
But I do not know how can i get return in format compatibile with dialog from command GetPlayerColor.

If I use :
Код:
new string[64];
format(string, sizeof(string), "%x", GetPlayerColor(playerid));
To inserts a number in hexadecimal notation. I'll get from 0x008000AA only 8000AA but it is different color what I need.
What is wrong in this simple function?