Jump to content

Redirect


Try

Recommended Posts

Heyo guysssssss!!!

i have one code but i don't me get redirected i need other get redirected

function joinserverHandlerFunction (playerSource, commandName, serverIP, serverPort, serverPassword)

if serverIP and serverPort then --if IP and Port were specified

if serverPassword then --if also a password was specified

redirectPlayer (playerSource, serverIP, tonumber(serverPort), serverPassword) --redirect the player

else -- else if no password was specified

redirectPlayer (playerSource, serverIP, tonumber(serverPort)) --redirect the player without using the serverPassword parameter

end

else -- if no IP or Port have been specified

outputChatBox ("Error! Correct Syntax: /joinserver IP Port [Password]", playerSource) --output an Error message to the chatbox

end

end

addCommandHandler ("joinserver", joinserverHandlerFunction)

Like i don't need put the ip

i need put the people name and he get directed but with one ip

Link to comment

u don't understant

i need like this:

function joinserverHandlerFunction (name, commandName, player)

redirectPlayer (name, 194.187.214.31,22065)

end

addCommandHandler ("redirect", joinserverHandlerFunction)

then i do /redirect and the people get redirected

Link to comment

Oh, i'm sorry, I didn't read carefully :oops: .

function joinserverHandlerFunction (client, commandName, player) 
local pl = getPlayerFromName(player) 
if pl then 
redirectPlayer (pl, "194.187.214.31","22065") 
  end 
end 
addCommandHandler ("redirect", joinserverHandlerFunction) 

Try with that.

Link to comment

And here is the one for your first code

function joinserverHandlerFunction (playerSource, commandName, playerName, serverIP, serverPort, serverPassword) 
if serverIP and serverPort then --if IP and Port were specified 
if not getPlayerFromName(playerName) then return end 
if serverPassword then --if also a password was specified 
redirectPlayer (getPlayerFromName(playerName), serverIP, tonumber(serverPort), serverPassword) --redirect the player 
else -- else if no password was specified 
redirectPlayer (getPlayerFromName(playerName), serverIP, tonumber(serverPort)) --redirect the player without using the serverPassword parameter 
end 
else -- if no IP or Port have been specified 
outputChatBox ("Error! Correct Syntax: /joinserver IP Port [Password]", playerSource) --output an Error message to the chatbox 
end 
end 
addCommandHandler ("joinserver", joinserverHandlerFunction) 

use it like this: /joinserver

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...