Jump to content

[0.3c] - Cum sa folosesti culorile intr-un mesaj.


Guest PlayON

Recommended Posts

0.3c Culori intr-un mesaj.

The way it's meant.

Informatii

Am sa va arat cum se foloseste noua functie sau sa o numic, noua minune in SA-MP, unde puteti avea un text de genu:

      2mwzc5t.png

      302amhh.png

In primul rand, aceste culori nu sunt in format HEX! Cum avem noi la SA-MP deobicei la SendClientMessage, EX: 0xFFFFFFFF.

Nu! Acuma este RGB si se scrie  FF0202 <- Este codul RGB exact pentru culoarea Rosie

Sa incepem...

In primul rand, v-am facut o mica lista cu culorile RGB. Vetiv edea mai jos cum se folosesc acestea.

#define TAG[SRC]           "{FFBF00}"
#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}"
Veti vedea mai tarziu de ce le-am pus in " ". Acuma, ca sa nu ne complicam cand scriem un mesaj, de exemplu in loc sa scriem. Desi nu va arata asa de impecabil atunci cand scrieti mult si multe culori.Va arata oribil.
SendClientMessage(playerid,0xFFFFFFFF, "{RRGGBB} UNU {RRGGBB} DOI {RRGGBB} TREI {RRGGBB} PATRU");
Formatu prin care se face un text colorat este de a pune culoarea intre { } intr-un mesaj. Tot textu care vine da dupa o culoare {RRGGBB} se face de aceasi culoare. Eu, inloc sa fac asa, fac altfel, folosing o metoda, care mi se pare mai buna si mai sa zicem sofisticata, eu unu inteleg mai bine asa. Inloc sa folosim  {RRGGBB} vom folosi culorile din lista pe care am facut mai sus. Si ams a fa si explic de ce am pus intre " ".
SendClientMessage ( playerid,0xFFFFFFFF, ""#COL_RED"ROSU"#COL_YELLOW" GALBEN "#COL_BLUE" ALBASTRU "#COL_MAGENTA" PURPURIU "#COL_VIOLET" VIOLET "#COL_WHITE" ETC!!!!");

Ca sa facem un text colorat prin metoda care am gasit-o eu, adaugam "#COL_RED" in fata textului.

Si prin asta putem modifica oricand vrem culoarea rosie.

Download

COLOR PICKER DOWNLOAD

Daca nu ati inteles nimic, va rog sa postati aici!Orice nelamurire orice!

Link to comment
Share on other sites

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

[tt]stock hexToCol(hex)

{

new str[9];

format(str,9,"{%x}",hex);

return str;

}

  printf("%s",hexToCol(0xFF77EE));

  #define Color:Try 0xFF77EE

  printf("%s",hexToCol(Color:Try));[/tt]


Arata prea punky  8)

Link to comment
Share on other sites

  • 2 weeks later...

Frumos !! 10/10 !

Dar am o problema :D

Folosesc GodFather dar la chestia asta cu stats daca o colorez imi dispare linia in joc.

		format(coordsstring, sizeof(coordsstring), ""CREM"Level:["BLUE"%d"CREM"] Sex:["BLUE"%s"CREM"] Age:["BLUE"%d"CREM"] Origin:["BLUE"%s"CREM"] SpawnHealth:["BLUE"%.1f"CREM"] Cash:["BLUE"%s"CREM"] Bank:["BLUE"%s"CREM"] Ph:["BLUE"%d"CREM"]", level,atext,age,otext,shealth+50, FormatMoney(cash), FormatMoney(account), pnumber);
		SendClientMessage(playerid, -1,coordsstring);

Ce trebuie sa fac in cazul asta?

Link to comment
Share on other sites

  • 2 weeks later...
Guest PlayON

Neonkiller" post="49509" timestamp="1293882245"]

FF Cool tutorialul , 10/10 .

asa e si pt dialoguri nu ?

Dialoguri, chat, 3dtext si cam atata.

Nu merge la butoanele de la dialog.

Link to comment
Share on other sites

Frumos !! 10/10 !

Dar am o problema :D

Folosesc GodFather dar la chestia asta cu stats daca o colorez imi dispare linia in joc.

		format(coordsstring, sizeof(coordsstring), ""CREM"Level:["BLUE"%d"CREM"] Sex:["BLUE"%s"CREM"] Age:["BLUE"%d"CREM"] Origin:["BLUE"%s"CREM"] SpawnHealth:["BLUE"%.1f"CREM"] Cash:["BLUE"%s"CREM"] Bank:["BLUE"%s"CREM"] Ph:["BLUE"%d"CREM"]", level,atext,age,otext,shealth+50, FormatMoney(cash), FormatMoney(account), pnumber);
		SendClientMessage(playerid, -1,coordsstring);
Ce trebuie sa fac in cazul asta?
incearca asta
format(coordsstring, sizeof(coordsstring), ""CREM"Level:"BLUE"[%d]"CREM" Sex:"BLUE"[%s]"CREM" Age:"BLUE"[%d]"CREM" Origin:"BLUE"[%s]"CREM" SpawnHealth:"BLUE"[%.1f]"CREM" Cash:"BLUE"[%s]"CREM" Bank "BLUE"[%s]"CREM" Ph:"BLUE"[%d]"CREM"", level,atext,age,otext,shealth+50, FormatMoney(cash), FormatMoney(account), pnumber);
		SendClientMessage(playerid, -1,coordsstring); 

scuzama daca nu merge , is foarte obosit

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.