Raised This Month: $ Target: $400
 0% 

Solved [CSGO] Transfer all players to another server at once


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wizzardoff
Senior Member
Join Date: Dec 2022
Old 07-02-2023 , 08:49   [CSGO] Transfer all players to another server at once
Reply With Quote #1

Is there any way /plugin that can instantly transfer all players on the server to another server? Can it work with a plugin?

Last edited by Wizzardoff; 07-14-2023 at 11:08.
Wizzardoff is offline
boink
Member
Join Date: May 2021
Location: Australia
Old 07-02-2023 , 17:07   Re: [CSGO] Transfer all players to another server at once
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=322306
__________________
@.boink. on Discord | DM for Plugin Requests | Tip Jar
boink is offline
Wizzardoff
Senior Member
Join Date: Dec 2022
Old 07-02-2023 , 17:50   Re: [CSGO] Transfer all players to another server at once
Reply With Quote #3

This is autoredirection and redirection plugin which i have already activated, but i need for ex a plugin or command for admin / rcon to transfer ALL playsers at once or just 1 player on the server to another server. Auto redirecting does redirecting one by one and admin cant do it.
Wizzardoff is offline
boink
Member
Join Date: May 2021
Location: Australia
Old 07-02-2023 , 18:48   Re: [CSGO] Transfer all players to another server at once
Reply With Quote #4

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_ServerChangeADMFLAG_ROOT);
}


public 
Action Command_ServerChange(int clientint args) {
    
char arg[64];
    if(
args 1) {
        return 
Plugin_Handled;
    }

    
GetCmdArg(1arg64);

    
char ip[64];
    
FormatEx(ipsizeof(ip), "%s:%s"serverIParg);

    
int port StringToInt(arg);

    for(
int i 1<= MaxClientsi++) {
        if(
IsClientInGame(i) && IsClientConnected(i)) {
            
RedirectClient(iip);
        }
    }
    return 
Plugin_Handled;

__________________
@.boink. on Discord | DM for Plugin Requests | Tip Jar

Last edited by boink; 07-02-2023 at 18:48.
boink is offline
Wizzardoff
Senior Member
Join Date: Dec 2022
Old 07-03-2023 , 14:37   Re: [CSGO] Transfer all players to another server at once
Reply With Quote #5

I get a warning, dont kniow if its important: sm 1.11

server_redirect_all.sp(22) : warning 204: symbol is assigned a value that is never used: "port"

Otherwise, great work,thank you very much. sm_sendtoserver "port" does the trick great. I suppose it doesnt work with sm_sendtoserver "wholeip" with compiled plugin with blank IP in the plugin because it uses server_redirect stuff,but i dont need bunch ips,just one so this is great.

Just one more thing, i noticed 2 ghost slots always left on the server which i transfered all players from. Cant be kicked,to remove them server restart needed. Is there any way to remove those? Can it be this plugin issue or some other plugin which does this after all players gone to another server?

Last edited by Wizzardoff; 07-03-2023 at 19:33.
Wizzardoff is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode