Author Topic: Server Redirect (Command & Auto)  (Read 18441 times)

0 Members and 1 Guest are viewing this topic.

Offline goodman854

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Re: Server Redirect (Command & Auto)
« Reply #15 on: February 07, 2014, 07:10:20 PM »
The issue here is that nothing is calling any of this. I don't even get what twilight is trying to do. When is this supposed to happen? For example, if I want someone to type "!newserver" into chat and be redirected to the new server, it would go like this.

Code: [Select]
hook.Add( "PlayerSay", "TTN Chat Commands", function(ply, text)
if (string.lower(text) == "!newserver" ) then --Did the player say the specific command?
ply:SendLua([[RunConsoleCommand("connect", "IP.ADRESS.GOES.HERE")]])--Replace IP.ADRESS.GOES.HERE with real IP
return "" --Keeps chat box from printing command
end
end)

Put that in lua\autorun\server and it will allow people to connect.

What way are you wanting to call this?
It gives me Bad server address ("EDITEDoutIP")
The IP is there I just edited it out for you guys for now.

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: Server Redirect (Command & Auto)
« Reply #16 on: February 07, 2014, 08:16:36 PM »
It gives me Bad server address ("EDITEDoutIP")
The IP is there I just edited it out for you guys for now.
If it's trying to connect and telling you bad address, the ip is wrong, not the code.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Server Redirect (Command & Auto)
« Reply #17 on: February 07, 2014, 08:44:30 PM »
I honestly don't see why you would be editing out your server ip, when it's public to anyone who joins it.
Out of the Garry's Mod business.

Offline goodman854

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Re: Server Redirect (Command & Auto)
« Reply #18 on: February 08, 2014, 09:34:07 AM »
I honestly don't see why you would be editing out your server ip, when it's public to anyone who joins it.
Yeah sorry there was a troll community following me around. Just an overly paranoid thing.
It gives me Bad server address ("198.50.26.34:27306")

What about that IP is wrong?

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Server Redirect (Command & Auto)
« Reply #19 on: February 08, 2014, 09:49:50 AM »
Check that ip. It looks short.
Out of the Garry's Mod business.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Server Redirect (Command & Auto)
« Reply #20 on: February 08, 2014, 09:57:21 AM »
IP looks good to me. I even found the server on GameTracker: http://www.gametracker.com/server_info/198.50.26.34:27306
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: Server Redirect (Command & Auto)
« Reply #21 on: February 08, 2014, 11:00:45 AM »
This works fine for me. It allowed me to connect to your server.

Code: [Select]
hook.Add( "PlayerSay", "TTN Chat Commands", function(ply, text)
if (string.lower(text) == "!newserver" ) then --Did the player say the specific command?
ply:SendLua("LocalPlayer():ConCommand('connect 198.50.26.34:27306')")
return "" --Keeps chat box from printing command
end
end)

Offline goodman854

  • Newbie
  • *
  • Posts: 14
  • Karma: 2
Re: Server Redirect (Command & Auto)
« Reply #22 on: February 08, 2014, 07:39:58 PM »
This works fine for me. It allowed me to connect to your server.

Code: [Select]
hook.Add( "PlayerSay", "TTN Chat Commands", function(ply, text)
if (string.lower(text) == "!newserver" ) then --Did the player say the specific command?
ply:SendLua("LocalPlayer():ConCommand('connect 198.50.26.34:27306')")
return "" --Keeps chat box from printing command
end
end)
You changed your code from
("connect", "IP.ADRESS.GOES.HERE")
to
('connect 198.50.26.34:27306')
It works now for me after that.

Thank you. Solved.