Ulysses

General => Developers Corner => Topic started by: XxLMM13xX on April 15, 2015, 01:29:29 PM

Title: JoinServer
Post by: XxLMM13xX on April 15, 2015, 01:29:29 PM
Ok so i found this.... http://wiki.garrysmod.com/page/Global/JoinServer (http://wiki.garrysmod.com/page/Global/JoinServer)

this does not work as it is "a nil value"

How do i define this so it will connect a player to a different server?
Title: Re: JoinServer
Post by: Buzzkill on April 15, 2015, 02:18:00 PM
I'm not entirely sure JoinServer works as advertised.  I can't seem to get it to respond to anything.

In terms of connecting to a specific server,  you can use the following:

LocalPlayer():ConCommand("connect ip:port")
Title: Re: JoinServer
Post by: XxLMM13xX on April 15, 2015, 05:30:59 PM
I'll try this this! Thanks!
Title: Re: JoinServer
Post by: XxLMM13xX on April 16, 2015, 02:27:30 PM
This works! Thanks! Hey why wont: RunConsoleCommand( "connect", "ip:port" ) work?
Title: Re: JoinServer
Post by: Aaron113 on April 16, 2015, 02:52:08 PM
I believe it has to do with RunConsoleCommand putting quotes around each argument.  The connect command functions really weird, where you can't have quotes around the whole thing and you cannot have any additional spaces (or arguments) in the command either.  It just has to be connect ip:port with nothing extra.
Title: Re: JoinServer
Post by: XxLMM13xX on April 16, 2015, 03:58:30 PM
I believe it has to do with RunConsoleCommand putting quotes around each argument.  The connect command functions really weird, where you can't have quotes around the whole thing and you cannot have any additional spaces (or arguments) in the command either.  It just has to be connect ip:port with nothing extra.

Ah thanks!