WoW:API UnitIsUnit: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
({{wowapi}}, format, example) |
||
Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | |||
Returns true if the two specified units are the same, false otherwise. | Returns true if the two specified units are the same, false otherwise. | ||
isSame = UnitIsUnit(unit1, unit2); | |||
==Parameters== | |||
===Arguments=== | |||
:;unit1 : [[UnitId]] - The first unit to query (e.g. "party1", "pet", "player") | |||
:;unit2 : [[UnitId]] - The second unit to compare it to (e.g. "target") | |||
===Returns=== | |||
:;unit1 : The first unit to query (e.g. "party1", "pet", "player") | :;isSame : Boolean - 1 if the two units are the same entity, nil otherwise. | ||
:;unit2 : The second unit to compare it to (e.g. "target") | |||
==Example== | |||
if ( UnitIsUnit("targettarget", "player") ) then | |||
message("Look at me, I have aggro from " .. UnitName("target") .. "!"); | |||
if ( UnitIsUnit(" | |||
end; | end; | ||
===Result=== | |||
Displays a message if your target is targetting you. | |||
Revision as of 19:51, 23 December 2006
← WoW API < UnitIsUnit
Returns true if the two specified units are the same, false otherwise.
isSame = UnitIsUnit(unit1, unit2);
Parameters
Arguments
Returns
- isSame
- Boolean - 1 if the two units are the same entity, nil otherwise.
Example
if ( UnitIsUnit("targettarget", "player") ) then message("Look at me, I have aggro from " .. UnitName("target") .. "!"); end;
Result
Displays a message if your target is targetting you.