搜索
查看: 5327|回复: 10

[AMXX 带源码] 【以解决】imessage.sma 插件问题

[复制链接]
发表于 2009-7-23 20:38:41 | 显示全部楼层 |阅读模式 来自 中国–四川
本帖最后由 fangxikai 于 2009-7-24 09:25 编辑

各位大大   
小弟想知道  这样的  


imessage 插件怎么改
  1. #include <amxmodx>
  2. #include <amxmisc>

  3. #define MAX_MESSAGES  6
  4. #define X_POS         -1.0
  5. #define Y_POS         0.20
  6. #define HOLD_TIME     12.0

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

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

  24. public infoMessage()
  25. {
  26.         if (g_Current >= g_MessagesNum)
  27.                 g_Current = 0
  28.                
  29.         new hostname[64]
  30.        
  31.         get_cvar_string("hostname", hostname, 63)
  32.         replace(g_Messages[g_Current], 380, "%hostname%", hostname)
  33.        
  34.         set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2], X_POS, Y_POS, 0, 0.5, HOLD_TIME, 2.0, 2.0, -1)
  35.         show_hudmessage(0, "%s", g_Messages[g_Current])
  36.         client_print(0, print_console, "%s", g_Messages[g_Current])
  37.         ++g_Current
  38.        
  39.         new Float:freq_im = get_cvar_float("amx_freq_imessage")
  40.        
  41.         if (freq_im > 0.0)
  42.                 set_task(freq_im, "infoMessage", 12345)
  43. }

  44. public setMessage()
  45. {
  46.         if (g_MessagesNum >= MAX_MESSAGES)
  47.         {
  48.                 server_print("%L", LANG_SERVER, "INF_REACH")
  49.                 return PLUGIN_HANDLED
  50.         }

  51.         remove_task(12345)
  52.         read_argv(1, g_Messages[g_MessagesNum], 380)
  53.        
  54.         while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}
  55.        
  56.         new mycol[12]
  57.        
  58.         read_argv(2, mycol, 11)                // RRRGGGBBB
  59.         g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
  60.        
  61.         mycol[6] = 0
  62.         g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
  63.        
  64.         mycol[3] = 0
  65.         g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
  66.        
  67.         g_MessagesNum++
  68.        
  69.         new Float:freq_im = get_cvar_float("amx_freq_imessage")
  70.        
  71.         if (freq_im > 0.0)
  72.                 set_task(freq_im, "infoMessage", 12345)
  73.        
  74.         return PLUGIN_HANDLED
  75. }

  76. public plugin_end()
  77. {
  78.         new lastinfo[8]

  79.         num_to_str(g_Current, lastinfo, 7)
  80.         set_localinfo("lastinfomsg", lastinfo)
  81. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2009-7-23 23:23:18 | 显示全部楼层 来自 中国–北京–北京
没看懂...
回复

使用道具 举报

发表于 2009-7-24 04:56:55 | 显示全部楼层 来自 中国–河南–南阳
修改如下:引用:
set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2], X_POS, Y_POS, 2, 0.5, HOLD_TIME , 0.2, 1.0, 1)




红色2 表示:打字效果;
蓝色0.2,1.0分别表示:进来速度,出去速度。用来控制打字的速度,修改到你满意为止。


貌似是这个吧```
回复

使用道具 举报

发表于 2009-7-24 04:57:19 | 显示全部楼层 来自 中国–河南–南阳
不过我改过无法编译了 真郁闷啊..!!!
回复

使用道具 举报

 楼主| 发表于 2009-7-24 09:25:03 | 显示全部楼层 来自 中国–四川
谢谢了   我编辑成功了。。。
回复

使用道具 举报

 楼主| 发表于 2009-7-24 09:26:12 | 显示全部楼层 来自 中国–四川
还是把编辑好的源码上上来咯!
  1. #include <amxmodx>
  2. #include <amxmisc>

  3. #define MAX_MESSAGES  6
  4. #define X_POS         -1.0
  5. #define Y_POS         0.20
  6. #define HOLD_TIME     12.0

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

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

  24. public infoMessage()
  25. {
  26.         if (g_Current >= g_MessagesNum)
  27.                 g_Current = 0
  28.                
  29.         new hostname[64]
  30.        
  31.         get_cvar_string("hostname", hostname, 63)
  32.         replace(g_Messages[g_Current], 380, "%hostname%", hostname)
  33.        
  34.         set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2], X_POS, Y_POS, 2, 0.5, HOLD_TIME, 0.2, 1.0, 1)
  35.         show_hudmessage(0, "%s", g_Messages[g_Current])
  36.         client_print(0, print_console, "%s", g_Messages[g_Current])
  37.         ++g_Current
  38.        
  39.         new Float:freq_im = get_cvar_float("amx_freq_imessage")
  40.        
  41.         if (freq_im > 0.0)
  42.                 set_task(freq_im, "infoMessage", 12345)
  43. }

  44. public setMessage()
  45. {
  46.         if (g_MessagesNum >= MAX_MESSAGES)
  47.         {
  48.                 server_print("%L", LANG_SERVER, "INF_REACH")
  49.                 return PLUGIN_HANDLED
  50.         }

  51.         remove_task(12345)
  52.         read_argv(1, g_Messages[g_MessagesNum], 380)
  53.        
  54.         while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}
  55.        
  56.         new mycol[12]
  57.        
  58.         read_argv(2, mycol, 11)                // RRRGGGBBB
  59.         g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
  60.        
  61.         mycol[6] = 0
  62.         g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
  63.        
  64.         mycol[3] = 0
  65.         g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
  66.        
  67.         g_MessagesNum++
  68.        
  69.         new Float:freq_im = get_cvar_float("amx_freq_imessage")
  70.        
  71.         if (freq_im > 0.0)
  72.                 set_task(freq_im, "infoMessage", 12345)
  73.        
  74.         return PLUGIN_HANDLED
  75. }

  76. public plugin_end()
  77. {
  78.         new lastinfo[8]

  79.         num_to_str(g_Current, lastinfo, 7)
  80.         set_localinfo("lastinfomsg", lastinfo)
  81. }
复制代码
回复

使用道具 举报

发表于 2009-7-24 17:49:42 | 显示全部楼层 来自 中国–河南–南阳
成功就好了...哈哈``
回复

使用道具 举报

发表于 2009-8-27 10:56:48 | 显示全部楼层 来自 中国–广东–珠海
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2009-10-4 17:43:38 | 显示全部楼层 来自 中国–广东–汕尾
很好啊!支持一下!
回复

使用道具 举报

发表于 2011-12-19 11:44:47 | 显示全部楼层 来自 中国–河北–衡水–桃城区
谢谢 看看下来
回复

使用道具 举报

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

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