Jump to content

[Help]Redirect Server player


Lorder

Recommended Posts

addCommandHandler ( "go", 
    function ( player ) 
        setTimer ( 
            function ( ) 
                for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
                    redirectPlayer ( thePlayer, "91.121.70.169", 22017 ) 
                end 
            end 
            ,5000, 1 
        ) 
        outputChatBox ( "You Will be Moved to the Server in 5 sec ...", player ) 
        outputChatBox ( "Player ".. getPlayerName ( player ) .." Has Moved to the Server !", getRootElement(), 250, 255, 0 ) 
    end 
) 

I want to direct the tournament to the server everywhere

Link to comment
1 hour ago, Taka said:

Change "player" in argument to "thePlayer" from redirectPlayer function

Dude, I don't think this has anything to do with it, I can put potato over there that the resource will read as if it were thePlayer

10 minutes ago, Lorder said:

3pApmp.png

Does the following, places the resource name with administrator rights, goes in the ACL list in the Administration group and add resource."ResourceName"

  • Like 1
  • Haha 1
Link to comment

@Lorder try this:

function redirect(player)
    setTimer(function(target)
        redirectPlayer(target, "91.121.70.169", 22017)
	end ,5000, 1, player)
    outputChatBox("You will be moved to the other server in 5 seconds...", player)
    outputChatBox("Player "..getPlayerName(player).." has moved to the other server!", root, 250, 255, 0, true)
end
addCommandHandler("go", redirect)

 

Edited by koragg
Link to comment
4 hours ago, W4LK1NG said:

I think he wants to move all players from one server to another, so he used the


for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 

His problem is that the resource is not allowed to do such a thing.

I got confused a bit xD He's mixed up redirecting all players and redirecting one player in the code. If everyone will be redirected why is the last outputChatBox needed? :)

And yeah do as the guy above me said @Lorder.

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