Quote:
Originally Posted by ot_207
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 teror, white for spec, blue 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_ONE, get_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(msg, 249, "^x04[XXX]^x03:")
colored_msg(id, msg) // Compiler says that there's argument type mismatch on argument 2 (msg)
return 1;
public colored_msg(id, msg)
{
message_begin(MSG_ONE, get_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
__________________