GetServerConfigSetting: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server function}} This function retreives server settings which are usually stored in the '''mtaserver.conf''' file. {{New feature|3.0110|1.1| Available in 1.1 and o...") |
m (→See Also) |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function | This function retrieves server settings which are usually stored in the '''mtaserver.conf''' file. | ||
{{New feature|3.0110|1.1| | {{New feature|3.0110|1.1| | ||
Line 9: | Line 9: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
mixed getServerConfigSetting ( string name ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | |||
*'''name :''' The name of the setting (setting names can be found [[Server_mtaserver.conf|here]]) | |||
===Returns=== | ===Returns=== | ||
Returns a string containing the current value for the named setting, or ''false'' if the setting does not exist. | Returns a string containing the current value for the named setting, ''table'' if '''name''' is '''module''' or ''false'' if the setting does not exist.<br> | ||
If the setting name is ''serverip'', may return the string ''"auto"'' on local servers. | |||
==Example== | ==Example== | ||
Line 19: | Line 23: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
outputChatBox( getServerConfigSetting ("minclientversion") ) | outputChatBox( getServerConfigSetting ("minclientversion") ) | ||
</syntaxhighlight> | |||
This example creates a <code>getServerIP</code> helper function: | |||
<syntaxhighlight lang="lua"> | |||
function getServerIP() | |||
return getServerConfigSetting("serverip") | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions|server}} |
Latest revision as of 22:37, 6 September 2024
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
- setServerConfigSetting
- getServerConfigSetting
- Shared
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace