Squirrel/Server/Functions/Server/GetServerName
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ = GetServerName = This returns the name of the server. == Syntax == <code>string GetServerName()</code> == Arguments == *'''None''' == Example == This example will return ...) |
Revision as of 14:39, 16 October 2008
GetServerName
This returns the name of the server.
Syntax
string GetServerName()
Arguments
- None
Example
This example will return the server name when a player types '/server'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "server" ) { MessagePlayer( "You are playing on: " + GetServerName(), id ); } }
Notes
The function [wiki:MessagePlayer MessagePlayer] and call [wiki:Squirrel/OnPlayerCommand OnPlayerCommand] were used in in this example. More info about them in corresponding pages.
Related Functions
The following functions are related to this one and they might be useful:
[wiki:SetServerName SetServerName] Sets the name of the server