Squirrel/Server/Functions/Server/SetPort

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Squirrel/Functions/Server/SetPort moved to Squirrel/Server/Functions/Server/SetPort: Separating from clientside scripts)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SetPort}}
 
Changes the port your server will be running on.
 
Changes the port your server will be running on.
  

Revision as of 10:21, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

Changes the port your server will be running on.

Syntax

  1. bool SetPort( int port )

Arguments

  • port - This is the port you want the server to be running on

Example

This example will change the server port when a player types '/setport 5192'.

  1.  
  2. function OnPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "setport" )
  5. {
  6. SetPort( text.tointeger() );
  7. }
  8. }
  9.  

Notes

The call OnPlayerCommand was also used in the example. More info about this in the corresponding page.

Related Functions

Template:Squirrel/Functions/Server

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox