/connect chat commands

Could someone help me create a chat command that switches ips of the user like on !connect or /connect [server name]

Much appreciated.

I’m using Darkrp 2.4.3

I would think you’d have to run a concommand (connect “ip”) and create the chat command for it. What Admin mod would this be for?


[editline]15th March 2014[/editline]

I believe I figured it out

hook.Add("OnPlayerChat", "ChangeServers", function( ply, text, bTeamOnly, bPlayerIsDead )

local servers = {
    ["DarkRP"] = {"darkrp", ""},

local explode = string.Explode(" ", text)
    for k,v in pairs(servers) do
        if explode[1] == "!connect" and explode[2] == servers[k][1] then
            ply:ConCommand("connect "..servers[k][2])

-snip didn’t see the chat command-
Where does explode come from this? also why would it be that one specific IP rather than you being able to enter any ip/servername etc.