GetServerHttpPort: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int getServerHttpPort (22003 )
int getServerHttpPort ( )
</syntaxhighlight>
</syntaxhighlight>


Line 17: Line 17:
function(player, command)
function(player, command)


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


end)
end)

Revision as of 14:50, 16 December 2014

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