秋阳 发表于 2006-6-15 09:01:08

AMXX插件求助!

1、如何修改输出文字的显示色彩。
例:client_print(id,print_chat," Type '.menu' to open the menu"
如何将重要部分'.menu'的输出文字颜色改为其它颜色来突出显示?
2、记时器输出问题
部分源码:client_print(i,print_center,"[ %d minute%s %d second%s ]"将其改为client_print(i,print_center,"[ %d %s : %d %s ]"后,输出的时间后面会加上一个S字符,例如:修改前显示:,修改后显示 1S:26S。可不可以将%S改为%分和%秒?
3、TOP15问题
TOP15的用户名重复,如何修改可以将重复的用户名删除,只保留其最好排名?
以下是源码:
// Top10
// =================================================================================================
public topten_update(id) {
new szvault, szmap, kreedztime
get_mapname(szmap,32)
format(szvault,64,"pk_%s",szmap)
kreedztime = get_systime() - timer_time

new vault = nvault_open(szvault) // Now we have to sort the new list :o
if(vault != -1) {
new szkey
for(new i=1;i<=10;i++) {
   new szreturn
   new arg1, arg2
   format(szkey,8,"%d",i)
   nvault_get(vault,szkey,szreturn,128)

   if(parse(szreturn,arg1,32,arg2,8) == 0 || kreedztime < str_to_num(arg2)) {
    new sznew, szname
    get_user_name(id,szname,32)
    format(sznew,128,"^"%s^" ^"%d^" ^"%d^"",szname,kreedztime,checkpointnum)
    if(i < 10) {
   for(new x=10;x>i;x--) {
      new sztemp, sztempkey
      format(sztempkey,8,"%d",x-1)
      nvault_get(vault,sztempkey,sztemp,128)

      if(!equal(sztemp,"")) {
       format(sztempkey,8,"%d",x)
       nvault_pset(vault,sztempkey,sztemp)
      }
   }
    }
    nvault_pset(vault,szkey,sznew)

    if(i == 1)
   client_print(0,print_chat," %s has established a new record",szname)

    break
   }
}
nvault_close(vault)
}
}
public topten_show(id) {
new motd
new szvault, szmap
get_mapname(szmap,32)
format(szvault,64,"pk_%s",szmap)

new vault = nvault_open(szvault)
if(vault != -1) {
add(motd,2048,"<html><head><style>")
add(motd,2048,"body { background-color:#000000; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
add(motd,2048,".tabel { border-style:solid; border-width:1px; border-color:#FFFFFF; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
add(motd,2048,".header { background-color:#292929; font-family:Tahoma; font-size:10px; color:#FFFFFF; font-weight:800; }")
add(motd,2048,"</style></head><body>")
add(motd,2048,"<br><br><table border=0 cellspacing=0 cellpadding=1 width=90% align=center class=tabel>")

add(motd,2048,"<tr><td class=header>#</td><td class=header>Name</td><td class=header>Time</td><td class=header>Checkpoints</td></tr>")
new szkey
for(new i=1;i<=10;i++) {
   new szreturn
   format(szkey,8,"%d",i)
   nvault_get(vault,szkey,szreturn,128)

   new arg1, arg2, arg3
   if(parse(szreturn,arg1,32,arg2,8,arg3,8) != 0) {
    new sztime
    new imin, kreedztime = str_to_num(arg2)
    if((kreedztime / 60.0) >= 1) {
   imin = floatround(kreedztime / 60.0,floatround_floor)
   kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
    }
    format(sztime,32,"%d minutes and %d seconds",imin,kreedztime)
    add(motd,2048,"<tr><td>")
    add(motd,2048,szkey)
    add(motd,2048,"</td><td>")
    add(motd,2048,arg1)
    add(motd,2048,"</td><td>")
    add(motd,2048,sztime)
    add(motd,2048,"</td><td>")
    add(motd,2048,arg3)
    add(motd,2048,"</td></tr>")
   }
}

nvault_close(vault)

add(motd,2048,"</table></body></html>")
show_motd(id,motd,"ProKreedz Top10")
}
}
请各位朋友帮助指点。谢谢

秋阳 发表于 2006-6-16 11:02:04

回复: AMXX插件求助!

亲爱的高人们,哪去了?

wzj16 发表于 2006-6-16 21:36:25

回复: AMXX插件求助!

关注世界杯去了~~~~~~~~~

ahcat 发表于 2006-6-16 23:07:31

回复: AMXX插件求助!

第一个问题
你要用到message事件

第二个问题
client_print(i,print_center,"[ %d 分 %d 秒 ]",...)
页: [1]
查看完整版本: AMXX插件求助!