SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 05/12/2010, 12:42 PM   #1
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,512
Reputation: 398
Default [0.3c] - Easy colors!

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 Code:
#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 Code:
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!
pawn Code:
"#COL_GREEN"
The above code, goes straight into the string!
Like this
pawn Code:
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.
__________________

Last edited by Zh3r0; 05/12/2010 at 01:00 PM.
Zh3r0 is offline   Reply With Quote
Old 05/12/2010, 12:44 PM   #2
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: England
Posts: 2,027
Reputation: 63
Default Re: [0.3c] - Easy colors!

Wow, thanks for all teh sexeh defines
__________________
once average now terrible
WillyP is offline   Reply With Quote
Old 05/12/2010, 01:06 PM   #3
SkizzoTrick
High-roller
 
SkizzoTrick's Avatar
 
Join Date: Aug 2010
Posts: 1,695
Reputation: 37
Default Re: [0.3c] - Easy colors!

Nice man,thanks
SkizzoTrick is offline   Reply With Quote
Old 05/12/2010, 01:09 PM   #4
Hiddos
High-roller
 
Hiddos's Avatar
 
Join Date: Sep 2008
Posts: 3,304
Reputation: 2184
Default Re: [0.3c] - Easy colors!

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 ^^
__________________
Quote:
Originally Posted by DeWolf View Post
For fuck's sake people, this whole thread is fucked up now.
Hiddos is offline   Reply With Quote
Old 05/12/2010, 01:19 PM   #5
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,512
Reputation: 398
Default Re: [0.3c] - Easy colors!

Quote:
Originally Posted by Hiddos View Post
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.
__________________
Zh3r0 is offline   Reply With Quote
Old 05/12/2010, 01:23 PM   #6
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: [0.3c] - Easy colors!

Quote:
Originally Posted by Hiddos View Post
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
__________________
Jochemd is offline   Reply With Quote
Old 05/12/2010, 01:24 PM   #7
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,512
Reputation: 398
Default Re: [0.3c] - Easy colors!

Quote:
Originally Posted by Jochemd View Post
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.
__________________
Zh3r0 is offline   Reply With Quote
Old 06/12/2010, 11:49 AM   #8
bero1711
Little Clucker
 
Join Date: Jul 2009
Location: Croatia,Koprivnica
Posts: 20
Reputation: 0
Default Re: [0.3c] - Easy colors!

Nice,good for beginers!

PS: My english is too bad!
bero1711 is offline   Reply With Quote
Old 06/12/2010, 11:58 AM   #9
Finn
High-roller
 
Join Date: Jan 2008
Posts: 1,464
Reputation: 382
Default Re: [0.3c] - Easy colors!

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");
Finn is offline   Reply With Quote
Old 06/12/2010, 12:05 PM   #10
HyperZ
High-roller
 
HyperZ's Avatar
 
Join Date: Aug 2009
Location: Islamabad, Pakistan
Posts: 1,341
Reputation: 66
Default Re: [0.3c] - Easy colors!

Great job
__________________
HyperZ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[help]colors in tab Sh@rp Help Archive 3 17/07/2010 09:15 AM
Colors WThieves Help Archive 15 12/01/2010 05:06 PM
SA-MP colors Freddy Z Everything and Nothing 4 13/11/2009 08:52 PM
[Include] [INC] AI Colors Kinetic Includes 16 11/04/2009 05:27 PM


All times are GMT. The time now is 09:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.