If
From EventScripts Community Encyclopedia
|
[edit] OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.Variation of this command that doesn't expand variables: es_xif [edit] DescriptionWill execute command if the expression/condition in parentheses is is true. [edit] Parameters
[edit] Examples//Example 1: // Works in all script types es_xsetinfo var 1 if (server_var(var) > 0) then es_xmsg >0 true es_xmath var - 1 if (server_var(var) > 0) then es_xmsg This should never be displayed! //Example 2: // Only works in script addons (recommended) if (server_var(var) < 5) do { es_xmsg <5 true es_xmsg multiple commands are possible with 'do' } // Example 3: // An example of the "in" operator if ("hello" in "hello world") do { es_msg There was a "hello" found in "hello world" }
[edit] Notes
if (<value> <operator> <value2>) do
{
<command1>
[...]
[commandN]
}
[edit] See also |
