Squirrel/Server/Functions/Server/SetPort
From Liberty Unleashed Wiki
(Difference between revisions)
m (→Notes: Fixed broken link to onPlayerCommand) |
|||
Line 26: | Line 26: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Events/Player/ | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was also used in the example. More info about this in the corresponding page. |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Functions/Server}} | {{Squirrel/Functions/Server}} |
Revision as of 20:31, 7 September 2011
Changes the port your server will be running on.
Syntax
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'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "setport" ) { SetPort( text.tointeger() ); } }
Notes
The call onPlayerCommand was also used in the example. More info about this in the corresponding page.