~Sr.Victor Posted August 4, 2020 Share Posted August 4, 2020 I wanted to place a command to do the redirection, and not as soon as it activates. Because I have a separate event server, and I need players to return to the official with a given command. local IP = "" local Porta = addEvent( "redirecionar", true ) addEventHandler( "redirecionar", root, function (player) for index, player in ipairs ( getElementsByType ( "player" ) ) do redirectPlayer ( player, IP, Porta ) end end ) Link to comment
Moderators Patrick Posted August 4, 2020 Moderators Share Posted August 4, 2020 And what is the question? Link to comment
~Sr.Victor Posted August 4, 2020 Author Share Posted August 4, 2020 Is it possible to put a command for players to be redirected? Link to comment
Moderators Patrick Posted August 4, 2020 Moderators Share Posted August 4, 2020 1 minute ago, ~Sr.Victor said: Is it possible to put a command for players to be redirected? Of course, just replace the custom-event to addCommandHandler in your code. Link to comment
~Sr.Victor Posted August 4, 2020 Author Share Posted August 4, 2020 I put it, but when I activate the mod the players are already redirected. Link to comment
Moderators Patrick Posted August 4, 2020 Moderators Share Posted August 4, 2020 18 minutes ago, ~Sr.Victor said: I put it, but when I activate the mod the players are already redirected. local IP = "127.0.0.1" local PORT = 22003 addCommandHandler("redirectall", function() for index, player in ipairs(getElementsByType("player")) do redirectPlayer(player, IP, PORT) end end) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now