GetServerConfigSetting

From Multi Theft Auto: Wiki
Revision as of 22:37, 6 September 2024 by FileEX (talk | contribs) (→‎See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function retrieves server settings which are usually stored in the mtaserver.conf file.

Available in 1.1 and onwards

Syntax

mixed getServerConfigSetting ( string name )

Required Arguments

  • name : The name of the setting (setting names can be found here)

Returns

Returns a string containing the current value for the named setting, table if name is module or false if the setting does not exist.
If the setting name is serverip, may return the string "auto" on local servers.

Example

This example prints the server minimum allowed client version to the chatbox

outputChatBox( getServerConfigSetting ("minclientversion") )

This example creates a getServerIP helper function:

function getServerIP()
    return getServerConfigSetting("serverip")
end

See Also