A very petty string help.
#1

Okay, so I use multicolored string, but I want a particular word of a string to be the color of the player team.
Код:
{00FFFF}Notification: {FFFFFF}You Have Spawned as {FFFF00}%s'sSupport{FFFFFF}. Use {00FF00}/classhelp {FFFFFF}for more Information.");
I want to code it in such a way that %s's is the color of the team name how would I do that?
Reply
#2

Can You tell us the function for checking the player's color like GetPlayerTeamColor ? Do You have something like that?
Reply
#3

Um, let's say the function is called x
Whatever the function is, it will get the color. But how do I apply the color to a specific word in the string like I can with hex code?
Reply
#4

Quote:
Originally Posted by Ritzy
Посмотреть сообщение
Um, let's say the function is called x
Whatever the function is, it will get the color. But how do I apply the color to a specific word in the string like I can with hex code?
If your function return the color as the string, you can put it in your code like:
PHP код:
"blablabla {%s} blabla" 
If it's not a string but an integer or hex value, you should use 'x' specifier.
PHP код:
"blablabla {%06x} blabla" 
Reply
#5

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
If your function return the color as the string, you can put it in your code like:
PHP код:
"blablabla {%s} blabla" 
If it's not a string but an integer or hex value, you should use 'x' specifier.
PHP код:
"blablabla {%06x} blabla" 
Thank you, it was returning the color as integer and your method worked +rep'ed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)