GetServerPort: Difference between revisions
Jump to navigation
Jump to search
(→Syntax) |
|||
Line 14: | Line 14: | ||
This example Sends out the serverPort when you type: /serverport | This example Sends out the serverPort when you type: /serverport | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function outputServerPort ( | function outputServerPort (22005) | ||
local serverPort = getServerPort( | local serverPort = getServerPort(22005) | ||
outputChatBox (" Server Port: "103.38.90.34." ") --Output Serverport in Chatbox | outputChatBox (" Server Port: "103.38.90.34." ") --Output Serverport in Chatbox | ||
end | end |
Revision as of 11:30, 16 December 2014
This function retrieves the server's port.
Syntax
int getServerPort (22005 )
Returns
An integer corresponding to the server's port.
Example
This example Sends out the serverPort when you type: /serverport
function outputServerPort (22005) local serverPort = getServerPort(22005) outputChatBox (" Server Port: "103.38.90.34." ") --Output Serverport in Chatbox end addCommandHandler ( "serverport", outputServerPort ) --add the command Handler
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown