Using makros with inline Textdrawcolors? - 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: Using makros with inline Textdrawcolors? (
/showthread.php?tid=630263)
Using makros with inline Textdrawcolors? -
faxxe - 11.03.2017
Ahoy guys
Thats what i have
Код:
#define FIRST_TEAM_COLOR_TAG "{610D96}VIOLET"
format(astring,sizeof(astring),"Team: "#FIRST_TEAM_COLOR_TAG);
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Ingame it looks like: Team: ? 610D96 VIOLET (without any color)
If i do it this way
Код:
format(astring,sizeof(astring),"Team: {610D96}VIOLET ");
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Its fine.
How can i fix my first part to get the same result like in the second, working part?
Re: Using makros with inline Textdrawcolors? -
LeonMrBonnie - 11.03.2017
When defining you have to use hexadecimal colors (the ones that start with 0x)
Re: Using makros with inline Textdrawcolors? -
Toroi - 11.03.2017
Test without the VIOLET in it:
PHP код:
#define FIRST_TEAM_COLOR_TAG "{610D96}"
format(astring,sizeof(astring),"Team: "#FIRST_TEAM_COLOR_TAG" VIOLET");
Re: Using makros with inline Textdrawcolors? -
Vince - 12.03.2017
Textdraw doesn't actually support embedded colors. You're limited to the default colors than can be achieved with ~r~, ~g~, ~b~ etc. You can use TextDrawColor but then it will change the color of the entire string. There's no way to have it start somewhere in the middle.
Re: Using makros with inline Textdrawcolors? -
Toroi - 12.03.2017
I was going to EDIT my thing and say what Vince said, but then I gave a second look to OP post and saw this
Quote:
Originally Posted by faxxe
If i do it this way
Код:
format(astring,sizeof(astring),"Team: {610D96}VIOLET ");
PlayerTextDrawSetString(playerid, TeamText[playerid], astring);
PlayerTextDrawShow(playerid,TeamText[playerid]);
Its fine.
How can i fix my first part to get the same result like in the second, working part?
|
Which got me confused.