SetServerConfigSetting: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server function}}
{{Server function}}
This function sets server settings which are stored in the '''mtaserver.conf''' file.
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: This function is protected by default and must be explicitly allowed in the servers acl before it can be used.
{{New feature|3.0110|1.1|
Available in 1.1 and onwards
}}


==Syntax==
==Syntax==
Line 15: Line 11:


===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
Line 21: Line 17:
** fpslimit - (0-100)
** fpslimit - (0-100)
** networkencryption - 0 for off, 1 for on
** networkencryption - 0 for off, 1 for on
** bandwidth_reduction - "none", "medium", "maximum" Set to maximum for less bandwidth usage
** bandwidth_reduction - "none", "medium", "maximum" Set to maximum for less bandwidth usage (medium is recommended for race servers)
** busy_sleep_time - (0-10) Set to 0 for more server FPS
** 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
*'''value:''' The value of the setting



Revision as of 21:08, 7 November 2014

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

Note: This function is protected by default and must be explicitly allowed in the servers acl before it can be used.

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
    • 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