GetPort

From Liberty Unleashed Wiki
Revision as of 10:21, 11 October 2010 by VRocker (Talk | contribs)

Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This returns the port the server is running on.

Syntax

  1. int GetPort()

Arguments

  • None

Example

This will return the server port when a player types '/port'

  1.  
  2. function OnPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "port" )
  5. {
  6. MessagePlayer( "Server is running on port: " + GetPort(), id );
  7. }
  8. }
  9.  

Notes

The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Template:Squirrel/Functions/Server

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox