[0.3c] - Easy colors! -
Zh3r0 - 05.12.2010
0.3c Easy Colors
The easiest!
Instead of putting {RRGGBB} text and all that, i found a rather better way, which for me, it's the best so far.
It just simple to use, you will see, i already made a #define list with some colors.
It will be easier to read the text you have written there, instead of reading always {FF9035} etc....
The define list with colors
pawn Код:
#define COL_EASY "{FFF1AF}"
#define COL_WHITE "{FFFFFF}"
#define COL_BLACK "{0E0101}"
#define COL_GREY "{C3C3C3}"
#define COL_GREEN "{6EF83C}"
#define COL_RED "{F81414}"
#define COL_YELLOW "{F3FF02}"
#define COL_ORANGE "{FFAF00}"
#define COL_LIME "{B7FF00}"
#define COL_CYAN "{00FFEE}"
#define COL_LIGHTBLUE "{00C0FF}"
#define COL_BLUE "{0049FF}"
#define COL_MAGENTA "{F300FF}"
#define COL_VIOLET "{B700FF}"
#define COL_PINK "{FF00EA}"
#define COL_MARONE "{A90202}"
#define COL_CMD "{B8FF02}"
#define COL_PARAM "{3FCD02}"
#define COL_SERVER "{AFE7FF}"
#define COL_VALUE "{A3E4FF}"
#define COL_RULE "{F9E8B7}"
#define COL_RULE2 "{FBDF89}"
#define COL_RWHITE "{FFFFFF}"
#define COL_LGREEN "{C9FFAB}"
#define COL_LRED "{FFA1A1}"
#define COL_LRED2 "{C77D87}"
I used "{RRGGBB}' , with " " because we are actually inserting that into the string.
Here is a small look.
pawn Код:
SendClientMessage ( playerid,-1, ""#COL_RED"TEXT"#COL_YELLOW" TEXT"#COL_BLUE" TEXT"#COL_MAGENTA" TEXT"#COL_VIOLET" TEXT"#COL_WHITE" TEXT" );
Yeah, it may look a bit long, but at least it's a lot easier to read!Actually, no, reading it in these pawn tags won't make it look easy.
Copy paste into your gm and check it for yourself!
How to actually insert it?
Just simply add , exactly like this!
The above code, goes straight into the string!
Like this
pawn Код:
SendClientMessage( playerid, -1, " "#COL_GREEN" This is Green! "#COL_RED" This is Red!! "#COL_BLUE" This is Blue!!");
What we are doing is, inserting the {RRGGBB} code into the string using #COL_BLABLA
You can make your own defines with a color picker found on internet!
If you find this not useful just tell me.
I hope this helps you.
Re: [0.3c] - Easy colors! -
WillyP - 05.12.2010
Wow, thanks for all teh sexeh defines
Re: [0.3c] - Easy colors! -
SkizzoTrick - 05.12.2010
Nice man,thanks
Re: [0.3c] - Easy colors! -
Hiddos - 05.12.2010
I found this method a few months ago, but didn't quite saw the possibilities. This describes a possible use of it, good job. Even though this isn't really a tutorial ^^
Re: [0.3c] - Easy colors! -
Zh3r0 - 05.12.2010
Quote:
Originally Posted by Hiddos
I found this method a few months ago, but didn't quite saw the possibilities. This describes a possible use of it, good job. Even though this isn't really a tutorial ^^
|
It's more of a show off or a help thread.
Thanks anyway.
Re: [0.3c] - Easy colors! -
Jochemd - 05.12.2010
Quote:
Originally Posted by Hiddos
I found this method a few months ago, but didn't quite saw the possibilities. This describes a possible use of it, good job. Even though this isn't really a tutorial ^^
|
Wait a minute, SA:MP 0.3c has just been made public for a week? xD
Re: [0.3c] - Easy colors! -
Zh3r0 - 05.12.2010
Quote:
Originally Posted by Jochemd
Wait a minute, SA:MP 0.3c has just been made public for a week? xD
|
This method, with #Blabla, it's around since forever!
Now it's the time for a good use of this method.
Re: [0.3c] - Easy colors! -
bero1711 - 06.12.2010
Nice,good for beginers!
PS: My english is too bad!
Re: [0.3c] - Easy colors! -
Finn - 06.12.2010
You don't really need the #.
pawn Код:
#define WHITE "{FFFFFF}"
#define RED "{FF0000}"
#define BLUE "{0000FF}"
#define GREEN "{00FF00}"
#define BLACK "{000000}"
pawn Код:
SendClientMessage(playerid, 0xFFFFFFFF, ""BLACK" BLACK TEXT "WHITE" WHITE TEXT "RED" RED TEXT "BLUE" BLUE TEXT "GREEN" GREEN TEXT");
Re: [0.3c] - Easy colors! -
HyperZ - 06.12.2010
Great job
Re: [0.3c] - Easy colors! - rjjj - 06.12.2010
Thanks dude
Re: [0.3c] - Easy colors! -
Zh3r0 - 06.12.2010
Quote:
Originally Posted by Finn
You don't really need the #.
pawn Code:
#define WHITE "{FFFFFF}" #define RED "{FF0000}" #define BLUE "{0000FF}" #define GREEN "{00FF00}" #define BLACK "{000000}"
pawn Code:
SendClientMessage(playerid, 0xFFFFFFFF, ""BLACK" BLACK TEXT "WHITE" WHITE TEXT "RED" RED TEXT "BLUE" BLUE TEXT "GREEN" GREEN TEXT");
|
But having a # in front, makes it easier to read.But yeah, true.
Re: [0.3c] - Easy colors! -
Gavibro - 07.12.2010
Quote:
Originally Posted by Zh3r0
pawn Code:
#define COL_WHITE "{FFFFFF}" #define COL_BLACK "{0E0101}" #define COL_GREY "{C3C3C3}" #define COL_GREEN "{6EF83C}" #define COL_RED "{F81414}" #define COL_YELLOW "{F3FF02}" #define COL_ORANGE "{FFAF00}" #define COL_LIME "{B7FF00}" #define COL_CYAN "{00FFEE}" ...
|
More easy:
pawn Code:
stock hexToCol(hex)
{
new str[9];
format(str,9,"{%x}",hex);
return str;
}
printf("%s",hexToCol(0xFF77EE));
#define Color:xxx 0xFF77EE
printf("%s",hexToCol(Color:xxx));
___
Nice tut,good for newbie
Re: [0.3c] - Easy colors! -
Zh3r0 - 07.12.2010
Quote:
Originally Posted by Gavibro
More easy:
pawn Code:
stock hexToCol(hex) { new str[9]; format(str,9,"{%x}",hex); return str; } printf("%s",hexToCol(0xFF77EE)); #define Color:xxx 0xFF77EE printf("%s",hexToCol(Color:xxx));
___
Nice tut,good for newbie
|
Not really... And I'm not a newbie. That be clear.
Re: [0.3c] - Easy colors! -
Gavibro - 07.12.2010
show me where i say "zhero is a newbie".I just say "Nice tut,good for newbie",so this tutorial is easy to understand for beginners/newbie
xD
Re: [0.3c] - Easy colors! -
Finn - 07.12.2010
Quote:
Originally Posted by Gavibro
More easy:
pawn Code:
stock hexToCol(hex) { new str[9]; format(str,9,"{%x}",hex); return str; } printf("%s",hexToCol(0xFF77EE)); #define Color:xxx 0xFF77EE printf("%s",hexToCol(Color:xxx));
___
Nice tut,good for newbie
|
Zh3r0's method (defines) are a lot better and faster option than having a function for such a thing.
This is not only for newbies and this is not really a tutorial. More like a filterscript or include.
Re: [0.3c] - Easy colors! -
Zh3r0 - 07.12.2010
Quote:
Originally Posted by Finn
Zh3r0's method (defines) are a lot better and faster option than having a function for such a thing.
This is not only for newbies and this is not really a tutorial. More like a filterscript or include.
"here's a working code, find out yourself what the fuck it does" is not a tutorial.
|
Can't agree more, but i actually explained what it does...
Re: [0.3c] - Easy colors! -
Finn - 07.12.2010
Quote:
Originally Posted by Zh3r0
Can't agree more, but i actually explained what it does...
|
You have some small explanation
how to use the code, not
what it does.
I removed that last part from my post cuz I thought it might offend you, but damn I was too slow and you got to see it. lol
Re: [0.3c] - Easy colors! -
Zh3r0 - 07.12.2010
Quote:
Originally Posted by Finn
You have some small explanation how to use the code, not what it does.
I removed that last part from my post cuz I thought it might offend you, but damn I was too slow and you got to see it. lol
|
No, it's good, i accept criticism too. I never get angry unless Calgon is speaking...
But i guess the majority understand what this is...
I explained how to use it, i guess the defines already explains what it does.
Re: [0.3c] - Easy colors! -
Aidasas - 19.12.2010
Nice work man. I like this.