搜索
查看: 5222|回复: 13

求助玩家菜单··

[复制链接]
发表于 2011-12-6 09:20:49 | 显示全部楼层 |阅读模式 来自 安徽宿州

本帖子中包含更多资源

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

×
 楼主| 发表于 2011-12-6 09:24:25 | 显示全部楼层 来自 安徽宿州
我想请教下玩家菜单打开后左边一般都是白色1.,2.,3.等等一直到8.这个是在一个服里看到的1-8数字觉得很漂亮。但是不知道怎么修改。我在plmenu的TXT文件里用\y〖\r1\y〗这种弄出来。游戏中显示的1.〖1〗前面白色1.还在。有知道这种怎么修改出来的么。知道的来告诉下。。谢谢了。。
回复

使用道具 举报

发表于 2011-12-6 09:36:02 | 显示全部楼层 来自 四川成都
  1. /* 由by:yzmzx在08年08月27日改写*/

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

  4. #define PLUGIN "ServerMenu"
  5. #define VERSION "1.3"
  6. #define AUTHOR "yzmzx"


  7. public plugin_init()
  8. {
  9.         register_plugin(PLUGIN, VERSION, AUTHOR)
  10.         register_clcmd( "opmenu","ShowMenu", -1, "Shows The Server Menu" )       
  11.         register_menucmd(register_menuid("\y【\d征战\r管理员菜单\y】"), 1023, "MenuCommand" )
  12.         return PLUGIN_CONTINUE
  13. }

  14. public ShowMenu( id )
  15. {
  16.         new szMenuBody[512]
  17.         new keys
  18.         //怎么给菜单选项加颜色\r \y \d \w分别代表什么颜色[红 黄 灰 白]
  19.         new nLen = format( szMenuBody, 511, "\y【\d征战\r管理员菜单\y】^n" )
  20.        
  21.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w1. \r【\yOP踢出玩家\r】" )
  22.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w2. \r【\yOP禁封玩家\r】" )
  23.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w3. \r【\yOP给予伤害\r】" )
  24.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w4. \r【\yOP队伍控制\r】" )
  25.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w5. \r【\yOP投票换图\r】" )
  26.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w6. \r【\yOP直接换图\r】" )
  27.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w7. \r【\yOP移除禁封\r】" )
  28.         nLen += format( szMenuBody[nLen], 511-nLen, "^n\w8. \r【OP重惩作弊】" )
  29.         nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\w0. \y退出" )
  30.        
  31.         keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<9)
  32.        
  33.         show_menu( id, keys, szMenuBody, -1 )
  34.         return PLUGIN_CONTINUE
  35. }

  36. public MenuCommand( id, key )
  37. {
  38.         switch( key )
  39.         {
  40.                 case 0: {
  41.                         client_cmd(id, "amx_kickmenu" )
  42.                 }
  43.                 case 1: {
  44.                         client_cmd(id, "amx_banmenu" )
  45.                 }
  46.                 case 2: {
  47.                         client_cmd(id, "amx_slapmenu" )
  48.                 }
  49.                 case 3: {
  50.                         client_cmd(id, "amx_teammenu" )
  51.                 }
  52.                 case 4: {
  53.                         client_cmd(id, "amx_votemapmenu" )
  54.                 }
  55.                 case 5: {
  56.                         client_cmd(id, "amx_mapmenu" )
  57.                 }
  58.                 case 6: {
  59.                         client_cmd(id, "removeiplist" )
  60.                 }
  61.                 case 7: {
  62.                         client_cmd(id, "amx_czmenu" )
  63.                 }
  64.                 case 9: {
  65.                         client_print( id, print_chat, "[菜单退出]" )
  66.                 }
  67.         }
  68.        
  69.         return PLUGIN_HANDLED
  70. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2011-12-6 13:55:46 | 显示全部楼层 来自 安徽宿州
3# homework
这个是OP管理菜单。我想要玩家playermenu.sma这个玩家菜单插件里1.2.3.4.5能设置图中效果。怎么操作呢大哥。
回复

使用道具 举报

发表于 2011-12-6 14:11:27 | 显示全部楼层 来自 广东深圳
:L你把菜单源码发上来。。。这个容易。。
回复

使用道具 举报

 楼主| 发表于 2011-12-6 14:26:23 | 显示全部楼层 来自 安徽宿州
  1. #include <amxmodx>
  2. #include <amxmisc>

  3. /* Player Menus        */

  4. #define        MAX_MENU_NUM 40

  5. new g_MenuName[        MAX_MENU_NUM ][32]
  6. new g_MenuCmd[ MAX_MENU_NUM ][32]
  7. new PMenuName[] = "Player Menu"
  8. new g_MenuItem[3][] = {
  9.         "Next",
  10.         "Back",
  11.         "Exit"
  12. }
  13. new g_cNum
  14. new g_menuPosition[33]

  15. public plugin_init() {
  16.         register_plugin("Player        Menu","0.1","nwb13")
  17.         register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
  18.         register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
  19.         new configs[64]
  20.         get_configsdir(configs,        63)
  21.         format(configs,        63, "%s/%s", configs, "plmenu.ini")
  22.         loadSettings(configs)
  23. }

  24. loadSettings(plmenuconfig[]) {
  25.         if (!file_exists(plmenuconfig))
  26.                 return 0
  27.         new temp[256]
  28.         new a, pos = 0
  29.         while (        g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {             
  30.         if ( temp[0] ==        ';' )
  31.                 continue
  32.         if (parse(temp,g_MenuName[g_cNum],31,g_MenuCmd[g_cNum],31) < 2)
  33.                 continue
  34.         ++g_cNum
  35.         }
  36.         return 1
  37. }

  38. public PlMenu(id){
  39.         if (is_user_connected(id))
  40.                 disPlayerMenu(id,g_menuPosition[id] = 0)
  41.         return PLUGIN_HANDLED
  42. }

  43. disPlayerMenu(id,pos)        {
  44.         if (pos        < 0)  return

  45.         new menuBody[512]
  46.         new b =        0
  47.         new start = pos * 8

  48.         if (start >= g_cNum )
  49.                 start = pos = g_menuPosition[id] = 0

  50.         new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )

  51.         new end = start + 8
  52.         new keys = MENU_KEY_0

  53.         if (end > g_cNum )
  54.                 end = g_cNum

  55.         for (new a = start; a < end; ++a) {
  56.                 keys |= (1<<b)
  57.                 len += format(menuBody[len],511-len,"%d. %s^n",++b,g_MenuName[a])
  58.         }

  59.         if (end != g_cNum ) {
  60.                     format(menuBody[len],511-len,"^n9. %s...^n0. %s", g_MenuItem[0], pos ? g_MenuItem[1] : g_MenuItem[2])
  61.                 keys |= MENU_KEY_9
  62.         }
  63.         else        format(menuBody[len],511-len,"^n0. %s",pos ? g_MenuItem[1] : g_MenuItem[2])

  64.         show_menu(id,keys,menuBody,-1,PMenuName)
  65. }

  66. public actionPlMenu(id,key){
  67.         switch(key){
  68.                 case 8:{
  69.                         disPlayerMenu(id,++g_menuPosition[id])
  70.                 }
  71.                 case 9:{
  72.                         disPlayerMenu(id,--g_menuPosition[id])
  73.                 }
  74.                 default:{
  75.                         new menuitem = g_menuPosition[id] * 8 +        key
  76.                         client_cmd(id,"%s",g_MenuCmd[menuitem])
  77.                 }
  78.         }
  79.         return PLUGIN_HANDLED
  80. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2011-12-6 14:27:26 | 显示全部楼层 来自 安徽宿州
5# yeweinan

playermenu源码我发上来了。。
回复

使用道具 举报

发表于 2011-12-6 15:05:18 | 显示全部楼层 来自 广东深圳
7# ckn911


#include <amxmodx>
#include <amxmisc>

/* Player Menus        */

#define        MAX_MENU_NUM 40

new g_MenuName[        MAX_MENU_NUM ][32]
new g_MenuCmd[ MAX_MENU_NUM ][32]
new PMenuName[] = "玩家菜单"
new g_MenuItem[3][] = {
        "下一页",
        "返回",
        "退出"
}
new g_cNum
new g_menuPosition[33]

public plugin_init() {
        register_plugin("玩家菜单","0.1","nwb13")
        register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
        register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
        new configs[64]
        get_configsdir(configs,        63)
        format(configs,        63, "%s/%s", configs, "plmenu.ini")
        loadSettings(configs)
}

loadSettings(plmenuconfig[]) {
        if (!file_exists(plmenuconfig))
                return 0
        new temp[256]
        new a, pos = 0
        while (        g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {              
        if ( temp[0] ==        ';' )
                continue
        if (parse(temp,g_MenuName[g_cNum],31,g_MenuCmd[g_cNum],31) < 2)
                continue
        ++g_cNum
        }
        return 1
}

public PlMenu(id){
        if (is_user_connected(id))
                disPlayerMenu(id,g_menuPosition[id] = 0)
        return PLUGIN_HANDLED
}

disPlayerMenu(id,pos)        {
        if (pos        < 0)  return

        new menuBody[512]
        new b =        0
        new start = pos * 8

        if (start >= g_cNum )
                start = pos = g_menuPosition[id] = 0

        new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )

        new end = start + 8
        new keys = MENU_KEY_0

        if (end > g_cNum )
                end = g_cNum

        for (new a = start; a < end; ++a) {
                keys |= (1<<b)
                len += format(menuBody[len],511-len,"\y[\r%d\y]\w %s^n",++b,g_MenuName[a])
        }

        if (end != g_cNum ) {
                    format(menuBody[len],511-len,"^n\y[\r9\y]\w %s...^n0. %s", g_MenuItem[0], pos ? g_MenuItem[1] : g_MenuItem[2])
                keys |= MENU_KEY_9
        }
        else        format(menuBody[len],511-len,"^n\y[\r0\y]\w %s",pos ? g_MenuItem[1] : g_MenuItem[2])

        show_menu(id,keys,menuBody,-1,PMenuName)
}

public actionPlMenu(id,key){
        switch(key){
                case 8:{
                        disPlayerMenu(id,++g_menuPosition[id])
                }
                case 9:{
                        disPlayerMenu(id,--g_menuPosition[id])
                }
                default:{
                        new menuitem = g_menuPosition[id] * 8 +        key
                        client_cmd(id,"%s",g_MenuCmd[menuitem])
                }
        }
        return PLUGIN_HANDLED
}
回复

使用道具 举报

 楼主| 发表于 2011-12-6 15:21:11 | 显示全部楼层 来自 安徽宿州

本帖子中包含更多资源

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

×
回复

使用道具 举报

 楼主| 发表于 2011-12-6 15:22:04 | 显示全部楼层 来自 安徽宿州
8# yeweinan

插件编译出来了。编译时候出现上面图片那句话没有影响吧。
回复

使用道具 举报

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

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