Squirrel/Functions/Server/GetServerName

From VC-MP Wiki

Jump to: navigation, search

This returns the name of the server.

Syntax

string GetServerName()


Arguments

  • None

Example

This example will return the server name when a player types '/c server'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "server" )
     {
          MessagePlayer( "You are playing on: " + GetServerName(), player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting