How to do this?(Dialog, string, color)
#1

Код:
#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?
Reply
#2

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

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

example:
PHP код:
 "{FFFFFF}Welcome back {FF9900AA}%s. 
That's the way you should do it
Reply
#5

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];
Reply
#6

Your code should work but your string size is small.
You need to increase it at least 100.
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)