PDA

View Full Version : I have little question.


Join7
13/08/2012, 07:43 PM
How to include colors in SendClientMessage.

AliveBG
13/08/2012, 07:45 PM
maybe, you mean this:

#define WHITE "{FFFFFF}"
#define RED "{FF0000}"
and
SendClientMessage(playerid, 0xFFFFFF00, ""#WHITE"TEXT "#RED"TEXT");

SEnergy
13/08/2012, 07:55 PM
maybe, you mean this:

#define WHITE "{FFFFFF}"
#define RED "{FF0000}"
and
SendClientMessage(playerid, WHITE, ""#WHITE"TEXT "#RED"TEXT");

do you actually TRY you code before you post something? because you should...

SendClientMessage(playerid, 0xFFFFFF, ""#WHITE"TEXT "#RED"TEXT"); // second argument is hex number, not string

AliveBG
13/08/2012, 07:59 PM
sorry, you're right

Weaselpwns
13/08/2012, 08:51 PM
Here the defines:
#define Black "{000000}"
#define White "{FFFFFF}"
#define Grey "{BFBFBF}"
#define Red "{FF0000}"
#define Orange "{FFA500}"
#define Yellow "{FFFF00}"
#define Green "{008000}"
#define Blue "{0000FF}"
#define Purple "{800080}"
#define Teal "{008080}"

U should do this for a yellow message:
SendClientMessage(playerid,Yellow, "YourYellowText");

Kindred
13/08/2012, 08:56 PM
Here the defines:
#define Black "{000000}"
#define White "{FFFFFF}"
#define Grey "{BFBFBF}"
#define Red "{FF0000}"
#define Orange "{FFA500}"
#define Yellow "{FFFF00}"
#define Green "{008000}"
#define Blue "{0000FF}"
#define Purple "{800080}"
#define Teal "{008080}"

U should do this for a yellow message:
SendClientMessage(playerid,Yellow, "YourYellowText");

That will not work, it is in the wrong format. Instead, do this:


#define Black 0x000000FF
#define White 0xFFFFFFFF
#define Grey 0xBFBFBFFF
#define Red 0xFF0000FF
#define Orange 0xFFA500FF
#define Yellow 0xFFFF00FF
#define Green 0x008000FF
#define Blue 0x0000FFFF
#define Purple 0x800080FF
#define Teal 0x008080FF

SendClientMessage(playerid,Yellow, "YourYellowText");


Please, do not post unless you know the BASICS

Weaselpwns
14/08/2012, 07:51 AM
Here a edit of my color list.
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA

Stm
14/08/2012, 08:07 AM
Copy the code that Weaselpwns post.Save it in to the PAWN include folder (BE SURE TO SAVE THE FILE LIKE .INC).
And when you makeing a script you need just to #include the colors in to your script.

Example:


#include COLORS


OnPlayerCommandText
if(!strcmp("/Hi" cmdtext))
{
SendClientMessage(playerid, COLOR_GREEN,"Hello player.");
return 1;
}


I thing this is easier :)

Weaselpwns
14/08/2012, 08:29 AM
Dude just by defining them somewhere in the top of ur script is alright.
You dont need to save it as a include, it only makes the script shorter..

[MM]RoXoR[FS]
14/08/2012, 08:30 AM
See http://wiki.sa-mp.com/wiki/Color_Embedding

KingHual
14/08/2012, 08:32 AM
I'm pretty sure he's asking about how he can embed colors. You can do that by adding {RRGGBB} to the string (message).