VoidExpanse/scope-config: Difference between revisions
Atomic-admin (talk | contribs) No edit summary |
|||
Line 7: | Line 7: | ||
{{Scripting_api|GetFlag| | {{Scripting_api|GetFlag| | ||
* | * string: name| | ||
bool - whether the flag is set or not.| | |||
<nowiki>var a = config.GetFlag("some_var");</nowiki> | | <nowiki>var a = config.GetFlag("some_var");</nowiki> | | ||
Returns a boolean server flag value by name. Basically used to read server config options. | Returns a boolean server flag value by name. Basically used to read server config options. | ||
}} | }} | ||
{{Scripting_api| | {{Scripting_api|GetSetting| | ||
* | * string: name| | ||
object - a particular value of config.| | |||
<nowiki>var a = config. | <nowiki>var a = config.GetSetting("some_var");</nowiki>| | ||
Returns a server variable value by name. Basically used to read server config options. Standard return types are string, | Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean. | ||
}} | |||
{{Scripting_api|Wait| | |||
* int: time_ms| | |||
void | | |||
<nowiki>config.Wait(1000); //wait for 1 second</nowiki>| | |||
Makes main thread to wait for specified time in milliseconds. | |||
}} | }} |
Revision as of 02:19, 13 February 2014
Config scope
Used to get access to server variables from config file.
Visibility: Globall.
List of functions
GetFlag | ||
---|---|---|
Arguments | Returns | Example |
|
bool - whether the flag is set or not. |
var a = config.GetFlag("some_var"); |
Description | ||
Returns a boolean server flag value by name. Basically used to read server config options. |
GetSetting | ||
---|---|---|
Arguments | Returns | Example |
|
object - a particular value of config. |
var a = config.GetSetting("some_var"); |
Description | ||
Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean. |
Wait | ||
---|---|---|
Arguments | Returns | Example |
|
void |
config.Wait(1000); //wait for 1 second |
Description | ||
Makes main thread to wait for specified time in milliseconds. |