|
楼主 |
发表于 2005-1-11 10:37:14
|
显示全部楼层
来自 中国–福建–厦门
呵呵,好久没来了。
看来还是很多人关心这个问题的。
nwb13大虾在凌晨2点钟的范例是很正确的,其实不能用client_print函数,这个函数本身不支持,需要使用 SayText这个消息。(2001年就已经有人在提这个问题了,我搜到的贴子中最早的解决方法)
方法是这样的:(amxmodx.org的Damaged Soul提供)
// Radio and chat strings can have control characters embedded to set colors. For the control characters to be used, one must be at the start of the string.
// The control characters can be copied and pasted in notepad.
// = 0x02 (STX) - Use team color up to the end of the player name. This only works at the start of the string, and precludes using the other control characters.
// = 0x03 (ETX) - Use team color from this point forward
// = 0x04 (EOT) - Use location color from this point forward
// = 0x01 (SOH) - Use normal color from this point forward
具体的实现方法,大家参见nwb13的范例或参见下面的例子:
public plugin_init() {
register_clcmd("test","test")
}
public test(id) {
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(id)
write_string("^x03Team colored text ^x01Normal color")
message_end()
return PLUGIN_HANDLED
}
有兴趣的话大家可以到我的服务器里去玩玩:
218.5.83.8:27019
218.5.83.1:27020
218.5.83.7:27020 |
|