redirectPlayer | Multi Theft Auto: Wiki Skip to content

redirectPlayer

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function redirects the player to a specified server.

Note

A resource using this function needs ACL rights in order to work (function.redirectPlayer)

Syntax

redirectPlayer ( )

Code Examples

server

This example auto-redirects all connecting players to another given servers' IP:port.

local ip_port = "123.123.1.2:1234" -- enter IP and port in format: 192.168.1.1:22003
local password = "password_placeholder" -- If the server is passworded insert password here (if no password, it wont use the value)
function onConnectRedirect()
redirectPlayer(source, gettok(ip_port,1,":"), tonumber(gettok(ip_port,2,":")), password)
end
addEventHandler ("onPlayerJoin", root, onConnectRedirect)

See Also