How to do this?(Dialog, string, color) -
geerdinho8 - 09.01.2016
Код:
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COL_ORANGE "{FF9900AA}"
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ""COL_WHITE"Welcome back "COL_ORANGE"%s. "COL_WHITE"Type your password below to login.",name);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_ORANGE"Login",string,"Login","Quit");
As you can see i want to use the string AND different colors in the string.
Anyone has an idea how to do this?
Respuesta: How to do this?(Dialog, string, color) -
Cepillado - 09.01.2016
I don't get it. The colors aren't showing up? In the code that you posted you are already using a string and different colors.
Also, I'm pretty sure that you'll need more length than just 48 characters for your string.
Re: Respuesta: How to do this?(Dialog, string, color) -
geerdinho8 - 09.01.2016
Quote:
Originally Posted by Cepillado
I don't get it. The colors aren't showing up? In the code that you posted you are already using a string and different colors.
Also, I'm pretty sure that you'll need more length than just 48 characters for your string.
|
The codes of the colors show up, in my eyes it should work too but unfortanly.
Re: How to do this?(Dialog, string, color) -
saffierr - 09.01.2016
example:
PHP код:
"{FFFFFF}Welcome back {FF9900AA}%s.
That's the way you should do it
Re: Respuesta: How to do this?(Dialog, string, color) -
RoboN1X - 09.01.2016
Quote:
Originally Posted by geerdinho8
The codes of the colors show up, in my eyes it should work too but unfortanly.
|
You need to increase the string size, as Cepillado said.
Your code would likely to compile:
Код:
format(string, sizeof(string), "{FFFFFF}Welcome back {FF9900AA}%s. {FFFFFF}Type your password below to login.",name);
That's not 48, but 100 characters already (including player name).
So change this:
Код:
string[76+MAX_PLAYER_NAME];
Re: How to do this?(Dialog, string, color) -
DarkLouis - 09.01.2016
Your code should work but your string size is small.
You need to increase it at least 100.
Re: Respuesta: How to do this?(Dialog, string, color) -
Rufio - 09.01.2016
Quote:
Originally Posted by geerdinho8
The codes of the colors show up, in my eyes it should work too but unfortanly.
|
You have to use HTML color codes, hex codes won't work. Also, increase your string size.