WoW:API UnitIsPlayer: Difference between revisions

m
Move page script moved page API UnitIsPlayer to WoW:API UnitIsPlayer without leaving a redirect
(upgraded deprecated template)
m (Move page script moved page API UnitIsPlayer to WoW:API UnitIsPlayer without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 4: Line 4:
  UnitIsPlayer(UnitId)
  UnitIsPlayer(UnitId)


Determines if the unit is a player.
Determines if the unit is a player.  It is important to note that it returns nil rather than false, nil is treated like false for most operations but it is *not* a proper boolean.
----
----
;''Arguments''
;''Arguments''


:<i>[[API_TYPE_UnitId|UnitId]]</i>
:''[[API_TYPE_UnitId|UnitId]]''


----
----
;''Returns''
;''Returns''


:<i>True/False</i>
:''True/False''


----
----
Line 21: Line 21:
  if (UnitIsPlayer(UnitId)) then
  if (UnitIsPlayer(UnitId)) then
     --Do something here
     --Do something here
  elseif (UnitIsPlayer(UnitId) ~= nil) then
  else
     --Do something here
     --Do something else
  end
  end
Seems like in 6.0.3 it returns True/False
Anonymous user