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
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 #1

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
Reply


Thread Tools
Display Modes

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 03:21.


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