|
发表于 2009-9-13 13:58:14
|
显示全部楼层
来自 中国–福建–漳州
本帖最后由 Rulzy 于 2009-9-13 14:00 编辑
- #include <amxmodx>
- #include <amxmisc>
- public plugin_init()
- {
- register_plugin("transfer player", "1.0", "Rulzy");
- register_concmd("amx_transfer", "cmdTransfer", ADMIN_LEVEL_A, "<#userid|username|@all> <server_ip> <server_port> [server_password] - transfer player(s) to another server.");
- }
- public cmdTransfer(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 4))
- return PLUGIN_HANDLED;
-
- new target[32], serverip[32], serverport[8], serverpassword[32]={0};
- read_argv(1, target, 31);
- read_argv(2, serverip, 31);
- read_argv(3, serverport, 7);
- read_argv(4, serverpassword, 31);
- if(equal(target, "@all"))
- {
- new maxplayers = get_maxplayers();
- for(new i=1;i<=maxplayers;i++)
- {
- if(is_user_connecting(i) || is_user_connected(i))
- {
- if(serverpassword[0])
- client_cmd(i, "password ^"%s^"; connect %s:%s", serverpassword, serverip, serverport);
- else
- client_cmd(i, "connect %s:%s", serverip, serverport);
-
- }
- }
- }
- new player = cmd_target(id, target, 11);
- if(!player) return PLUGIN_HANDLED;
- if(serverpassword[0])
- client_cmd(player, "password ^"%s^"; connect %s:%s", serverpassword, serverip, serverport);
- else
- client_cmd(player, "connect %s:%s", serverip, serverport);
- return PLUGIN_HANDLED;
- }
复制代码 未测试,请自行测试。 |
|