Difference between revisions of "API UnitIsPlayer"

From Wowpedia
Jump to: navigation, search
(Change return values)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  +
{{wowapi}}
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
 
 
Checks if a specified unit is a player.
 
isTrue = UnitIsPlayer(unit)
   
 
== Arguments ==
UnitIsPlayer(UnitId)
 
  +
;unit: String - [[UnitId]] of the unit to check.
   
 
== Returns ==
Determines if the unit is a player.
 
  +
;isTrue : Boolean - true if the unit is a player, false otherwise.
----
 
;''Arguments''
 
 
:<i>[[API_TYPE_UnitId|UnitId]]</i>
 
 
----
 
;''Returns''
 
 
:<i>True/False</i>
 
 
----
 
;''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
 
 
----
 
{{WoW API}}
 

Latest revision as of 12:07, 29 October 2014

Game Flavors
Links
Patch
Added in 1.1.0 / 1.13.2

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.