VoidExpanse/scope-config: Difference between revisions

From AtomicTorchWiki
(Undo revision 111 by Damonwall (talk))
No edit summary
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:


== List of functions ==
== List of functions ==
{{Scripting_api|GetFlag|
* string: name|
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.
}}


{{Scripting_api|GetSetting|
{{Scripting_api|GetSetting|
* string: name|
* string: name|
object - a particular value of config.|
string- a particular value of config.|
<pre style="margin:0px">var a = config.GetSetting("some_var");</pre>|
<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.
Returns a server variable value by name. Basically used to read server config options from script.
}}
 
{{Scripting_api|Wait|
* int: time_ms|
void |
<pre style="margin:0px">config.Wait(1000); //wait for 1 second</pre>|
Makes main thread to wait for specified time in milliseconds.
}}
}}

Latest revision as of 03:58, 5 July 2014


Config scope

Used to get access to server variables from config file.

Visibility: Global.

List of functions

GetSetting
Arguments Returns Example
  • string: name

string- 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.