|
本帖最后由 刘半仙【仙】 于 2013-5-29 21:50 编辑
服务器强制SXE担心人气不好!
晚上玩家多又给不了XE玩家通道
、 No SXE 玩家占位子
OP让NO sxe玩家转移到别的服务器
PS: 你自己的二服也好!朋友服务器也罢
冷清的论坛!
新手求鼓励!求测试
参数: "amx_kyo_server","127.0.0.1" //要转向的目的服务器.
"amx_kyo_serverport","27015" //端口
say cnm 呼出菜单
插件测试中 呼出菜单权限为所有玩家!
不喜勿喷
DT 无源就人权!
源码:- /****************************************************************************\
- * [No-sXe-I]玩家控制 *
- * 服务器白天玩家不多,晚上XE玩家多但是没有好的通道 *
- * 由管理员手动控制 传送非SXE玩家到指定服务器 同盟服&&二服&&三服 *
- * kyo is half of god *
-
- \****************************************************************************/
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN_NAME "menu everybody!"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "kyo!"
- #define TASKID_READY 1340
- new g_userPosition[33]
- new g_userPlayers[33][32]
- new g_readysend[33] = "[NO-sXe-I]"
- new ReadyTime[33]
- new Readysend[33]
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
- register_clcmd("say cnm","SHowOPmenu",0,"- 显示截图菜单") // 0 改成你要的权限
- register_menucmd(register_menuid("传送No_XE玩家"),1023,"actionStatsMenu")
- register_cvar("amx_kyo_server","119.135.184.222") //要转向的目的服务器.
- register_cvar("amx_kyo_serverport","27017") //端口
- }
- public SHowOPmenu(id)
- {
- //showMenu(id,g_userPosition[id]=0)
- new menu = menu_create("\r转移玩家 \d(选择转移类型)", "Select");
- /* 菜单选项*/
- menu_additem(menu, "\w单个玩家转移 ", "1", 0);
- menu_additem(menu, "\w全体玩家转移", "2", 0);
-
- /*end*/
- menu_setprop(menu, MPROP_EXITNAME, "\d让他们再呆会");
- menu_display(id, menu, 0);
- return PLUGIN_HANDLED;
- }
- public Select(id, menu, item)
- {
- new data[9], iName[64];
- new access, callback;
-
- menu_item_getinfo(menu, item, access, data,9, iName, 63, callback);
- new key = str_to_num(data);
- switch(key)
- {
- case 1:
- {
- showMenu(id,g_userPosition[id]=0)
-
- }
- case 2:
- {
- sendallp()
- }
- }
- return PLUGIN_HANDLED;
- }
- sendallp()
- {
- for(new i=0;i<=32;i++)
- {
- if(is_user_connect(id)){
- new name[32]
- get_user_name(i,name,31)
- if(contain(name,g_readysend) == -1)
- {
- Sendplayer(i)
- }
- }
- }
- return PLUGIN_HANDLED;
-
- }
- public Sendplayer(id)
- {
- ReadyTime[id] = 31;
- set_task(1.0, "PlayerSend", TASKID_READY+id, _, _, "a", ReadyTime[id]);
- }
- public PlayerSend(taskid)
- {
- new id = taskid - TASKID_READY;
- if(is_user_connected(id) && Readysend[id])
- {
- ReadyTime[id]--;
-
- new ThesMsg[32];
- ThesMsg = "------------------------------";
- copy(ThesMsg, ReadyTime[id], ThesMsg);
-
- client_print(id, print_center, "^x0A^x0D^x0A^x0D亲爱的非SXE玩家^x0A^x0D%s^x0A^x0D还剩余%d秒被转移到另一服务器^x0A^x0D", ThesMsg, ReadyTime[id]);
- if(ReadyTime[id] < 1)
- {
- new kyo_serverport = get_cvar_num("amx_kyo_serverport")
- new kyo_server[64]
- get_cvar_string("amx_kyo_server",kyo_server,63)
- client_cmd(id,"connect %s:%d",kyo_server,kyo_serverport);
- server_exec();
- remove_task(id+TASKID_READY);
- }
- }
- }
- public actionStatsMenu(id,key){
- switch(key){
-
- case 8: showMenu(id,++g_userPosition[id])
- case 9: showMenu(id,--g_userPosition[id])
- default:{
- new option = g_userPosition[id] * 8 + key
- new index = g_userPlayers[id][option]
- if (is_user_connected(index)){
-
- new name[32]
- get_user_name(index,name,31)
- if(contain(name,g_readysend) == -1)
- {
-
- client_print(id, print_center, "请不要对反作弊玩家动粗")
- }
- else
- {
- if(!Readysend[index])
- {
- Readysend[index] = true
- Sendplayer(index)
- }
- else
- client_print(id, print_center, "该玩家已经在传送队列中")
-
- }
- }
-
- }
- }
- return PLUGIN_HANDLED
- }
- showMenu(id,pos){
- if (pos < 0) return PLUGIN_HANDLED
- new menu_body[512], inum, k = 0, start = pos * 8
- get_players(g_userPlayers[id],inum)
- if (start >= inum) start = pos = g_userPosition[id] = 0
- new len = format(menu_body,511,"\y传送No_XE玩家\R%d/%d^n\w^n",pos + 1,((inum/8)+((inum%8)?1:0)))
- new name[32], end = start + 8, keys = (1<<9)|(1<<8)
- if (end > inum) end = inum
- for(new a = start; a < end; ++a){
- get_user_name(g_userPlayers[id][a],name,31)
- keys |= (1<<k)
- len += format(menu_body[len],511-len,"%d. %s^n\w",++k,name)
- }
-
- if (end != inum){
- format(menu_body[len],511-len,"^n9. More...^n0. %s" , pos ? "Back" : "Exit" )
- keys |= (1<<8)
- }
- else format(menu_body[len],511-len,"^n0. %s" , pos ? "Back" : "Exit" )
- show_menu(id,keys,menu_body)
- return PLUGIN_HANDLED
- }
-
- public client_authorized(id)
- {
-
- Readysend[id] = false;
- }
- public client_disconnect(id)
- {
- if(Readysend[id])
- Readysend[id] = false;
-
-
- }
复制代码 不会设置恢复可见!!! 有什么提议!往下跟帖! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|