Color Coding Question
#1

Hey quick question on message sizes, first example is what i'm trying to do, second is what works.

pawn Код:
format( string5, sizeof( string5 ), "Cash: "COL_LIGHTBLUE"%d "COL_WHITE"| | Bank Balance: "COL_LIGHTBLUE"%s "COL_WHITE"| | PayCheck: "COL_LIGHTBLUE"%d "COL_WHITE"| | Pay Time: "COL_LIGHTBLUE"%d Minutes "COL_WHITE"| |",GetPlayerMoney(id),PlayerInfo[playerid][pBankAmount],PlayerInfo[playerid][pPayCheck],TimeLeft);
And this is the one that works:

pawn Код:
format( string5, sizeof( string5) ,"Cash: %d   | | Bank Balance: %s  | | PayCheck: %d  | | Pay Time: %d Minutes  | |",GetPlayerMoney(id),PlayerInfo[playerid][pBankAmount],PlayerInfo[playerid][pPayCheck],TimeLeft);

Does the "COL_LIGHTBLUE" and "COL_WHITE" count as characters? I heard you can't output more then 128 characters, So I'm guessing it does, if it does, is there another way to do this?
Reply
#2

Instead of "COL_LIGHTBLUE" do like

Cash: {00FFFF}%d

for each one just use html colors.

pawn Код:
format( string5, sizeof( string5 ), "Cash: {00FFFF}%d {FFFFFF}| | Bank Balance: {00FFFF}%s {FFFFFF}| | PayCheck: {00FFFF}%d {FFFFFF}| | Pay Time: {00FFFF}%d minutes{FFFFFF}| |",GetPlayerMoney(id),PlayerInfo[playerid][pBankAmount],PlayerInfo[playerid][pPayCheck],TimeLeft);
Reply
#3

Oh, Alright, I had them defines for easier use such as:

pawn Код:
#define COL_LIGHTBLUE                                                           "{00C0FF}"
Reply
#4

Did it for you above, yeah but that works too.
Reply
#5

Well

pawn Код:
Cash: {00FFFF}%d {FFFFFF}| | Bank Balance: {00FFFF}%s {FFFFFF}| | PayCheck: {00FFFF}%d {FFFFFF}| | Pay Time: {00FFFF}%d minutes{FFFFFF}| |
Is still longer then 128, so it didn't show up .
Reply
#6

Hex colors which has been added in 0.3c if I'm not mistaken lengthens the string. Increase the size to 156 (which is to believed the max char assignment when embedding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)