Raised This Month: $ Target: $400
 0% 

[Solved]Different colors in client_print from ML file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-25-2009 , 08:21   [Solved]Different colors in client_print from ML file
Reply With Quote #1

Well im trying to write out a text using client_print (maybe have to use a custom one if ive understood it right) and text comes from a ML file but im not sure how to do so for example half the text is green and one word is team colored and the last one yellow (default)
Id appreciate a hint in the right direction

and my test code

Code:
#include <amxmodx> public plugin_init() {     register_plugin("colorchattest", "0.1", "Micke1101")     register_dictionary("colorchattest.txt");     register_logevent("round_start", 2, "1=Round_Start"); } public round_start(){     for ( new i = 1; i <= get_playersnum(); i++ ) {             client_print(id, print_chat, "%L", LANG_PLAYER, "GOOD_LUCK", i);     } }



Quote:
Originally Posted by test.txt
[en]
GOOD_LUCK = "Good luck %s wishes Micke1101"

[sv]
GOOD_LUCK = "Lycka till %s 'o'nskar Micke1101"
will update the code if someone may need it.

Last edited by micke1101; 10-26-2009 at 01:47. Reason: Solved
micke1101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-25-2009 , 08:31   Re: Different colors in client_print from ML file
Reply With Quote #2

See ColorChat.
__________________
Arkshine is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-25-2009 , 08:52   Re: Different colors in client_print from ML file
Reply With Quote #3

Thank you, wonder why that one didnt come up when i searched for color anyways it dosent seem to have the ML coloring ability im looking for


edited with the code i was looking for

Code:
#include <amxmodx> new saytext_msgid public plugin_init() {         register_plugin("colorchattest", "0.1", "Micke1101")         register_dictionary("colorchattest.txt");         saytext_msgid = get_user_msgid("SayText")         register_logevent("round_start", 2, "1=Round_Start"); } public round_start(){     for ( new i = 1; i <= get_playersnum(); i++ ) {         new temp[128]         formatex( temp, 127, "%L", LANG_PLAYER, "GOOD_LUCK", i);         replace_all(temp,127,"!n","^x01")         replace_all(temp,127,"!t","^x03")         replace_all(temp,127,"!g","^x04")         message_begin(MSG_ONE,saytext_msgid,{0,0,0},i)         write_byte(i)         write_string(temp)         message_end()     } }


Quote:
Originally Posted by colorchattest.txt
[en]
GOOD_LUCK = "!gGood luck !t%s !nwishes Micke1101"

[sv]
GOOD_LUCK = "!gLycka till !t%s !n'o'nskar Micke1101"
The output will be Good luck (in green)
the players id in team color
and wishes Micke1101 in normal yellow

Last edited by micke1101; 10-26-2009 at 02:29.
micke1101 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 17:33.


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