搜索
查看: 1622|回复: 3

AMXX插件求助!

[复制链接]
发表于 2006-6-15 09:01:08 | 显示全部楼层 |阅读模式 来自 中国–河北–廊坊
1、如何修改输出文字的显示色彩。
例:client_print(id,print_chat,"[ProKreedz] 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字符,例如:修改前显示:[1 minutes 26 seconds ],修改后显示 1S:26S。可不可以将%S改为%分和%秒?
3、TOP15问题
TOP15的用户名重复,如何修改可以将重复的用户名删除,只保留其最好排名?
以下是源码:
  1. // Top10
  2. // =================================================================================================
  3. public topten_update(id) {
  4. new szvault[64], szmap[32], kreedztime
  5. get_mapname(szmap,32)
  6. format(szvault,64,"pk_%s",szmap)
  7. kreedztime = get_systime() - timer_time[id-1]
  8. new vault = nvault_open(szvault) // Now we have to sort the new list :o
  9. if(vault != -1) {
  10.   new szkey[8]
  11.   for(new i=1;i<=10;i++) {
  12.    new szreturn[128]
  13.    new arg1[32], arg2[8]
  14.    format(szkey,8,"%d",i)
  15.    nvault_get(vault,szkey,szreturn,128)
  16.    if(parse(szreturn,arg1,32,arg2,8) == 0 || kreedztime < str_to_num(arg2)) {
  17.     new sznew[128], szname[32]
  18.     get_user_name(id,szname,32)
  19.     format(sznew,128,"^"%s^" ^"%d^" ^"%d^"",szname,kreedztime,checkpointnum[id-1])
  20.     if(i < 10) {
  21.      for(new x=10;x>i;x--) {
  22.       new sztemp[128], sztempkey[8]
  23.       format(sztempkey,8,"%d",x-1)
  24.       nvault_get(vault,sztempkey,sztemp,128)
  25.       if(!equal(sztemp,"")) {
  26.        format(sztempkey,8,"%d",x)
  27.        nvault_pset(vault,sztempkey,sztemp)
  28.       }
  29.      }
  30.     }
  31.     nvault_pset(vault,szkey,sznew)
  32.     if(i == 1)
  33.      client_print(0,print_chat,"[ProKreedz] %s has established a new record",szname)
  34.     break
  35.    }
  36.   }
  37.   nvault_close(vault)
  38. }
  39. }
  40. public topten_show(id) {
  41. new motd[2048]
  42. new szvault[64], szmap[32]
  43. get_mapname(szmap,32)
  44. format(szvault,64,"pk_%s",szmap)
  45. new vault = nvault_open(szvault)
  46. if(vault != -1) {
  47.   add(motd,2048,"<html><head><style>")
  48.   add(motd,2048,"body { background-color:#000000; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
  49.   add(motd,2048,".tabel { border-style:solid; border-width:1px; border-color:#FFFFFF; font-family:Tahoma; font-size:10px; color:#FFFFFF; }")
  50.   add(motd,2048,".header { background-color:#292929; font-family:Tahoma; font-size:10px; color:#FFFFFF; font-weight:800; }")
  51.   add(motd,2048,"</style></head><body>")
  52.   add(motd,2048,"<br><br><table border=0 cellspacing=0 cellpadding=1 width=90% align=center class=tabel>")
  53.   add(motd,2048,"<tr><td class=header>#</td><td class=header>Name</td><td class=header>Time</td><td class=header>Checkpoints</td></tr>")
  54.   new szkey[8]
  55.   for(new i=1;i<=10;i++) {
  56.    new szreturn[128]
  57.    format(szkey,8,"%d",i)
  58.    nvault_get(vault,szkey,szreturn,128)
  59.    new arg1[32], arg2[8], arg3[8]
  60.    if(parse(szreturn,arg1,32,arg2,8,arg3,8) != 0) {
  61.     new sztime[32]
  62.     new imin, kreedztime = str_to_num(arg2)
  63.     if((kreedztime / 60.0) >= 1) {
  64.      imin = floatround(kreedztime / 60.0,floatround_floor)
  65.      kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
  66.     }
  67.     format(sztime,32,"%d minutes and %d seconds",imin,kreedztime)
  68.     add(motd,2048,"<tr><td>")
  69.     add(motd,2048,szkey)
  70.     add(motd,2048,"</td><td>")
  71.     add(motd,2048,arg1)
  72.     add(motd,2048,"</td><td>")
  73.     add(motd,2048,sztime)
  74.     add(motd,2048,"</td><td>")
  75.     add(motd,2048,arg3)
  76.     add(motd,2048,"</td></tr>")
  77.    }
  78.   }
  79.   nvault_close(vault)
  80.   add(motd,2048,"</table></body></html>")
  81.   show_motd(id,motd,"ProKreedz Top10")
  82. }
  83. }
复制代码
请各位朋友帮助指点。谢谢
 楼主| 发表于 2006-6-16 11:02:04 | 显示全部楼层 来自 中国–河北–廊坊

回复: AMXX插件求助!

亲爱的高人们,哪去了?
回复

使用道具 举报

发表于 2006-6-16 21:36:25 | 显示全部楼层 来自 中国–广东–深圳

回复: AMXX插件求助!

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

使用道具 举报

发表于 2006-6-16 23:07:31 | 显示全部楼层 来自 中国–上海–上海–浦东新区

回复: AMXX插件求助!

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

第二个问题
client_print(i,print_center,"[ %d 分 %d 秒 ]",...)
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表