SetServerConfigSetting: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server function}} This function sets server settings which are stored in the '''mtaserver.conf''' file. Note: This function is protected by default and must be expli...")
 
No edit summary
Line 21: Line 21:
** fpslimit
** fpslimit
** networkencryption
** networkencryption
** bandwidth_reduction
*'''value:''' The value of the setting
*'''value:''' The value of the setting



Revision as of 13:13, 25 August 2011

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.

Available in 1.1 and onwards

Syntax

bool setServerConfigSetting ( string name, string value, [ bool bSave = false ] )

Required Arguments

  • name : The name of the setting. Only certain settings can be changed with this function. These are:
    • minclientversion
    • recommendedclientversion
    • password
    • fpslimit
    • networkencryption
    • bandwidth_reduction
  • 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