GetPort

From Liberty Unleashed Wiki
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