Raised This Month: $ Target: $400
 0% 

[Solved] Problem with client_print_color()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xEhsaan
Member
Join Date: Mar 2015
Location: Isfahan, Iran
Old 05-11-2015 , 09:29   [Solved] Problem with client_print_color()
Reply With Quote #1

Hey everyone,

I'm using latest AMX Mod X development version and using client_print_color() in my plugin. But there is a problem.

When I use dictionary, I don't know how to specify tags like ^4 or ^1. They aren't working (they just show up like plain text). I even tried !g or !n, but they aren't working too.

How can I specify color tags in client_print_color()

P.S.1: I'm using core client_print_color()
P.S.2: I searched, searched, searched, but didn't get any correct answer. So please don't tell me Search

Thanks.
__________________
* Wait for something awesome...
* AMX Mod X Plugin Translation Repository [Paused Temporarily]
* Knife Deathmatch Shop
* Knife CFG Detector
* Looking for an idea...

Last edited by xEhsaan; 05-11-2015 at 12:57. Reason: Solved!
xEhsaan is offline
Send a message via Skype™ to xEhsaan
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-11-2015 , 10:01   Re: Problem with client_print_color()
Reply With Quote #2

Could you post the line (client_print_color() call) in which you are printing the message? Also, post the line from dictionary file you are trying to print.
klippy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2015 , 10:09   Re: Problem with client_print_color()
Reply With Quote #3

A line should always starts by an color identifier, whatever ^1, ^2, ^3 or ^4. Otherwise color won't work, it's CS behavior.
__________________

Last edited by Arkshine; 05-11-2015 at 10:12.
Arkshine is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-11-2015 , 10:22   Re: Problem with client_print_color()
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
A line should always starts by an color identifier, whatever ^1, ^2, ^3 or ^4. Otherwise color won't work, it's CS behavior.
I don't think that's the case here. He said he was using a dictionary, and I am sure that within the file, "^4" for instance is seen as 2 separate characters, instead of just 1, making it print like normal text. He could fix it by replacing them with "%c" within the dictionary file, and adding color codes (for example '^4') in parameter list, when formating the string.

But I told him to post his code and dictionary, just in case this isn't the actual problem.
klippy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2015 , 10:40   Re: Problem with client_print_color()
Reply With Quote #5

No, using ^1, etc. in dictionary file is properly handled by AMXX. Issue is either line doesn't start with a color, or is trying to use color on other mod than CS.
__________________
Arkshine is offline
xEhsaan
Member
Join Date: Mar 2015
Location: Isfahan, Iran
Old 05-11-2015 , 10:43   Re: Problem with client_print_color()
Reply With Quote #6

I can't use ^1 or ^4 in start of my line.
Here is a part of my dictionary:
Code:
ALREADY_GODMODE = You already have !gGodMode!n!
HAVE_GODMODE = Now, You have !gGodMode Item!n!
__________________
* Wait for something awesome...
* AMX Mod X Plugin Translation Repository [Paused Temporarily]
* Knife Deathmatch Shop
* Knife CFG Detector
* Looking for an idea...
xEhsaan is offline
Send a message via Skype™ to xEhsaan
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-11-2015 , 10:47   Re: Problem with client_print_color()
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
No, using ^1, etc. in dictionary file is properly handled by AMXX. Issue is either line doesn't start with a color, or is trying to use color on other mod than CS.
Is that recent? I remember seeing people not being able to use colors within the dictionary file. Just curious, sorry for going off-topic.

Quote:
Originally Posted by xEhsaan View Post
I can't use ^1 or ^4 in start of my line.
Why not?
klippy is offline
xEhsaan
Member
Join Date: Mar 2015
Location: Isfahan, Iran
Old 05-11-2015 , 11:19   Re: Problem with client_print_color()
Reply With Quote #8

Of course I needed to highlight a certain world in the middle of my sentence
__________________
* Wait for something awesome...
* AMX Mod X Plugin Translation Repository [Paused Temporarily]
* Knife Deathmatch Shop
* Knife CFG Detector
* Looking for an idea...
xEhsaan is offline
Send a message via Skype™ to xEhsaan
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2015 , 11:36   Re: Problem with client_print_color()
Reply With Quote #9

^1 for normal color. So you just do: ^1some text, ^4highlighted_word^1 some text.
__________________

Last edited by Arkshine; 05-11-2015 at 11:37.
Arkshine is offline
xEhsaan
Member
Join Date: Mar 2015
Location: Isfahan, Iran
Old 05-11-2015 , 12:57   Re: [Solved] Problem with client_print_color()
Reply With Quote #10

Thank you Arkshine, solved.
__________________
* Wait for something awesome...
* AMX Mod X Plugin Translation Repository [Paused Temporarily]
* Knife Deathmatch Shop
* Knife CFG Detector
* Looking for an idea...
xEhsaan is offline
Send a message via Skype™ to xEhsaan
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 11:58.


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