Jump to content

Command


~Sr.Victor

Recommended Posts

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

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