[HELP] With color in Dialogs
#1

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.
Reply
#2

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

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)