Raised This Month: $51 Target: $400
 12% 

Translations with color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fexii
Junior Member
Join Date: Dec 2008
Old 12-14-2008 , 17:10   Translations with color
Reply With Quote #1

Is it possible to color text printed from a translation phrase? For example, the hex codes \x01 - \x09, when used with PrintToChat, changes the color of the chat text. It doesn't seem that these work when used in a translation phrase.
Fexii is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 12-14-2008 , 19:27   Re: Translations with color
Reply With Quote #2

Are you using the \x01 - \x09 and then %t or you place inside translation?
Sammy-ROCK! is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-14-2008 , 20:11   Re: Translations with color
Reply With Quote #3

PrintToChatAll("\x01%t", "Translation Here")

should work.

You can't have the \x01 in the actual translation.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
Fexii
Junior Member
Join Date: Dec 2008
Old 12-14-2008 , 21:03   Re: Translations with color
Reply With Quote #4

Quote:
Originally Posted by Lebson506th View Post
PrintToChatAll("\x01%t", "Translation Here")

should work.

You can't have the \x01 in the actual translation.
Thanks!
Fexii is offline
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 08-11-2009 , 14:21   Re: Translations with color
Reply With Quote #5

Bumping an old thread, I know, but for future reference:

You can use the literal characters of \x01, \x04 etc. in translation files and they will come through correctly as colours.

\x01 to \x06:

Code:

__________________
Darkimmortal is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 08-12-2009 , 02:41   Re: Translations with color
Reply With Quote #6

WHOO. I was about to ask that question. Thanks!
__________________
Whosat is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 08-12-2009 , 05:12   Re: Translations with color
Reply With Quote #7

Oh and just on the topic of translations, does %N work for #format?
So
Code:
"CHAT_UPGRADE_CR0WN"
{
"#format" "{1:N}" 
"en" "{1} gained an upgrade for cr0wning the witch!"
}
PHP Code:
PrintToChat(client"%t""CHAT_UPGRADE_CR0WN"client); 
- will that work?
?

*EDIT: Found some time to test it myself. WORKS!
__________________

Last edited by Whosat; 08-12-2009 at 07:37. Reason: Works :)
Whosat is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 08-12-2009 , 09:11   Re: Translations with color
Reply With Quote #8

Just use colors.inc. =)
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-12-2009 , 16:42   Re: Translations with color
Reply With Quote #9

Quote:
Originally Posted by Whosat View Post
Oh and just on the topic of translations, does %N work for #format?
No. You'll have to get the player's name and just use %s.
bl4nk is offline
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 08-12-2009 , 18:03   Re: Translations with color
Reply With Quote #10

Quote:
Originally Posted by Whosat View Post
*EDIT: Found some time to test it myself. WORKS!
__________________
Darkimmortal is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 05:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode