GetServerPort: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added doc page, adapted from getServerName)
(No difference)

Revision as of 20:48, 14 August 2007

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