|
 看了amxmod.inc文件后发现可以通过
set_hudmessage(red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35,effects=0,Float:fxtime=6.0,Float:holdtime=12.0,Float:fadeintime=0.1, Float:fadeouttime=0.2,channel=4)代码来设置要显示不同颜色的hud彩色信息,然后通过show_hudmessage (id,"的客户端屏幕要显示的字符内容")但是看了许多插件代码,发现代码的每个public事件只能设置一次信息的格式和颜色。
我本来是希望修改match_deluxe插件达到“下面附图”的效果,除了显示本身自带的warmup信息外,把say ready字样也可以以hudmessage来表达。源插件只有warmup信息,command信息是在chat拦显示的。代码如下:
public warmup_msg()
{
if ((match_inprogress == 1)||(match_inprogress == 3)) {
set_hudmessage(255, 160, 0, -1.0, 0.02, 0, 2.0, 10.0, 0.8, 0.9, 3)
if ((recdemo==1)||(recdemo==3))
show_hudmessage(0,"--[ Warmup Time ]--^n^nDemos are automatically recorded on your PC^nScreenshots are also taken%s",(swap_type==1) ? "^nTeams will automatically swap after the 1st half" : "")
else
show_hudmessage(0,"--[ Warmup Time ]--^n^nScreenshots are taken.%s^nPlease remember to record demos ",(swap_type==1) ? "^nTeams will automatically swap after the 1st half" : "")
if (cmdtype == 1)
client_print(0,print_chat,"* [AMX MATCH] %s vs %s",clanCT,clanT)
client_print(0,print_chat,"* [AMX MATCH] Warmup Time...")
if (ready_type == 0) {
if (teams_ready == 0)
client_print(0,print_chat,"* [AMX MATCH] Both teams aren't ready.")
if (teams_ready == 4) {
if (cmdtype == 1)
client_print(0,print_chat,"* [AMX MATCH] %s are ready. Waiting for %s to be ready.",(match_inprogress==1) ? clanCT : clanT,(match_inprogress==1) ? clanT : clanCT)
else
client_print(0,print_chat,"* [AMX MATCH] CT are ready. Waiting for T to be ready.")
}
if (teams_ready == 8) {
if (cmdtype == 1)
client_print(0,print_chat,"* [AMX MATCH] %s are ready. Waiting for %s to be ready.",(match_inprogress==1) ? clanT : clanCT,(match_inprogress==1) ? clanCT : clanT)
else
client_print(0,print_chat,"* [AMX MATCH] T are ready. Waiting for CT to be ready.")
}
client_print(0,print_chat,"* [AMX MATCH] When your team is ready: say ready")
client_print(0,print_chat,"* [AMX MATCH] If your team isn't ready anymore: say notready")
}
else {
if (ready_type == 1) {
client_print(0,print_chat,"* [AMX MATCH] When you are ready: say ready")
client_print(0,print_chat,"* [AMX MATCH] If you're not ready anymore: say notready")
client_print(0,print_chat,"* [AMX MATCH] The match starts when everybody is ready")
}
else
client_print(0,print_chat,"* [AMX MATCH] The admin will start the match when needed (by saying ^"/start^")")
}
set_task(90.0,"warmup_msg",1338)
}
return PLUGIN_CONTINUE
}
开始我试过想把“command”信息与“warmup”信息合在一起显示,但是这样就无法像图中所示这么规则,工整了。因为两个"不同位置"的信息是无法通过一个set_hudmessage来进行设置的。如此是显然行不通的。
于是我想到新开一个public事件,在
if ((match_inprogress == 1)||(match_inprogress == 3)) {的条件下触发彩色信息显示事件,于是写下了如下代码:
public warmup_cmd()
{
if ((match_inprogress == 1)||(match_inprogress == 3)) {
new hudmessage[548]
show_hudmessage(0,"Commands^n^n---------------------------------^nsay ready : start or restart a set^nsay notready : cansel ready or cancel a set (back to warmup)^nMatch info is on (say 'info' to turn it off)
set_task(80.0,"warmup_cmd",1336)
}
return PLUGIN_CONTINUE
}
但是还是行不通,难道是因为一个条件下只能显示一个彩色信息??可是statsx插件可以作到同时显示多个彩色信息了,各种方法我都试过了,都不行。。。郁闷啊。。。
各位谁懂代码的提醒指教一下谢谢。。。:D:D:]:) |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|