Help with colours.
#1

Hi SA-MP community,
I have an error regarding colors. On skin selection I want the team name to be shown in these colors.
pawn Код:
#define COLOR_STAT          COLOR_ORANGE
#define COLOR_SWAT          COLOR_LIGHTBLUE
#define COLOR_ARMY          COLOR_TAN
#define COLOR_POLICE            COLOR_BLUE
#define COLOR_CIVILIAN          COLOR_WHITE
#define COLOR_MECHANIC              COLOR_GREY
#define COLOR_DRUGDEALER            COLRO_WHITE
But while I do it my way as in the below pawn code,
pawn Код:
{
    case 0..1: GameTextForPlayer(playerid, "COLOR_ORANGE STAT", 5000, 6);
    case 2: GameTextForPlayer(playerid, "~b~SWAT", 5000, 6);
    case 3: GameTextForPlayer(playerid, "COLOR_TAN ARMY", 5000, 6);
    case 4..12: GameTextForPlayer(playerid, "~g~POLICE", 5000, 6);
    case 13..26: GameTextForPlayer(playerid, "~w~CIVILIAN", 5000, 6);
    case 27: GameTextForPlayer(playerid, "COLOR_GREY MECHANIC", 5000, 6);
    case 28..32: GameTextForPlayer(playerid, "~w~DRUG DEALER", 5000, 6);
    }
it makes a whole sentence. Like for STAT it shows COLOR_ORANGE STAT.
I tried
"COLOR_ORANGE"STAT;
"#COLOR_ORANGE#"STAT;
COLOR_ORANGESTAT.
But all had some or the other error.


Please help me.
Reply
#2

You are not defining any hexadecimal colors. You are defining words...
Reply
#3

Quote:
Originally Posted by Walsh
Посмотреть сообщение
You are not defining any hexadecimal colors. You are defining words...
Yeah i know that is there anyway to fix this?
Reply
#4

You don't define a word and magically expect it to become a color. You have to define a color in pawn format.

Example

Код:
#define COLOR_WHITE 0xFFFFFFFF
This makes it so you can use
Код:
COLOR_WHITE
instead of typing that long hexadecimal color.
Reply
#5

****** color picker then copy the color code and add 0x at the front and FF at then end of the code
Reply
#6

Quote:
Originally Posted by Walsh
Посмотреть сообщение
You don't define a word and magically expect it to become a color. You have to define a color in pawn format.

Example

Код:
#define COLOR_WHITE 0xFFFFFFFF
This makes it so you can use
Код:
COLOR_WHITE
instead of typing that long hexadecimal color.
LOL man I am not such a noob!
I defined them already.
The problem is that how to make STAT show in Orange colour while selecting a skin.
Reply
#7

I'm not sure that you can set the color in GameTextForPlayer function with hex color...
i think its only for function like SendClientMessage and also this function has colour embedding (added in 0.3c) that you can define hex color in the string.

Perhaps, you can use ~y~ for orange or maybe you can use ~y~~h~ for lighter (can be yellow).
for example:
pawn Код:
GameTextForPlayer(playerid,"~y~~h~text here",5000,6);
See here for the colors and here for GameTextForPlayer usage

hope this help
Reply
#8

Quote:
Originally Posted by Robo_N1X
Посмотреть сообщение
I'm not sure that you can set the color in GameTextForPlayer function with hex color...
i think its only for function like SendClientMessage and also this function has colour embedding (added in 0.3c) that you can define hex color in the string.

Perhaps, you can use ~y~ for orange or maybe you can use ~y~~h~ for lighter.
for example:
Код:
GameTextForPlayer(playerid,"~y~~h~text here,5000,6);
See here for the colors and here for GameTextForPlayer usage

hope this help
thnx man i checked the wiki earlier. I will try wat u gave.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)