|
发表于 2010-4-2 13:41:26
|
显示全部楼层
|阅读模式
来自 中国–广东–惠州–惠城区
本帖最后由 zwfgdlc 于 2010-4-4 15:03 编辑
得到sXe测试版时做的,看到很多人需要,发上给方便大家。
使用方法很简单,打开OP菜单,一直按“下一页”,
到最后一页就会有一个"打开sXe截图管理菜单"的菜单项。
选择菜单就会弹出在线玩家菜单。
剩下的大家都知道怎么做了。
- #include <amxmodx>
- #define PLUGIN_NAME "sXe ScreenShots"
- #define PLUGIN_VERSION "0.1"
- #define PLUGIN_AUTHOR "zwfgdlc"
- #if AMXX_VERSION_NUM < 181
- #define charsmax(%1) (sizeof(%1)-1)
- #endif
- new g_pcvar_sXe_required;
- new g_ScreenShotsMenu;
- new g_ScreenShotsCallback;
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- register_clcmd("amx_screen", "cmd_sXeScreenShots", ADMIN_BAN);
- g_ScreenShotsCallback = menu_makecallback("ScreenShotsMenuCallback");
- }
- public plugin_cfg()
- {
- g_pcvar_sXe_required = get_cvar_pointer("__sxei_required");
-
- if (!g_pcvar_sXe_required)
- {
- server_print("^xC3^xBB^xD3^xD0^xBC^xD3^xD4^xD8^x73^x58^x65^xB7^xFE^xCE^xF1^xB6^xCB^xC4^xA3^xBF^xE9^x2C^xB2^xE5^xBC^xFE^xCD^xA3^xD6^xB9^xB9^xA4^xD7^xF7");
- pause("ad");
- }
- else
- {
- server_cmd("amx_addmenuitem ^"%s^" amx_screen d ^"%s^"",
- "^xE6^x89^x93^xE5^xBC^x80^x73^x58^x65^xE6^x88^xAA^xE5^x9B^xBE^xE7^xAE^xA1^xE7^x90^x86^xE8^x8F^x9C^xE5^x8D^x95", "sXe ScreenShots");
- }
- }
- public cmd_sXeScreenShots(id, level)
- {
- if (!(get_user_flags(id) & level))
- {
- client_print(id, print_chat, "你没有权限执行这个命令!");
- return PLUGIN_HANDLED;
- }
-
- new Players[32], iNum, Name[32], index[3], player;
-
- get_players(Players, iNum);
- g_ScreenShotsMenu = menu_create("在线玩家列表", "menu_handle");
-
- for (new i=0; i<iNum; i++)
- {
- player = Players[i];
- get_user_name(player, Name, charsmax(Name));
- num_to_str(player, index, charsmax(index))
- menu_additem(g_ScreenShotsMenu, Name, index, 0, g_ScreenShotsCallback);
- }
-
- menu_setprop(g_ScreenShotsMenu, MPROP_BACKNAME, "返回上一页");
- menu_setprop(g_ScreenShotsMenu, MPROP_NEXTNAME, "下一页");
- menu_setprop(g_ScreenShotsMenu, MPROP_EXITNAME, "退出菜单");
- menu_display(id, g_ScreenShotsMenu);
-
- return PLUGIN_HANDLED;
- }
- public menu_handle(id, menu, item)
- {
- if (item < 0)
- {
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
-
- new cmd[3], access, callback, player;
-
- menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), _, _, callback);
- player = str_to_num(cmd);
- if (!is_user_connected(player))
- {
- client_print(id, print_chat, "玩家当前不在线!");
- return PLUGIN_HANDLED;
- }
- server_cmd("sxe_screen #%d #%d", get_user_userid(player), get_user_userid(id));
- server_exec();
- menu_destroy(menu);
-
- return PLUGIN_HANDLED;
- }
- public ScreenShotsMenuCallback(id, menu, item)
- {
- new cmd[3], access, callback, player, Name[32];
-
- menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), Name, charsmax(Name), callback);
- player = str_to_num(cmd);
-
- if (get_pcvar_num(g_pcvar_sXe_required) == 0) //非强制SXE
- {
- if (equali(Name, "[NO-sXe-I]", 10))//NOSXE玩家
- return ITEM_DISABLED;
- }
-
- if (is_user_bot(player) || id == player) //BOT,自己对自己,不能被截图
- return ITEM_DISABLED;
-
- return ITEM_ENABLED;
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|