I have little question.
#1

How to include colors in SendClientMessage.
Reply
#2

maybe, you mean this:

PHP код:
#define WHITE "{FFFFFF}"
#define RED "{FF0000}" 
and
PHP код:
SendClientMessage(playerid0xFFFFFF00""#WHITE"TEXT "#RED"TEXT"); 
Reply
#3

Quote:
Originally Posted by AliveBG
Посмотреть сообщение
maybe, you mean this:

PHP код:
#define WHITE "{FFFFFF}"
#define RED "{FF0000}" 
and
PHP код:
SendClientMessage(playeridWHITE""#WHITE"TEXT "#RED"TEXT"); 
do you actually TRY you code before you post something? because you should...

pawn Код:
SendClientMessage(playerid, 0xFFFFFF, ""#WHITE"TEXT "#RED"TEXT"); // second argument is hex number, not string
Reply
#4

sorry, you're right
Reply
#5

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");
Reply
#6

Quote:
Originally Posted by Weaselpwns
Посмотреть сообщение
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:

pawn Код:
#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
Reply
#7

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
Reply
#8

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
Reply
#9

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..
Reply
#10

See https://sampwiki.blast.hk/wiki/Color_Embedding
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)