color in hudhint

Please post any questions about developing your plugin here. Please use the search function before posting!
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

color in hudhint

Postby 8guawong » Wed Nov 19, 2014 2:29 am

is it possible to have colors in hudhint?? (csgo)

Syntax: Select all

HintText(message='\x04test').send()


don't work
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Nov 19, 2014 2:35 am

No, it is not. Only SayText and SayText2 have that type of capabilities.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Wed Nov 19, 2014 3:06 am

satoon101 wrote:No, it is not. Only SayText and SayText2 have that type of capabilities.


ok since i saw some server with colored hint text with SM so was wondering bout SP



whats the differecne between SayText and SayText2???
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Nov 19, 2014 3:14 am

8guawong wrote:ok since i saw some server with colored hint text with SM so was wondering bout SP

Interesting, I hadn't seen that before. Well, if it is possible with SM, it is possible with SP. Do you have a link to the script that does that so we can take a look?


8guawong wrote:whats the differecne between SayText and SayText2???

http://forums.sourcepython.com/showthread.php?586&p=3062&viewfull=1#post3062
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Nov 19, 2014 3:47 am

I figured it out after a bit of searching. As far as I know, this only works in CS:GO:

Syntax: Select all

from events import Event
from messages import HintText

message = HintText(message="This is a <font color='#FF0000'>test</font> \n" +
"<font color='#00FF00'>This is another</font> <font color='#0000FF'>test</font>")

@Event
def player_say(game_event):
message.send()


Very interesting, thank you for bring this to our attention!!! I did just test this in CS:S, and verified it does not work for that game. I guess there could be other games it works for, but this is the first I have ever heard about this.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Wed Nov 19, 2014 4:06 am

np
good job figuring it out :cool:
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Wed Nov 19, 2014 4:59 am

That's awesome! :)
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Postby Doldol » Wed Nov 19, 2014 7:59 pm

Whoah! What about other html!?
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Thu Nov 20, 2014 12:03 am

test and tell us! :cool:
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Postby Doldol » Thu Nov 20, 2014 3:21 pm

8guawong wrote:test and tell us! :cool:


I sadly don't have the space for a CS:GO dedi install.
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Thu Nov 20, 2014 3:54 pm

I did a bit of testing on this and a lot of HTML codes seem to work. However stuff like ability to hyperlink and display images is still a mystery to me.

A few codes I found that work. (<b>, <p>, <li>, <font>, <i>, etc)

To display text larger than 64 units. You will have to use <table> and construct a table with a width and height though. Otherwise the text won't display.

E.g. <font size='64'>Test Text</font>

UPDATE: Giving a table a background colour, will make no text appear at all.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 128 guests