GetRuleValue: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 17: Line 17:
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 ( getRuleValue ( "myScriptRunning" ) ~= false )
if getRuleValue ( "myScriptRunning" ) then
     -- the value is set
     -- the value is set
end
end

Revision as of 20:58, 18 November 2008

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

Template:ASE functions