WoW:API UnitIsUnit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Add the fact that nil can also be returned.)
mNo edit summary
Line 16: Line 16:
:Boolean unitIsUnit
:Boolean unitIsUnit


:;unitIsUnit : True if the two units are the same, false otherwise. If either of the units does not presently exist, nil is returned.
:;unitIsUnit : 1 if the two units are the same, nil otherwise.


----
----

Revision as of 10:32, 22 April 2006

UnitIsUnit

Returns true if the two specified units are the same, false otherwise.


Arguments
(String unit1, String unit2)
unit1
The first unit to query (e.g. "party1", "pet", "player")
unit2
The second unit to compare it to (e.g. "target")

Returns
Boolean unitIsUnit
unitIsUnit
1 if the two units are the same, nil otherwise.

Example
if ( UnitIsUnit("party1", "target") ) then
  TargetUnit("partypet1");
else
  TargetUnit("party1");
end;

Template:WoW API