GetRuleValue: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{Server function}} | ||
__NOTOC__ | |||
This function gets a rule value. A rule value is a string that can be viewed by server browsers and used for filtering the server list. | This function gets a rule value. A rule value is a string that can be viewed by server browsers and used for filtering the server list. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getRuleValue ( string key ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''key:''' The name of the rule | *'''key:''' The name of the rule | ||
===Returns=== | ===Returns=== | ||
Returns '' | Returns a string containing the value set for the specified ''key'', ''false'' if invalid arguments were specified. | ||
==Example== | ==Example== | ||
This example shows how you can check if a rule is set. | This example shows how you can check if a rule is set. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
if | if getRuleValue ( "myScriptRunning" ) then | ||
-- the value is set | -- the value is set | ||
end | end | ||
Line 23: | Line 23: | ||
==See Also== | ==See Also== | ||
{{ | {{Announce functions}} |
Latest revision as of 22:22, 27 May 2017
This function gets a rule value. A rule value is a string that can be viewed by server browsers and used for filtering the server list.
Syntax
string getRuleValue ( string key )
Required Arguments
- key: The name of the rule
Returns
Returns a string containing the value set for the specified key, false if invalid arguments were specified.
Example
This example shows how you can check if a rule is set.
if getRuleValue ( "myScriptRunning" ) then -- the value is set end
See Also