EACH WORD DIFFERENT COLLOR - 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: EACH WORD DIFFERENT COLLOR (
/showthread.php?tid=349705)
EACH WORD DIFFERENT COLLOR -
nGen.SoNNy - 09.06.2012
Hi guys! Can somebody tell me how can i color the firs word from a string? Like:
pawn Код:
%s joined the server (Test joined the server)
but Test have to look like Test color into blue the first word from his name!
Re : EACH WORD DIFFERENT COLLOR -
ricardo178 - 09.06.2012
For example, this is red {F81414} and this is white color {FFFFFF}
This:
pawn Код:
SendClientMessage(playerid, 0xFFFFFFFF, "{F81414}H{FFFFFF}e{F81414}l{FFFFFF}l{F81414}o");
Will show this in-game:
Hell
o
Actualy the black letters are supposed to be white, but i made them black so you read it as forums background is white..
Re: EACH WORD DIFFERENT COLLOR -
ReneG - 09.06.2012
Color Embedding
Re: EACH WORD DIFFERENT COLLOR -
nGen.SoNNy - 09.06.2012
did you read the title? i want to color with {ff0000} for ex the first word from GetPlayer name! It's a string! and i want to automatic color the first word or the seccond from his name

Now you understand?
OFF: i have servers in mysql/sql and much other things and you told me how to color a text?

)
Re : Re: EACH WORD DIFFERENT COLLOR -
ricardo178 - 09.06.2012
Quote:
Originally Posted by Anonym2009
did you read the title? i want to color with {ff0000} for ex the first word from GetPlayer name! It's a string! and i want to automatic color the first word or the seccond from his name  Now you understand?
OFF: i have servers in mysql/sql and much other things and you told me how to color a text?  )
|
This attitude wont take you anywhere...
I don't know if it's possible to do such thing, but, i bet you have to get player name, check if it has a FirstName_LastName format, devide it, and paint it with the colors you want...
Re: EACH WORD DIFFERENT COLLOR -
nGen.SoNNy - 10.06.2012
Sorry for that

i was angry

i need a function which can find the first character from the string
Re: EACH WORD DIFFERENT COLLOR -
MP2 - 10.06.2012
https://sampwiki.blast.hk/wiki/Strins
pawn Код:
strins(name, "{xxxxxx}", 1); // Color of rest of string
strins(name, "{xxxxxx}", 0); // Color of first character
Re: EACH WORD DIFFERENT COLLOR -
nGen.SoNNy - 10.06.2012
And for the second ?

)