Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
(Change return values)
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{wowapi}}
 
{{wowapi}}
  +
Checks if a specified unit is a player.
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
 
 
isTrue = UnitIsPlayer(unit)
   
 
== Arguments ==
UnitIsPlayer(UnitId)
 
  +
;unit: String - [[UnitId]] of the unit to check.
   
 
== Returns ==
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.
 
  +
;isTrue : Boolean - true if the unit is a player, false otherwise.
----
 
;''Arguments''
 
 
:''[[API_TYPE_UnitId|UnitId]]''
 
 
----
 
;''Returns''
 
 
:''True/nil''
 
 
----
 
;''Example''
 
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
 
 
if (UnitIsPlayer(UnitId)) then
 
--Do something here
 
elseif (UnitIsPlayer(UnitId) ~= nil) then
 
--Do something here
 
end
 

Revision as of 12:07, 29 October 2014

Checks if a specified unit is a player.

isTrue = UnitIsPlayer(unit)

Arguments

unit
String - UnitId of the unit to check.

Returns

isTrue
Boolean - true if the unit is a player, false otherwise.