Color embedding in formatted text?
#1

Hey everyone.
I just starting scripting a bit.
I can not get color embedding to work in formatted messages like this one:
pawn Код:
format(diastr, sizeof(diastr), "{FFFF00FF}Requested username: {FFFFFFAA}%s\n\nEnter a Password to register",name);
It will not embed the colors - it just writes the string as it is.
Reply
#2

Quote:
Originally Posted by sim_sima
Посмотреть сообщение
pawn Код:
(diastr, sizeof(diastr), "{FFFF00FF}Requested username: {0xFFFFFFAA}%s\n\nEnter a Password to register",name);
FFFF00FF it must be at least 6 letters and remove 0x.

Edit: Check this http://html-color-codes.info/
Reply
#3

Use the hex color in { }
Example: "{FF000}test" = test
Reply
#4

Thank you both, I will try
Reply
#5

Thank you, it worked.
I am wondering how much space a color-embedding takes inside an array? Do you know that?
Reply
#6

The same space as they occupy inside the string.

Example:

pawn Код:
new HnR[12] = "{FFFFFF}Hi!"; // 8 + 3 + 1 = 12 cells :)
// Color embeding: 8 cells
// Hi!: 3 cells
// EOS: 1cell
Reply
#7

Quote:
Originally Posted by arakuta
Посмотреть сообщение
The same space as they occupy inside the string.

Example:

pawn Код:
new HnR[12] = "{FFFFFF}Hi!"; // 8 + 3 + 1 = 12 cells :)
// Color embeding: 8 cells
// Hi!: 3 cells
// EOS: 1cell
Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)