AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Print text with multiple colors?! (https://forums.alliedmods.net/showthread.php?t=179)

ipren 03-10-2004 15:50

Print text with multiple colors?!
 
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]

_KaszpiR_ 03-11-2004 03:30

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

ipren 03-11-2004 04:27

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!

Johnny got his gun 03-11-2004 06:00

You could use hud messages :roll:

MagicShot 03-11-2004 08:03

Quote:

Originally Posted by Johnny got his gun
You could use hud messages :roll:

Yeah you could use a rainbow hud message effect that would look funny though should work though...

Nice jghg...
:shock:

hehe

ipren 03-11-2004 08:47

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 :wink:


/mathias!

Johnny got his gun 03-11-2004 09:14

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.

ibm86 03-11-2004 09:31

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..


All times are GMT -4. The time now is 09:17.

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