搜索
查看: 2761|回复: 3

哪位高手可以把这个插件改成滚动显示

[复制链接]
发表于 2009-5-5 19:52:41 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉–武昌区
就是在线显OP与VIP的  如果VIP在线的多了
一显示就会很长满屏幕都是
如果改成屏幕上方滚动就可以了

  1. #include <amxmodx>
  2. #include <amxmisc>

  3. #define MAX_MESSAGES 32
  4. #define X_POS -1.0
  5. #define Y_POS 0.5
  6. #define HOLD_TIME 5.0

  7. new g_Values[MAX_MESSAGES][3]
  8. new g_Messages[MAX_MESSAGES][384]
  9. new g_MessagesNum,g_subMsgNum
  10. new g_Current,g_subCurrent

  11. public plugin_init() {
  12. register_plugin("Info. Messages",AMXX_VERSION_STR,"AMXX Dev Team")
  13. register_dictionary("imessage.txt")
  14. register_dictionary("common.txt")
  15. register_srvcmd("amx_admin","setMessage")
  16. register_cvar("amx_freq_admin","10")
  17. new lastinfo[8]
  18. get_localinfo("lastinfomsg",lastinfo,7)
  19. g_Current = str_to_num(lastinfo)
  20. g_subCurrent = 0
  21. g_subMsgNum=2
  22. set_localinfo("lastinfomsg","")
  23. }



  24. public infoMessage()
  25. {
  26. if(g_Current==0) g_subCurrent=0
  27. if (g_Current >= g_MessagesNum)
  28. {
  29. g_subCurrent++;
  30. if(g_subCurrent>=g_subMsgNum){
  31. g_Current = 0
  32. }
  33. //在这里我们增加一个现实在线OP的模块
  34. new opmsg[512],playerslist[32],playerscount,i,pos,opcount
  35. get_players(playerslist,playerscount,"c")//Skip Bot
  36. opcount=0;
  37. if(g_subCurrent==1){
  38. opmsg="当前在线的OP^n____________________^n"
  39. pos=strlen(opmsg)
  40. for(i=0;i<playerscount;i++){
  41. if(access(playerslist,ADMIN_IMMUNITY)){
  42. new username[33]
  43. get_user_name(playerslist,username,32)
  44. opcount++
  45. pos+=format(opmsg[pos],511-pos,"%s^n",username)
  46. }
  47. }
  48. if(opcount==0) opmsg="当前没有OP在线"
  49. }

  50. if(g_subCurrent==2){
  51. opmsg="当前在线的VIP^n____________________^n"
  52. pos=strlen(opmsg)
  53. for(i=0;i<playerscount;i++){
  54. if(access(playerslist,ADMIN_CHAT)&&(!access(playerslist,ADMIN_IMMUNITY))){
  55. new username[33]
  56. get_user_name(playerslist,username,32)
  57. opcount++
  58. pos+=format(opmsg[pos],511-pos,"%s^n",username)
  59. }
  60. }
  61. if(opcount==0) {
  62. opmsg="当前没有VIP在线"//We Do not display NO VIP
  63. set_task(0.1,"infoMessage",12345)
  64. return
  65. }

  66. }

  67. set_hudmessage(255,105,180,-1.0,0.11,2,0.5,HOLD_TIME,0.080,2.0,3)
  68. show_hudmessage(0,opmsg)
  69. new Float:freq_im = get_cvar_float("amx_freq_admin")
  70. if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  71. }
  72. else {
  73. set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2],
  74. X_POS, Y_POS, 2, 0.5, HOLD_TIME , 0.080, 2.0, 3)
  75. show_hudmessage(0,g_Messages[g_Current])
  76. client_print(0,print_console,g_Messages[g_Current])
  77. ++g_Current
  78. new Float:freq_im = get_cvar_float("amx_freq_admin")
  79. if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  80. }
  81. }

  82. public setMessage() {
  83. if (g_MessagesNum >= MAX_MESSAGES) {
  84. server_print("%L",LANG_SERVER,"INF_REACH")
  85. return PLUGIN_HANDLED
  86. }
  87. remove_task(12345)
  88. read_argv(1,g_Messages[g_MessagesNum],380)
  89. new hostname[64]
  90. get_cvar_string("hostname",hostname,63)
  91. replace(g_Messages[g_MessagesNum],380,"%hostname%",hostname)
  92. while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){}
  93. new mycol[12]
  94. read_argv(2,mycol,11) // RRRGGGBBB
  95. g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
  96. mycol[6] = 0
  97. g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
  98. mycol[3] = 0
  99. g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
  100. g_MessagesNum++
  101. new Float:freq_im = get_cvar_float("amx_freq_admin")
  102. if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  103. return PLUGIN_HANDLED
  104. }

  105. public plugin_end() {
  106. new lastinfo[8]
  107. num_to_str(g_Current,lastinfo,7)
  108. set_localinfo("lastinfomsg",lastinfo)
  109. }
  110. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  111. *{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
  112. */

复制代码
发表于 2009-5-16 17:44:04 | 显示全部楼层 来自 中国–江西–萍乡
好提议 期待高手修改!◎
回复

使用道具 举报

发表于 2009-5-17 19:40:42 | 显示全部楼层 来自 中国–江苏–连云港
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2009-5-29 18:31:20 | 显示全部楼层 来自 中国–湖北–武汉
很难  高手可以的话   给大家做个
回复

使用道具 举报

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

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