Squirrel/Server/Functions/Server/SetPort
From Liberty Unleashed Wiki
(Difference between revisions)
m (→Notes: Fixed broken link to onPlayerCommand) |
m (Redirect issue fix) |
||
Line 30: | Line 30: | ||
== Related Functions == | == Related Functions == | ||
− | {{Squirrel/Functions/Server}} | + | {{Squirrel/Server/Functions/Server}} |
Latest revision as of 18:33, 15 January 2012
Changes the port your server will be running on.
[edit] Syntax
bool SetPort( int port )
[edit] Arguments
- port - This is the port you want the server to be running on
[edit] Example
This example will change the server port when a player types '/setport 5192'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "setport" ) { SetPort( text.tointeger() ); } }
[edit] Notes
The call onPlayerCommand was also used in the example. More info about this in the corresponding page.