Raised This Month: $32 Target: $400
 8% 

Print text with multiple colors?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ipren
Junior Member
Join Date: Mar 2004
Old 03-10-2004 , 15:50   Print text with multiple colors?!
Reply With Quote #1

Hello!

How can I print a line of text with multiple colors in it? Just like the ingame chat were the name is red or blue and the text is yellow.

To clarify my question.

Code:
client_print(0,print_chat,"blue green yellow")
Is it possible to get the words show up in their "own" colors?


Thanx!

/Mathias!
[/code]
ipren is offline
_KaszpiR_
AMX Mod X Beta Tester
Join Date: Feb 2004
Location: Warsaw, Poland
Old 03-11-2004 , 03:30  
Reply With Quote #2

very hard but yes, but up to 4 colours (hl limitation)
and then no other messages would be displayed or any new message that would show uo would remove on eof the coloured messages
__________________
= Ave Cesar, morituri Te salutant. = http://nvt.prv.pl = http://hlds.pl/
_KaszpiR_ is offline
ipren
Junior Member
Join Date: Mar 2004
Old 03-11-2004 , 04:27  
Reply With Quote #3

Okay so it's not possible to write a "say-substitute"-plugin?

I've written a plugin that I use from my webpage (rcon) so the vistors can chat into the game. It works great except that I dont want the text to be all yellow.

My plugin looks like this:
Code:
#include <amxmod>
#include <amxmisc>

public websay(id,level,cid) {

	if(!cmd_access(id,level,cid,1)){
 		return PLUGIN_HANDLED
	}

	if(read_argc()<3)
		return PLUGIN_HANDLED

	new name[32]
	new message[192]
	
	read_argv(1,name,31)
	read_args(message,191)

	remove_quotes(message)

	client_print(0,print_chat,"(www) %s : %s", name, message[strlen(name)+2])

	return PLUGIN_HANDLED
}

public plugin_init() {
register_plugin("websay","0.1","MaS")
register_clcmd("amx_websay","websay",ADMIN_VOTE," : chat from console")
register_concmd("amx_websay","websay",ADMIN_VOTE," : chat from console")

}
It would be nice if it's possible to change the colors (ony 2 needed just like in normal chat), but if it's to much of a hassle I just drop it..

thanx!


/mathias!
ipren is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-11-2004 , 06:00  
Reply With Quote #4

You could use hud messages
Johnny got his gun is offline
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 03-11-2004 , 08:03  
Reply With Quote #5

Quote:
Originally Posted by Johnny got his gun
You could use hud messages
Yeah you could use a rainbow hud message effect that would look funny though should work though...

Nice jghg...


hehe
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
ipren
Junior Member
Join Date: Mar 2004
Old 03-11-2004 , 08:47  
Reply With Quote #6

Can I make a hudmessage look just like the client print text? (font etc etc..)

And even if I can, the hudmessage wont be included in the "chat scroller" right?

Nah.. think I'll have to live with the all yellow stuff, hopefully you guys will rewrite the client_print to include a color-argument


/mathias!
ipren is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-11-2004 , 09:14  
Reply With Quote #7

As far as I can remember I think the colours are mod-specific, that is there's only red and blue colours in CS cause CS specified these. You could send chat messages using these colours of course(I think, don't think I ever did myself), but you can't use any other colours that aren't valid with the mod itself.
Johnny got his gun is offline
ibm86
Member
Join Date: Mar 2004
Location: Neptun, Romania.
Old 03-11-2004 , 09:31  
Reply With Quote #8

I noticed a strange bug in CS 1.5... when a user played with "A" as nickname (without the quotes) it would show green in the hud. The same thing happened with "*" and a strange combination like |)./\.\/.|.|) or something like that..
ibm86 is offline
Send a message via ICQ to ibm86 Send a message via AIM to ibm86 Send a message via MSN to ibm86 Send a message via Yahoo to ibm86
Reply


Thread Tools
Display Modes

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 19:33.


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