SA-MP Forums Archive
Help with colours. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with colours. (/showthread.php?tid=323237)



Help with colours. - Faisal_khan - 05.03.2012

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.


Re: Help with colours. - Walsh - 05.03.2012

You are not defining any hexadecimal colors. You are defining words...


Re: Help with colours. - Faisal_khan - 05.03.2012

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?


Re: Help with colours. - Walsh - 05.03.2012

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.


Re: Help with colours. - new121 - 05.03.2012

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


Re: Help with colours. - Faisal_khan - 05.03.2012

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.


Re: Help with colours. - RoboN1X - 05.03.2012

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


Re: Help with colours. - Faisal_khan - 05.03.2012

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.