Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Introduced in

Version:1.00

Description

Description:Check if one value is equal to another. Both values need to be of the same type.

Can compare the following types:

Syntax

Syntax:valuea == valueb
Parameters:
  • a: - First argument of compatible type
  • b: - Second argument of compatible type
Return Value:Boolean

Examples

Examples:
if (player == leader group player) then {
  hint "You are the leader of your group."
} else {
  hint "Someone else is the boss"
} 
if (name player == "Billy") then {hint "Hello Billy"}

Additional Information

See also: Operators
Multiplayer: 
Problems: 

Notes





Posted on August 14, 2006 - 14:03
hoz
Comments from before the template conversion.


Does not work with the types Boolean and Array.

i.e. The arguments:

if (MyBoolean == true) then {hint "This is true."};
if (MyArray == []) then {hint "The array is empty."};

will cause errors.

Instead use the following methods:

if (MyBoolean) then {hint "This is true."};
if (count MyArray == 0) then {hint "The array is empty."};