Jump to content

onPlayerConnect


OU1AVIER

Recommended Posts

Hello Forum,

i just tryed to make a reconnect via redirectPlayer and onPlayerConnect.

There no Errors or something others. I´m still learning Lua but i cant find the solution.

    function redirect (thePlayer) 
    name = getPlayerName(thePlayer) 
    redirectPlayer (name, "xxx.xxx.xxx.xxx","xxxxx") 
    end 
     
    addEventHandler ( "onClientPlayerSpawn", thePlayer(), redirect ) 

Maybe someone can help me to understand the issue. :roll:

Link to comment
function fncPlayerJoin() 
    local ServerIP = "123.45.67.890"  -- Server IP stored as a string 
    local ServerPort = 12345  -- Server Port stored as an integer 
    redirectPlayer(source,ServerIP,ServerPort) 
end 
addEventHandler("onPlayerJoin",getRootElement(),fncPlayerJoin) 

Put it in the server-sided script file.

Edited by Guest
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...