RedirectPlayer: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Server function}} This function redirects the player to a specified server.<br> ==Syntax== <syntaxhighlight lang="lua"> bool redirectPlayer ( player thePlayer, string serverIP, int serverPor...) |
No edit summary |
||
Line 20: | Line 20: | ||
==Example== | ==Example== | ||
This example | This example redirects the player to another server when they join. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function joinserverHandlerFunction (playerSource | function joinserverHandlerFunction(playerSource) | ||
redirectPlayer (playerSource, 192.168.1.3, 22003, "potatoes") --redirect the player | |||
end | end | ||
addEventHandler("onPlayerJoin",root, joinserverHandlerFunction) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player_functions}} | {{Player_functions}} |
Revision as of 08:32, 4 June 2011
This function redirects the player to a specified server.
Syntax
bool redirectPlayer ( player thePlayer, string serverIP, int serverPort, [ string serverPassword ] )
Required Arguments
- thePlayer: The player you want to redirect
- serverIP: The ip of the server you want to redirect the player to
- serverPort: The game port of the server you want to redirect the player to
Optional Arguments
- serverPassword: The password for the server if it's protected
Returns
Returns true if the player was redirected successfully, false if bad arguments were passed.
Example
This example redirects the player to another server when they join.
function joinserverHandlerFunction(playerSource) redirectPlayer (playerSource, 192.168.1.3, 22003, "potatoes") --redirect the player end addEventHandler("onPlayerJoin",root, joinserverHandlerFunction)
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState