搜索
查看: 9003|回复: 23

【以解决】高集成的imessage插件

[复制链接]
发表于 2010-12-20 11:20:00 | 显示全部楼层 |阅读模式 来自 四川成都
本帖最后由 homework 于 2011-8-27 09:45 编辑

用心静如水汉化的AMXX1.8.2 感觉很不错 里面做的修改很正点
遗憾的就是他的AMXX1.8.2包里面很多插件没有相应的源码
在此求下 他里面修改过的 imessage.amxx的源码,麻烦如水兄
或者 有此源码的朋友共享下,不胜感激!

还有一个他在statsx里面加了一段每局结束时最佳杀人统计
样式我没截到图大概是这样的:
在屏幕中间偏下的位置每局结束时候显示:
                     本局最佳杀手
           -------------------------------
                    XXXXX 共杀敌 XXX人
求知道源码的共享下,感谢!!!!代码找到了不知道怎么加到statsx里面去
  1. public eEndRound(){
  2.         if (g_iRoundEndTriggered) return PLUGIN_CONTINUE
  3.         g_iRoundEndTriggered=1
  4.         Round_Control=0
  5.         new i,maxkillcount
  6.         maxkillcount=0
  7.         new RoundEndMsg[513],ipos
  8.         new playerslist[32],playerscount
  9.         ipos=0
  10.         ipos+=format(RoundEndMsg[ipos],512-ipos,"本局最佳杀手")
  11.        
  12.         get_players(playerslist,playerscount)//Get  Players
  13.         for(i=0;i<playerscount;i++){
  14.                 if(playerkilled[playerslist[i]]&&playerkilled[playerslist[i]]>maxkillcount) maxkillcount=playerkilled[playerslist[i]]
  15.         }
  16.         if(maxkillcount){
  17.                 new playername[33],playeradded=0
  18.                 ipos+=format(RoundEndMsg[ipos],512-ipos,"^n(杀%d人)^n __________________________^n",maxkillcount)
  19.                 for(i=0;i<playerscount;i++){
  20.                         if(playerkilled[playerslist[i]]==maxkillcount){//WeiGet this players
  21.                                 get_user_name(playerslist[i],playername,32)
  22.                                 ipos+=format(RoundEndMsg[ipos],512-ipos,"%s^n",playername)
  23.                                 ++playeradded
  24.                                 if(playeradded>=3){
  25.                                         ipos+=format(RoundEndMsg[ipos],512-ipos,"......^n")
  26.                                         break;
  27.                                 }
  28.                         }
  29.                 }
  30.         }else{
  31.                 ipos+=format(RoundEndMsg[ipos],512-ipos,"^n__________________________^n大家太客气了,都没有杀敌^n")
  32.         }
  33.         set_hudmessage( 49, 179, 113, -1.0, 0.38, 2, 0.02, 5.0, 0.01, 0.01, 3 )
  34.         show_hudmessage(0,RoundEndMsg)
  35.         return PLUGIN_CONTINUE
  36. }
复制代码
插件效果图片如下:








本帖子中包含更多资源

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

×
发表于 2010-12-20 12:43:34 | 显示全部楼层 来自 云南西双版纳州景洪
显示在线OP和VIP?
回复

使用道具 举报

 楼主| 发表于 2010-12-20 13:19:23 | 显示全部楼层 来自 四川成都
本帖最后由 homework 于 2010-12-21 12:18 编辑
显示在线OP和VIP?
zhangsheng 发表于 2010-12-20 12:43


恩,他一起集成在imessage.amxx里面的,还自定义了2条消息

我没源码,找到了OP VIP在线显示 不知道怎么加进去

他的statsx.amxx里面还加了 每局结束显示当局最佳杀手显示
如图:

诚恳的希望 如水 兄能把您汉化AMXX1.8.2里面的statsx和imessage 2个插件的
源码共享一下,谢谢了。。。


为方便大家使用,把4楼zhangsheng大大的附件源码贴出来,附件里面有2个源码文件一个是imessage.sma,主要功能自己看源码就明白了,第二个附件的源码在五楼Best_Killer.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. #include <csstats>

  37. #define MAX_MESSAGES  100
  38. #define X_POS         -1.0
  39. #define Y_POS         0.12
  40. #define HOLD_TIME     12.0

  41. new g_Values[MAX_MESSAGES][3]
  42. new g_Messages[MAX_MESSAGES][384]
  43. new g_MessagesNum,g_subMsgNum
  44. new g_Current,g_subCurrent

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

  58. public infoMessage() {
  59.         if(g_Current==0) g_subCurrent=0
  60.         if (g_Current >= g_MessagesNum)
  61.         {
  62.                 g_subCurrent++;
  63.                 if(g_subCurrent>=g_subMsgNum){
  64.                         g_Current = 0
  65.                 }
  66.                 //在这里我们增加一个现实在线OP的模块
  67.                 new opmsg[512],playerslist[32],playerscount,i,pos,opcount
  68.                 get_players(playerslist,playerscount,"c")//Skip Bot
  69.                 opcount=0;
  70.                 if(g_subCurrent==1){
  71.                         opmsg="【当前在线执行OP】^n—————————————^n"
  72.                         pos=strlen(opmsg)
  73.                         for(i=0;i<playerscount;i++){
  74.                                 if(access(playerslist[i],ADMIN_IMMUNITY)){
  75.                                         new username[33]
  76.                                         get_user_name(playerslist[i],username,32)
  77.                                         opcount++
  78.                                         pos+=format(opmsg[pos],511-pos,"%s^n",username)
  79.                                 }
  80.                         }
  81.                         if(opcount==0) opmsg="【目前无OP在线】"
  82.                 }
  83.                 if(g_subCurrent==2){
  84.                         opmsg="【当前在线超级VIP】^n—————————————^n"
  85.                         pos=strlen(opmsg)
  86.                         for(i=0;i<playerscount;i++){
  87.                                 if(access(playerslist[i],ADMIN_RESERVATION)&&(!access(playerslist[i],ADMIN_IMMUNITY))){
  88.                                         new username[33]
  89.                                         get_user_name(playerslist[i],username,32)
  90.                                         opcount++
  91.                                         pos+=format(opmsg[pos],511-pos,"%s^n",username)
  92.                                 }
  93.                         }
  94.                         if(opcount==0) opmsg="【目前无超级VIP在线】"//We Do not display NO VIP
  95.                 }
  96.                 if(g_subCurrent==3){
  97.                         new name[32],stats[8],bodyhits[8]
  98.                         opmsg="【排行榜前5名】^n—————————————"
  99.                         pos=strlen(opmsg)
  100.                         new imax = get_statsnum()
  101.                         if (imax > 5) imax = 5
  102.                         for(new a = 0; a < imax; ++a){
  103.                                 get_stats(a, stats, bodyhits, name, 31)
  104.                                 pos+=format(opmsg[pos],511-pos,"^n%d. %s",a+1,name)
  105.                         }
  106.                 }
  107.                
  108.                 set_hudmessage(255,144,255,X_POS,Y_POS,2,0.1,HOLD_TIME,0.1,0.1,-1)
  109.                 show_hudmessage(0,opmsg)
  110.                 new Float:freq_im = get_cvar_float("amx_freq_imessage")               
  111.                 if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  112.         }
  113.         else {
  114.                 set_hudmessage(random_num(20,200), random_num(20,200), random_num(20,200),
  115.                 X_POS, Y_POS, 2, 0.1, HOLD_TIME , 0.1, 0.1, -1)
  116.                 show_hudmessage(0,g_Messages[g_Current])
  117.                 client_print(0,print_console,g_Messages[g_Current])
  118.                 ++g_Current
  119.                 new Float:freq_im = get_cvar_float("amx_freq_imessage")
  120.                 if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  121.         }
  122. }

  123. public setMessage() {
  124.         if (g_MessagesNum >= MAX_MESSAGES) {
  125.                 server_print("%L",LANG_SERVER,"INF_REACH")
  126.                 return PLUGIN_HANDLED
  127.         }
  128.         remove_task(12345)
  129.         read_argv(1,g_Messages[g_MessagesNum],380)
  130.         new hostname[64]
  131.         get_cvar_string("hostname",hostname,63)
  132.         replace(g_Messages[g_MessagesNum],380,"%hostname%",hostname)
  133.         while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){}
  134.         new mycol[12]
  135.         read_argv(2,mycol,11) // RRRGGGBBB
  136.         g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
  137.         mycol[6] = 0
  138.         g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
  139.         mycol[3] = 0
  140.         g_Values[g_MessagesNum][0] = str_to_num(mycol[0])
  141.         g_MessagesNum++
  142.         new Float:freq_im = get_cvar_float("amx_freq_imessage")
  143.         if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
  144.         return PLUGIN_HANDLED
  145. }

  146. public plugin_end() {
  147.         new lastinfo[8]
  148.         num_to_str(g_Current,lastinfo,7)
  149.         set_localinfo("lastinfomsg",lastinfo)
  150. }
复制代码

本帖子中包含更多资源

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

×
回复

使用道具 举报

发表于 2010-12-20 16:03:05 | 显示全部楼层 来自 云南西双版纳州景洪
自己去试,本人已经不搞服务器了

本帖子中包含更多资源

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

×
回复

使用道具 举报

 楼主| 发表于 2010-12-21 12:11:22 | 显示全部楼层 来自 四川成都
本帖最后由 homework 于 2010-12-21 12:20 编辑
自己去试,本人已经不搞服务器了
zhangsheng 发表于 2010-12-20 16:03

谢谢zhangsheng同志
你发的附件已经实现每局最后显示最佳杀手的效果
如图
我想修改下,修改内容如下:
1显示最佳杀手不用打印式的显示,一局结束就直接把整体所有信息显示出来,应该在哪里修改
2想修改下显示最佳杀手的字体颜色为白色,应该修改哪个地方
谢谢指教。建议:如果能把此插件集成到statsx.sma里面去就完美了,呵呵。附上源码:
  1. #include <amxmodx>
  2. #include <cstrike>

  3. new g_playerkilled[33];
  4. new g_maxplayers = 32;

  5. public plugin_init()
  6. {
  7.         register_plugin("Best Killer", "1.0", "Rulzy");
  8.         register_event("DeathMsg","eDeathMsg", "a", "1>0");
  9.         register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
  10.         register_logevent("eEndRound", 2, "0=World triggered", "1=Round_End");
  11.         g_maxplayers = get_maxplayers();
  12. }

  13. public client_connect(id)
  14. {
  15.         g_playerkilled[id] = 0;
  16. }

  17. public eNewRound()
  18. {
  19.         for(new i=1; i<=g_maxplayers; i++)
  20.                 g_playerkilled[i] = 0;
  21. }

  22. public eDeathMsg()
  23. {
  24.         new killer=read_data(1);
  25.         if(!is_user_connected(killer)) return PLUGIN_CONTINUE;
  26.         new victim=read_data(2);
  27.         if(!is_user_connected(victim)) return PLUGIN_CONTINUE;
  28.         if(get_user_team(killer)==get_user_team(victim)) return PLUGIN_CONTINUE; //TK
  29.         g_playerkilled[killer]++;
  30.         return PLUGIN_CONTINUE;
  31. }

  32. public eEndRound()
  33. {
  34.         new msg[513], maxkillcount = 0, maxkillplayercount = 0;
  35.         new ipos=format(msg, 512,"本局最佳杀手");
  36.         new maxkillplayerlist[32];
  37.         for(new i=1; i<=g_maxplayers; i++)
  38.         {
  39.                 if(!is_user_connected(i)) continue;
  40.                 if(g_playerkilled[i]>maxkillcount)
  41.                 {
  42.                         maxkillcount = g_playerkilled[i];
  43.                         maxkillplayercount = 1;
  44.                         maxkillplayerlist[maxkillplayercount-1] = i;
  45.                         }else if(g_playerkilled[i]==maxkillcount){
  46.                         maxkillplayercount++;
  47.                         maxkillplayerlist[maxkillplayercount-1] = i;
  48.                 }
  49.         }
  50.         if(maxkillcount>0)
  51.         {
  52.                 new name[33];
  53.                 ipos+=format(msg[ipos],512-ipos,"^n(杀%d人)^n————————————————^n", maxkillcount);
  54.                 if(maxkillplayercount<=3)
  55.                 {
  56.                         for(new i=0; i<maxkillplayercount; i++)
  57.                         {
  58.                                 get_user_name(maxkillplayerlist[i], name, 31);
  59.                                 ipos+=format(msg[ipos], 512-ipos, "%s^n", name);
  60.                         }
  61.                         }else{
  62.                         for(new i=0; i<2; i++)
  63.                         {
  64.                                 get_user_name(maxkillplayerlist[i], name, 31);
  65.                                 ipos+=format(msg[ipos], 512-ipos, "%s^n", name);
  66.                         }
  67.                         ipos+=format(msg[ipos],512-ipos,"......^n")
  68.                 }
  69.                 }else{
  70.                 ipos+=format(msg[ipos],512-ipos,"^n————————————————^n无伤亡^n")
  71.         }
  72.         set_hudmessage(80, 180, 101, -1.0, 0.6, 2, 0.02, 4.0, 0.02, 5.0, 2);
  73.         show_hudmessage(0, msg);
  74. }
复制代码

本帖子中包含更多资源

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

×
回复

使用道具 举报

发表于 2010-12-21 12:15:02 | 显示全部楼层 来自 云南西双版纳州景洪
set_hudmessage(颜色, 颜色, 颜色, -1.0, 0.6, 效果2改为0就不打字了, 0.02, 4.0, 0.02, 5.0, 2);
回复

使用道具 举报

发表于 2010-12-21 13:56:11 | 显示全部楼层 来自 广东中山
好东西.......
回复

使用道具 举报

发表于 2010-12-21 13:57:53 | 显示全部楼层 来自 广东中山
.....................
回复

使用道具 举报

发表于 2010-12-21 13:58:44 | 显示全部楼层 来自 广东中山
,,,,,,,,,,,,,,,,,,,,,,
回复

使用道具 举报

发表于 2011-1-10 02:36:57 | 显示全部楼层 来自 广西玉林
{:2_31:}支持一下!!!
回复

使用道具 举报

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

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