Garry's Mod Wiki

GetHostName

  string GetHostName()

Description

Returns the name of the current server.

Returns

1 string
The name of the server.

Example

Print the current hostname.

MsgN( GetHostName( ) ) -- Loopback server, expected output: Garry's Mod.
Output:
Garry's Mod