I want to let some friends connect to my server just by clicking a simple button in the Garry's Mod menu. To do that I have added some code to the mainmenu.lua file of Garry's mod. The Button and all other things work, only the RunConsoleCommand("connect", "mycoolgmodserverip.com") fails... In the Console I can find the error Bad server address ("mycoolgmodserverip.com") like when I would type connect "mycoolgmodserverip.com" in the console. But I have to remove the quotes... It does not work with RunConsoleCommand("connect", 'mycoolgmodserverip.com') too.. Do you have any idea?
0
votes
1 Answers
1
votes
According to the Garry's Mod source code, you may call JoinServer in the menu state.
Examples:
JoinServer(address)
JoinServer("myepicserverip.com")
connect "someserver.com"on the command line yourself you get the error with the quotes butconnect someserver.comdoesn't give you that error with the quotes (pick some string that triggers thatBad server addresserror to test with)? - Etan ReisnerRunConsoleCommand) in the error? Or does the error always use double quotes? - Etan Reisner