Connect Command

Hello, I currently am making a special script, anyway I am executing the console command “connect” and giving it a string argument which contains the proper format(x.x.x.x.x.x:xxxx), problem is, say if I do this:

RunConsoleCommand(“connect”, “1.2.3:1234”)

it doesn’t connect and comes up with an Error in the console saying:

Bad server address (“1.2.3:1234”)

I think it has something to do with the quote " marks.

-Manmax75

An IP address has 4 octets, your IP only has 3.

it was example, the actual IP is real and works, if i manually go into console and type “connect” then the ip it works good.

**[G.RunConsoleCommand

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.RunConsoleCommand)**

is there any other way I can do it?

[editline]11th January 2011[/editline]

What if i did say ply:ConCommand(“connect 1.2.3.4:1234”) on serverside?

bump?

I sent you a private message hours ago.

I don’t think you can run connect on a player anyway

If you look down in the page _nonSENSE suggested there is a big list of non runnable console commands and guess which one is there in bright red
That’s right, you probably didn’t read that and carried on reading this to find out that connect is a blocked command

Thank you for playing, and good night :stuck_out_tongue:

If you use ConCommand on the local player entity clientside you can run connect on clients.

[editline]12th January 2011[/editline]

[lua]LocalPlayer():ConCommand(“connect x.x.x.x:27015”)[/lua]

Thanks, all good now.