AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Problem with client_print_color() (https://forums.alliedmods.net/showthread.php?t=262742)

xEhsaan 05-11-2015 09:29

[Solved] Problem with client_print_color()
 
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 :3

Thanks.

klippy 05-11-2015 10:01

Re: Problem with client_print_color()
 
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.

Arkshine 05-11-2015 10:09

Re: Problem with client_print_color()
 
A line should always starts by an color identifier, whatever ^1, ^2, ^3 or ^4. Otherwise color won't work, it's CS behavior.

klippy 05-11-2015 10:22

Re: Problem with client_print_color()
 
Quote:

Originally Posted by Arkshine (Post 2295556)
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.

Arkshine 05-11-2015 10:40

Re: Problem with client_print_color()
 
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.

xEhsaan 05-11-2015 10:43

Re: Problem with client_print_color()
 
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!


klippy 05-11-2015 10:47

Re: Problem with client_print_color()
 
Quote:

Originally Posted by Arkshine (Post 2295569)
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 (Post 2295571)
I can't use ^1 or ^4 in start of my line.

Why not?

xEhsaan 05-11-2015 11:19

Re: Problem with client_print_color()
 
Of course I needed to highlight a certain world in the middle of my sentence :|

Arkshine 05-11-2015 11:36

Re: Problem with client_print_color()
 
^1 for normal color. So you just do: ^1some text, ^4highlighted_word^1 some text.

xEhsaan 05-11-2015 12:57

Re: [Solved] Problem with client_print_color()
 
Thank you Arkshine, solved.


All times are GMT -4. The time now is 18:40.

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