SetServerConfigSetting: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→See Also) |
||
(17 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function sets server settings which are stored in the | This function sets server settings which are stored in the [[Server mtaserver.conf|mtaserver.conf]] file. | ||
{{Note|This function is protected by default and must be explicitly allowed in the servers acl before it can be used.}} | |||
Note | {{Warning|"bandwidth_reduction" set to 'maximum' will cause player movement synchronization issues, on locations built outside 3000m radius from world center.}} | ||
{{ | |||
}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setServerConfigSetting ( string name, string value, | bool setServerConfigSetting ( string name, string value [, bool bSave = false ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''name :''' The name of the setting. Only certain settings can be changed with this function. These are: | *'''name :''' The name of the setting. Only certain settings from [[Server mtaserver.conf|mtaserver.conf]] can be changed with this function. These are: | ||
** minclientversion | ** minclientversion | ||
** recommendedclientversion | ** recommendedclientversion | ||
** password | ** password | ||
** fpslimit | ** fpslimit - (0-100) | ||
** networkencryption | ** networkencryption - 0 for off, 1 for on ('''Deprecated''') | ||
** bandwidth_reduction | ** bandwidth_reduction - "none", "medium", "maximum" Set to maximum for less bandwidth usage (medium is recommended for race servers) | ||
** player_sync_interval - See [[Sync_interval_settings]] for all *_sync_interval settings | |||
** lightweight_sync_interval | |||
** camera_sync_interval | |||
** ped_sync_interval | |||
** unoccupied_vehicle_sync_interval | |||
** {{Added feature/item|1.6.1|1.6.0|22430|vehicle_contact_sync_radius}} | |||
** keysync_mouse_sync_interval | |||
** keysync_analog_sync_interval | |||
** bullet_sync | |||
<!-- | |||
** player_triggered_event_interval | |||
** max_player_triggered_events_per_interval | |||
cant change these 2 values | |||
--> | |||
*'''value:''' The value of the setting | *'''value:''' The value of the setting | ||
Line 37: | Line 47: | ||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions|server}} |
Latest revision as of 22:38, 6 September 2024
This function sets server settings which are stored in the mtaserver.conf file.
Syntax
bool setServerConfigSetting ( string name, string value [, bool bSave = false ] )
Required Arguments
- name : The name of the setting. Only certain settings from mtaserver.conf can be changed with this function. These are:
- minclientversion
- recommendedclientversion
- password
- fpslimit - (0-100)
- networkencryption - 0 for off, 1 for on (Deprecated)
- bandwidth_reduction - "none", "medium", "maximum" Set to maximum for less bandwidth usage (medium is recommended for race servers)
- player_sync_interval - See Sync_interval_settings for all *_sync_interval settings
- lightweight_sync_interval
- camera_sync_interval
- ped_sync_interval
- unoccupied_vehicle_sync_interval
- keysync_mouse_sync_interval
- keysync_analog_sync_interval
- bullet_sync
- value: The value of the setting
Optional Arguments
- bSave: Set to true to make the setting permanent, or false for use only until the next server restart.
Returns
Returns true if the setting was successfully set, or false otherwise.
Example
This example enables network encryption
setServerConfigSetting( "networkencryption", "1", true )
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