General > Developers Corner

Server Redirect (Command & Auto)

<< < (4/5) > >>

goodman854:

--- Quote from: Eccid on February 07, 2014, 03:58:03 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: ---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)
--- End code ---

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

What way are you wanting to call this?

--- End quote ---
It gives me Bad server address ("EDITEDoutIP")
The IP is there I just edited it out for you guys for now.

Eccid:

--- Quote from: goodman854 on February 07, 2014, 07:10:20 PM ---It gives me Bad server address ("EDITEDoutIP")
The IP is there I just edited it out for you guys for now.

--- End quote ---
If it's trying to connect and telling you bad address, the ip is wrong, not the code.

Neku:
I honestly don't see why you would be editing out your server ip, when it's public to anyone who joins it.

goodman854:

--- Quote from: Neku 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.

--- End quote ---
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?

Neku:
Check that ip. It looks short.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version