Squirrel/Server/Functions/Server/GetPort
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This returns the port the server is running on. == Syntax == <code>int GetPort()</code> == Arguments == *'''None''' == Example == This will return the server port when a pl...) |
m (Squirrel/Functions/Server/GetPort moved to Squirrel/Server/Functions/Server/GetPort: Separating from clientside scripts) |
Revision as of 04:19, 14 November 2009
This returns the port the server is running on.
Syntax
int GetPort()
Arguments
- None
Example
This will return the server port when a player types '/port'
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "port" ) { MessagePlayer( "Server is running on port: " + GetPort(), id ); } }
Notes
The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.