Raised This Month: $ Target: $400
 0% 

[HelpREQ] How can I set up above avarage Round Time and colored text?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 07-29-2008 , 21:02   Re: [HelpREQ] How to set chat text colors, roundtime and forwarding
Reply With Quote #3

Quote:
Originally Posted by ot_207 View Post
This is what you need to use for colored messages
Beware! Before showing the message to the player you must format it

PHP Code:
format(msg,sizeof(msg) -1,"xxx",any...)
colored_msg(id,msg
To change the colores of the font you need to use these characters:
PHP Code:
^x01 -> for normal color
^x03 -> for team color (red for terorwhite for specblue for ct)
^
x04 -> for green color 
Example of usage:
^x03 Make me cry ^x04 yea ^x01 mama

Will apear ( if you are terrorist)-> Make me cry yea mama
PHP Code:
public colored_msg(id,msg[])
{
    
message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()

The roundtime more than 10 ... sorry I don't know

To register forwards in fakemeta the function is:
PHP Code:
register_forward(FM_PlayerPreThink,"fw_pre"//in plugin init
 
public fw_pre(id)
{
// do stuff 

1. How come "mama" is orange if ^x01 is normal color?

2. Here is what I did:
PHP Code:
new msg[250];
format(msg249"^x04[XXX]^x03:")
colored_msg(idmsg// Compiler says that there's argument type mismatch on argument 2 (msg)
return 1;
 
public 
colored_msg(idmsg)
{
message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id
write_byte(id
write_string(msg// Same here, compiler says argument type mismatch
message_end() 
}
 
/* Then I want to use colored_msg to put colored "[XXX]" at the beginning of the text */
 
public function(id)
{
        
colored_msg(id"^x03Text text text..."// Compiler says it again, argument type mismatch on argument 2 ("^x03Text text text...")

Why did I do wrong? Is it because I didn't pressed space after the ^x04[XXX] and just skipped to ^x04[XXX]^x03:...?

About forward, I didn't ment how to register, that thing I already knew.
What I ment is why should I forward? What does it do? What does PreThink and PostTHink and stuff like that mean?
If you could find any guides/tutorials or simply explain to me those things I will be gratefull (also I added karma to you )

Thank you so much for the help you just made my day, well night,
dor123
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯

Last edited by Dores; 07-29-2008 at 23:44. Reason: Colored text problems
Dores is offline
 



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 05:36.


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