1. Hello, I'm really new to this API. But i'm familiar with lua... but.. I'm trying to get client to connect to a different server by typing a command, which.. hasn't been doing anything which is concerning me.

    Code:
    Code:
    elseif(args[0] == "join")then
                for k, v in pairs(self.Config.Servers)do
                    if(v["servername"] == args[1])then
                        rust.RunClientCommand(player, "disconnect")
                        rust.RunClientCommand(player, "client.connect " .. v["ip"] .. ":" .. v["port"])
                    else
                        rust.SendChatMessage(player,
                        self.Config.Settings.Prefix .. "Sorry, that server is not in existance!\n "..
                        "Try `/hub list`!")
                    end
                end
    
    and my config file:
    Code:
    "Servers": [
        {
          "ip": "127.0.0.1",
          "port": "28017",
          "servername": "RadControl"
        },
        {
          "ip": "127.0.0.1",
          "port": "28019",
          "servername": "SurvivalN"
        },
        {
          "ip": "127.0.0.1",
          "port": "28019",
          "servername": "SurvivalF"
        },
        {
          "ip": "127.0.0.1",
          "port": "28019",
          "servername": "GunGame"
        },
        {
          "ip": "127.0.0.1",
          "port": "28019",
          "servername": "Sandbox"
        },
        {
          "ip": "127.0.0.1",
          "port": "28019",
          "servername": "RustyRP"
        }
      ],
    
    There's much more code to the plugin, but i'm not going to show it.

    Thanks for your help!
     
  2. Wulf

    Wulf Community Admin

    You can't run a command on a player that isn't connected anymore, so this will not work. I'm sure there are other ways, but you'll need to be careful as to not cause your server to get blacklisted for redirecting.
     
  3. Hmm... I thought it could get last remembered commands...
    And i think the Rust Developers disabled Servers doing clientside commands like "client.connect ip:port" and "disconnect"
    I wish there's a way to redirect people.
    [DOUBLEPOST=1451366496][/DOUBLEPOST]Unless you have any ideas?
    [DOUBLEPOST=1451366608][/DOUBLEPOST]Servers getting blacklisted for redirection? Really, i was going to make a hub system.. but.. i guess that's a waste of time then..
     
  4. Wulf

    Wulf Community Admin

    You can still run the commands, but there would be no client to tell to connect to another server after you've disconnected them. You can't make them connect to another while they are still connected either, at least not via the console commands.

    As for the blacklisting, it's generally there for handling servers that pretend to be one server, then redirect the players to another. I'm not saying you would be for sure, I'm just saying be careful.
     
  5. Alrighty, yeah. I understand, why they would blacklist those servers. I was kinda wondering could you do "disconnect; client.connect IP : Port"(Trying avoid the emotes)?

    Why i was thinking that was because, I recently came from the Garry's Mod modding community.
    And i don't know nor i have tried multi commands, in one command.
    If you don't know what ";" means, its a splitter from command A to B, and it will run both as one basically.
    [DOUBLEPOST=1451368198][/DOUBLEPOST]Also, your response time is awesome! Any other Modding Discussion are horrible to ask questions on to get responses and fix your issues with your development projects.
     
  6. Wulf

    Wulf Community Admin

    No, the client isn't there to receive the 'client.connect' command after you've disconnected them.
     
  7. Ahh.. Thats kinda sucks, Well thanks for you help!
    +1 rep Wulf(I don't know how to give you reputation)
     
  8. Hello wulf has some plugin or some way to redirect the player from one server to another example: player connects to the server 1 and during loading the game and redirected to the server 2?
     
  9. All this sounds pretty shady IMHO, as a player I wouldn't want servers issuing client commands on my behalf. You should do one of two things, in your server description mention the server they should connect to. Or for your server address give out a domain name like RustyXRayHunter.com and just change what IP it points to if you need to change servers.
     
  10. I've also once tried to create a command for users, so they could connect to our minigame server.
    The Server can make the client run a command (like chat.add etc.), but client.connect etc. isn't working.
     
  11. client.connect doesnt work while connected to a server. you need to be disconnected first other then that you get the error already connected to server
     
  12. Try bind ))
     
  13. The OP wants to Redirect players to another server via a plugin and not a keybind.
     
  14. Other ways to do a redirect - no