HEX formatting
#1

Just a fast question.
I am trying to make a function called "SendSystemMessage".
Here is what it looks like:
pawn Код:
stock SendSystemMessage(playerid, color, message[])
{
    new string[170];
    format(string,sizeof(string),"{FFFFFF}[{2B78FF}MSG{FFFFFF}] {%x}%s", color, message);
    SendClientMessage(playerid, color, string);
}
My problem is the color implementing (the "{%x}").
The the color is used in the function, it will look something like this:
pawn Код:
SendSystemMessage(playerid, 0x009900FF, "Welcome back!");
But in order to use the color in the string formatting, it needs to look like this: "009900"
I have to remove the "0x" and the last 2 letters within the formatting. How do I do that?
Reply


Messages In This Thread
HEX formatting - by sim_sima - 19.12.2013, 14:15
Re: HEX formatting - by Konstantinos - 19.12.2013, 14:20
Re: HEX formatting - by sim_sima - 19.12.2013, 14:26
Re: HEX formatting - by Konstantinos - 19.12.2013, 14:30
Re: HEX formatting - by sim_sima - 19.12.2013, 14:36
Re: HEX formatting - by Konstantinos - 19.12.2013, 14:41
Re: HEX formatting - by sim_sima - 19.12.2013, 14:43
Re: HEX formatting - by Konstantinos - 19.12.2013, 14:51
Re: HEX formatting - by sim_sima - 19.12.2013, 14:55

Forum Jump:


Users browsing this thread: 5 Guest(s)