19.12.2013, 14:15
Just a fast question.
I am trying to make a function called "SendSystemMessage".
Here is what it looks like:
My problem is the color implementing (the "{%x}").
The the color is used in the function, it will look something like this:
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?
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);
}
The the color is used in the function, it will look something like this:
pawn Код:
SendSystemMessage(playerid, 0x009900FF, "Welcome back!");
I have to remove the "0x" and the last 2 letters within the formatting. How do I do that?