Using the
server_redirect.inc api will allow you to make a separate plugin to manage redirects, here's an example of a command that will send ALL players in the server, but you can extend it by using the
ProcessTargetString function to retrieve players by target.
PHP Code:
#include <server_redirect>
char serverIP[] = "xxx.xxx.xxx.x";
public void OnPluginStart() {
// sm_sendtoserver <port>
RegAdminCmd("sm_sendtoserver", Command_ServerChange, ADMFLAG_ROOT);
}
public Action Command_ServerChange(int client, int args) {
char arg[64];
if(args < 1) {
return Plugin_Handled;
}
GetCmdArg(1, arg, 64);
char ip[64];
FormatEx(ip, sizeof(ip), "%s:%s", serverIP, arg);
int port = StringToInt(arg);
for(int i = 1; i <= MaxClients; i++) {
if(IsClientInGame(i) && IsClientConnected(i)) {
RedirectClient(i, ip);
}
}
return Plugin_Handled;
}
__________________