GetServerPort

From Multi Theft Auto: Wiki
Revision as of 20:48, 14 August 2007 by Jbeta (talk | contribs) (Added doc page, adapted from getServerName)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function retrieves the server's port.

Syntax

int getServerPort ( )

Returns

An integer corresponding to the server's port.

Example

This example creates a console command that outputs the server's port to the chatbox.

function outputServerPort ( )
	outputChatBox ( getServerPort( ) )
end

-- Add console command 'getServerPort'
addCommandHandler ( "getServerPort", outputServerPort )

See Also