VoidExpanse/scope-config: Difference between revisions
No edit summary |
|||
Line 2: | Line 2: | ||
[[Category:VoidExpanse/api_scopes]] | [[Category:VoidExpanse/api_scopes]] | ||
</noinclude> | </noinclude> | ||
= | = Config scope = | ||
Used to | Used to get access to server variables from config file. | ||
'''Visibility:''' Global. | '''Visibility:''' Global. | ||
Line 10: | Line 9: | ||
== List of functions == | == List of functions == | ||
{{Scripting_api| | {{Scripting_api|GetFlag| | ||
* string: name| | |||
* string: | bool - whether the flag is set or not.| | ||
<pre style="margin:0px">var a = config.GetFlag("some_var");</pre> | | |||
Returns a boolean server flag value by name. Basically used to read server config options. | |||
<pre style="margin:0px">var | |||
</pre> | | |||
}} | }} | ||
{{Scripting_api|GetSetting| | |||
* string: name| | |||
object - a particular value of config.| | |||
<pre style="margin:0px">var a = config.GetSetting("some_var");</pre>| | |||
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| | {{Scripting_api|Wait| | ||
* int: | * int: time_ms| | ||
void| | void | | ||
<pre style="margin:0px"> | <pre style="margin:0px">config.Wait(1000); //wait for 1 second</pre>| | ||
Makes main thread to wait for specified time in milliseconds. | |||
}} | }} |
Revision as of 07:12, 18 February 2014
Config scope
Used to get access to server variables from config file.
Visibility: Global.
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. |