Jump to content

what is the problem


top sniper

Recommended Posts

Posted

what is the problem with this code ?

function redirect() 
     redirectPlayer(source, "178.33.90.184", 20002) 
end 
addEventHandler("onPlayerJoin", root, redirect) 
  

Posted

FatalTerror, it has an error.

20002 must be in a string mode.

local ip = "178.33.90.184" 
local port = "20002" 
local root = getRootElement() 
  
addEventHandler("onPlayerJoin", root, 
function() 
     redirectPlayer(source, ip, port) 
end) 

Posted

Wrong, myonlake.

bool redirectPlayer ( player thePlayer, string serverIP, int serverPort, [ string serverPassword ]

Port must be in a integer only.

Posted
Cadu12 said:
Wrong, myonlake.

bool redirectPlayer ( player thePlayer, string serverIP, int serverPort, [ string serverPassword ]

Port must be in a integer only.

Cool, well, my server works just fine with string port.

Posted
  
function redirect() 
     redirectPlayer(source, "178.33.90.184", tonumber(20002)) 
end 
addEventHandler("onPlayerJoin", root, redirect) 
  
  

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...