Squirrel/Server/Functions/Server/GetServerName
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Server/GetServerName moved to Squirrel/Server/Functions/Server/GetServerName: Separating from clientside scripts) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|GetServerName}} | |
= GetServerName = | = GetServerName = | ||
Revision as of 10:21, 11 October 2010
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 MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.