搜索
查看: 2138|回复: 4

怎么把广告文字改位置?

[复制链接]
发表于 2006-7-2 22:17:32 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳
我想把文字改到空白的地方要如何修改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, 2, 0.5, HOLD_TIME , 0.1, 0.1, 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. }
复制代码

本帖子中包含更多资源

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

×
发表于 2006-7-2 22:24:14 | 显示全部楼层 来自 中国–云南–西双版纳傣族自治州–景洪市

回复: 怎么把广告文字改位置?

#define Y_POS         0.10
回复

使用道具 举报

 楼主| 发表于 2006-7-3 00:32:12 | 显示全部楼层 来自 中国–广东–深圳–罗湖区

回复: 怎么把广告文字改位置?

哦,谢谢zhangsheng !
回复

使用道具 举报

发表于 2006-7-3 00:49:28 | 显示全部楼层 来自 中国–云南–西双版纳傣族自治州–景洪市

回复: 怎么把广告文字改位置?

不客气!!!!!!嘿嘿!
回复

使用道具 举报

发表于 2006-7-20 23:07:52 | 显示全部楼层 来自 中国–广东–中山

回复: 怎么把广告文字改位置?

这个我会修改我的QQ20576526
回复

使用道具 举报

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

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