GetServerHttpPort: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with '__NOTOC__ {{Server function}} This function retrieves the server's http port. ==Syntax== <syntaxhighlight lang="lua"> int getServerHttpPort ( ) </syntaxhighlight> ===Returns=== An integer correspondin…')
 
m (Added example)
Line 11: Line 11:
An integer corresponding to the server's http port.
An integer corresponding to the server's http port.


==Example==  
==Example==
This example outputs server's HTTP port to the chat box when player uses command ''getHttpPort''
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- todo
addCommandHandler("getHttpPort",
function(player, command)
 
outputChatBox("HTTP port of this server is: " .. getServerHttpPort(), player, 0, 255, 0)
 
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 14:20, 29 February 2012

This function retrieves the server's http port.

Syntax

int getServerHttpPort ( )

Returns

An integer corresponding to the server's http port.

Example

This example outputs server's HTTP port to the chat box when player uses command getHttpPort

addCommandHandler("getHttpPort",
function(player, command)

outputChatBox("HTTP port of this server is: " .. getServerHttpPort(), player, 0, 255, 0)

end)

See Also