【源】[NO-sXe-I]玩家转移
本帖最后由 刘半仙【仙】 于 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 无源就人权!
源码:/****************************************************************************\
* 玩家控制 *
* 服务器白天玩家不多,晚上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
new g_userPlayers
new g_readysend= ""
new ReadyTime
new Readysend
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=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, iName;
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=0)
}
case 2:
{
sendallp()
}
}
return PLUGIN_HANDLED;
}
sendallp()
{
for(new i=0;i<=32;i++)
{
if(is_user_connect(id)){
new name
get_user_name(i,name,31)
if(contain(name,g_readysend) == -1)
{
Sendplayer(i)
}
}
}
return PLUGIN_HANDLED;
}
public Sendplayer(id)
{
ReadyTime = 31;
set_task(1.0, "PlayerSend", TASKID_READY+id, _, _, "a", ReadyTime);
}
public PlayerSend(taskid)
{
new id = taskid - TASKID_READY;
if(is_user_connected(id) && Readysend)
{
ReadyTime--;
new ThesMsg;
ThesMsg = "------------------------------";
copy(ThesMsg, ReadyTime, ThesMsg);
client_print(id, print_center, "^x0A^x0D^x0A^x0D亲爱的非SXE玩家^x0A^x0D%s^x0A^x0D还剩余%d秒被转移到另一服务器^x0A^x0D", ThesMsg, ReadyTime);
if(ReadyTime < 1)
{
new kyo_serverport = get_cvar_num("amx_kyo_serverport")
new kyo_server
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)
case 9: showMenu(id,--g_userPosition)
default:{
new option = g_userPosition * 8 + key
new index = g_userPlayers
if (is_user_connected(index)){
new name
get_user_name(index,name,31)
if(contain(name,g_readysend) == -1)
{
client_print(id, print_center, "请不要对反作弊玩家动粗")
}
else
{
if(!Readysend)
{
Readysend = true
Sendplayer(index)
}
else
client_print(id, print_center, "该玩家已经在传送队列中")
}
}
}
}
return PLUGIN_HANDLED
}
showMenu(id,pos){
if (pos < 0) return PLUGIN_HANDLED
new menu_body, inum, k = 0, start = pos * 8
get_players(g_userPlayers,inum)
if (start >= inum) start = pos = g_userPosition = 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, 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,name,31)
keys |= (1<<k)
len += format(menu_body,511-len,"%d. %s^n\w",++k,name)
}
if (end != inum){
format(menu_body,511-len,"^n9. More...^n0. %s" , pos ? "Back" : "Exit" )
keys |= (1<<8)
}
else format(menu_body,511-len,"^n0. %s" , pos ? "Back" : "Exit" )
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
}
public client_authorized(id)
{
Readysend = false;
}
public client_disconnect(id)
{
if(Readysend)
Readysend = false;
}
不会设置恢复可见!!! 有什么提议!往下跟帖! 支持~支持~支持~ 先帮楼主顶一下~~ 这个一定要顶,支持开源 裸奔者 发表于 2013-4-4 14:14 static/image/common/back.gif
支持~支持~支持~
求教!!! 回复后可见。。。! 七星 发表于 2013-4-5 21:49 static/image/common/back.gif
这个一定要顶,支持开源
求教!!! 回复后可见。。。!{:3_48:} 不开sXe的我怒了!!:@ 好用吗?不可以设置人满的时候会员进入才转F就好 LASTCS 发表于 2013-4-15 03:35 static/image/common/back.gif
不开sXe的我怒了!!
{:3_58:}sorry! 不输入5个汉字不行! 便衣队长 发表于 2013-5-1 20:34 static/image/common/back.gif
好用吗?不可以设置人满的时候会员进入才转F就好
{:3_55:} 通道插件 一般都是寻找 ping高 或者最后进入服务器的玩家 转移! 你改成寻找到一个 no sxe的就好了! {:3_48:}
页:
[1]
2