#1

How To Make Colored Dialog

pawn Код:
strcat(pDialog, "RANKS                Score Needed\n\n", sizeof(pDialog));
    strcat(pDialog, "Trainee                0 Score\n", sizeof(pDialog));
    strcat(pDialog, "Private                100 Scores\n", sizeof(pDialog));
    strcat(pDialog, "PFC                    200 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Corporal               300 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Sergeant               400 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Staff Sergeant         500 Scores\n", sizeof(pDialog));
    strcat(pDialog, "SFC                    600 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Master Sergeant        700 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Second Lieutenant      800 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Captain                1000 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Major                  1200 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Lieutenant Colonel     1400 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Brigadier General      2000 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Major General          2400 Scores\n", sizeof(pDialog));
    strcat(pDialog, "General                3500 Scores\n", sizeof(pDialog));
    strcat(pDialog, "Marshal                5000 Scores\n", sizeof(pDialog));
Please Give Me example
Reply
#2

Well you must use:
pawn Код:
{HEX} // PS: Without #

// For example
strcat(pDialog, "RANKS                {C0C0C0}Score Needed\n\n", sizeof(pDialog));
And that will be grey
Reply
#3

Example:
0xFFFFFFFF = white, correct?
0xFF0000FF = red.

So let's say we want to use white, and THEN red text.
Take the first 6 Numbers/Letters after the 'x' sign in the hexadecimal.
0xFF0000FF becomes FF0000.

pawn Код:
"{FF0000}RED AND THEN {FFFFFF}WHITE"
Let's say you want 'General' to appear as red, but you want to switch it back to white afterwards.
pawn Код:
strcat(pDialog, "{FF0000}General                {FFFFFF}3500 Scores\n", sizeof(pDialog)); //FF0000 - switch to red. FFFFFF - switch back to white.
COLORS LIST - https://sampwiki.blast.hk/wiki/Hex_colours
EMBEDDING HELP - https://sampwiki.blast.hk/wiki/Colors_List
Reply
#4

Thanks You Very Much REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)