搜索
查看: 5877|回复: 31

【求助】如何修改imessage.sma让其显示信息如打字一个个显示

[复制链接]
发表于 2005-2-10 01:36:28 | 显示全部楼层 |阅读模式 来自 广东深圳
请问各位大侠:如题,我要加什么函数才能实现,或是改代码的什么地方可以实现如题所说的效果?
盼回复!
附上imessage.sma的原码:

  1. /* AMX Mod X
  2. *   Info. Messages Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. *  originally developed by OLO
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. *  This program is free software; you can redistribute it and/or modify it
  11. *  under the terms of the GNU General Public License as published by the
  12. *  Free Software Foundation; either version 2 of the License, or (at
  13. *  your option) any later version.
  14. *
  15. *  This program is distributed in the hope that it will be useful, but
  16. *  WITHOUT ANY WARRANTY; without even the implied warranty of
  17. *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. *  General Public License for more details.
  19. *
  20. *  You should have received a copy of the GNU General Public License
  21. *  along with this program; if not, write to the Free Software Foundation,
  22. *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. *  In addition, as a special exception, the author gives permission to
  25. *  link the code of this program with the Half-Life Game Engine ("HL
  26. *  Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. *  L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. *  respects for all of the code used other than the HL Engine and MODs
  29. *  from Valve. If you modify this file, you may extend this exception
  30. *  to your version of the file, but you are not obligated to do so. If
  31. *  you do not wish to do so, delete this exception statement from your
  32. *  version.
  33. */

  34. #include <amxmodx>
  35. #include <amxmisc>

  36. #define MAX_MESSAGES  6
  37. #define X_POS         -1.0
  38. #define Y_POS         0.30
  39. #define HOLD_TIME     12.0

  40. new g_Values[MAX_MESSAGES][3]
  41. new g_Messages[MAX_MESSAGES][384]
  42. new g_MessagesNum
  43. new g_Current

  44. public plugin_init() {
  45.   register_plugin("Info. Messages",AMXX_VERSION_STR,"AMXX Dev Team")
  46.   register_dictionary("imessage.txt")
  47.   register_dictionary("common.txt")
  48.   register_srvcmd("amx_imessage","setMessage")
  49.   register_cvar("amx_freq_imessage","10")
  50.   new lastinfo[8]
  51.   get_localinfo("lastinfomsg",lastinfo,7)
  52.   g_Current = str_to_num(lastinfo)
  53.   set_localinfo("lastinfomsg","")
  54. }

  55. public infoMessage() {
  56.   if (g_Current >= g_MessagesNum)
  57.     g_Current = 0
  58.   set_hudmessage(g_Values[g_Current][0], g_Values[g_Current][1], g_Values[g_Current][2],
  59.     X_POS, Y_POS, 0, 0.5, HOLD_TIME , 2.0, 2.0, 1)
  60.   show_hudmessage(0,g_Messages[g_Current])
  61.   client_print(0,print_console,g_Messages[g_Current])
  62.   ++g_Current
  63.   new Float:freq_im = get_cvar_float("amx_freq_imessage")
  64.   if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  65. }

  66. public setMessage() {
  67.   if (g_MessagesNum >= MAX_MESSAGES) {
  68.     server_print("%L",LANG_SERVER,"INF_REACH")
  69.     return PLUGIN_HANDLED
  70.   }
  71.   remove_task(12345)
  72.   read_argv(1,g_Messages[g_MessagesNum],380)
  73.   new hostname[64]
  74.   get_cvar_string("hostname",hostname,63)
  75.   replace(g_Messages[g_MessagesNum],380,"%hostname%",hostname)
  76.   while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){}
  77.   new mycol[12]
  78.   read_argv(2,mycol,11) // RRRGGGBBB
  79.   g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
  80.   mycol[6] = 0
  81.   g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
  82.   mycol[3] = 0
  83.   g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
  84.   g_MessagesNum++
  85.   new Float:freq_im = get_cvar_float("amx_freq_imessage")
  86.   if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  87.   return PLUGIN_HANDLED
  88. }

  89. public plugin_end() {
  90.   new lastinfo[8]
  91.   num_to_str(g_Current,lastinfo,7)
  92.   set_localinfo("lastinfomsg",lastinfo)
  93. }
复制代码
 楼主| 发表于 2005-2-10 01:57:53 | 显示全部楼层 来自 广东深圳
另外谁有这两个插件的源码,有的麻烦回个贴,上传个附件,谢谢!
suicidetext.amxx
plugin_bonus1.amxx

我想自己汉化一下。。
回复

使用道具 举报

 楼主| 发表于 2005-2-10 21:33:47 | 显示全部楼层 来自 广东深圳
大家都过年了。不来看了?呵呵。新年里就给大家添麻烦了。帮自己顶一下。。
回复

使用道具 举报

发表于 2005-2-10 23:57:33 | 显示全部楼层 来自 广东深圳
了解set_hudmessage()就能实现。
回复

使用道具 举报

 楼主| 发表于 2005-2-11 03:45:00 | 显示全部楼层 来自 广东深圳
不知道如何定义函数,可否赐教?
回复

使用道具 举报

发表于 2005-2-11 10:47:39 | 显示全部楼层 来自 湖南株洲
Post by kitshmily
另外谁有这两个插件的源码,有的麻烦回个贴,上传个附件,谢谢!
suicidetext.amxx
plugin_bonus1.amxx

我想自己汉化一下。。

已经汉化了,你自己修改
对了,我的UE不能用了,现在怎么汉化修改插件?

本帖子中包含更多资源

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

×
回复

使用道具 举报

发表于 2005-2-11 12:30:30 | 显示全部楼层 来自 香港
Post by A082
已经汉化了,你自己修改
对了,我的UE不能用了,现在怎么汉化修改插件?

suicidetext.amxx
plugin_bonus1.amxx
@2插件有甚N用?
回复

使用道具 举报

发表于 2005-2-11 19:51:42 | 显示全部楼层 来自 北京
Post by powerppl
suicidetext.amxx
plugin_bonus1.amxx
@2插件有甚N用?
据观察,都是有关‘杀人奖励’的
回复

使用道具 举报

发表于 2005-2-11 22:22:36 | 显示全部楼层 来自 广东深圳
修改如下:
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分别表示:进来速度,出去速度。用来控制打字的速度,修改到你满意为止。
回复

使用道具 举报

 楼主| 发表于 2005-2-12 03:40:16 | 显示全部楼层 来自 广东深圳
谢谢。。。。。我真是太感动了。。。。谢谢你的指教。。。
源码我已修改了。编绎也通过了。放到服务器上已经实现如我所说那样了。呵呵。
回复

使用道具 举报

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

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