ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getServerName

Function

getServerName

Server and clientServerIdentical to MTA:SA

Returns the server name from server-config.json (the one players see in the launcher's server list).

Syntax

string getServerName()

Returns

The server name.

Example

addEventHandler("onPlayerJoin", root, function()
    outputChatBox("Witaj na " .. getServerName() .. "!", source)
end)

Notes

Client. Works in a client script too (the name from the moment of joining).

See also