GetPort

From Liberty Unleashed Wiki
Revision as of 23:23, 9 June 2011 by Juppi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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( plr, cmd, text )
  3. {
  4. if ( cmd == "players" )
  5. {
  6. Message( "Server is running on port: " + GetPort(), plr );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and call onPlayerCommand were used in this example. More info about them can be found in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox