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: Colours (
/showthread.php?tid=460700)
Colours -
Strapz - 29.08.2013
So In my script i made some commands and in the commands theres some usage:/me [action] stuff for example and i seted it to the colour light blue what happens shows up in dark blue I set whisper to yellow and it appears in light blue
the /me command was suposed to be green and is dark blue i dont understand whats happening is the color format different? where should i get my colours from
AW: Colours -
Blackazur - 29.08.2013
can you give us the code please.
Re: Colours -
Luis- - 29.08.2013
How are you defining the colours?
Re: Colours -
3MY - 29.08.2013
Post the command
Re: Colours -
Konstantinos - 29.08.2013
Goto
http://www.rgbtohex.net/
Play with the values 0-255 to find the colour you prefer.
An example: If you add 255, 0, 0 (red), it will be shown as: #FF0000
Take that and do:
pawn Код:
#define COLOR_RED 0xFF0000FF
// 0x at the beginning and FF at the end.
// The hex it gave you without the # in front.
// Another example of yellow:
#define COLOR_YELLOW 0xFFFF00FF
Re: AW: Colours -
Strapz - 29.08.2013
Quote:
Originally Posted by Blackazur
can you give us the code please.
|
Код:
//Color Defines
#define COLOUR_RED 0xFF0000
#define COLOUR_GREEN 0x33CC33
#define COLOUR_YELLOW 0xFFFF00
#define COLOUR_LIGHTYELLOW 0xFFFFCC
#define COLOUR_MEGREEN 0x99FF00
#define COLOUR_LTBLUE 0x33FF99
#define WHISPER_YELLOW 0xFFCC33
#define USAGE_COLOR 0x33CCCC
Код:
CMD:whisper(playerid, params[])
{
new pname[MAX_PLAYER_NAME], str[128], Float:pPos[3];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, 0x33CCCC, "USAGE: /whisper [text]");
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, pPos[0], pPos[1], pPos[2]))
{
format(str, sizeof(str), "Whisper from %s: %s", pname, params);
SendClientMessage(i, WHISPER_YELLOW, str);
}
}
return 1;
}
Re: Colours -
Dragonsaurus - 29.08.2013
You should add a "FF" at the end of every color define.
Re: Colours -
3MY - 29.08.2013
Код:
CMD:whisper(playerid, params[])
{
new pname[MAX_PLAYER_NAME], str[128], Float:pPos[3];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, 0x33CCCC, "USAGE: /whisper [text]");
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, pPos[0], pPos[1], pPos[2]))
{
format(str, sizeof(str), "{FFF700}Whisper from %s: %s", pname, params);
SendClientMessage(i, WHISPER_YELLOW, str);
}
}
return 1;
}