Else

From EventScripts Community Encyclopedia


Overview

Syntax: else <command>

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_xelse

Description

Will execute command if the condition from a previous if statement is false.

Parameters

  • command - Command to execute. Can be a single command or use es_doblock to do several commands. Can also use several commands if you use a do block. (See Examples)


Examples

if (server_var(var) < 5) do
{
   es_xmsg <5 true
   es_xmsg multiple commands are possible with 'do'
}
else do
{
   es_xmsg got to 'else' section!
}


Notes

  • Alternative syntax: else do { <command1> [...] [commandN] }
  • Every { or } has to be in a new line, because it has to stay alone

See also

blog comments powered by Disqus