WoW:API UnitIsPVP: Difference between revisions

154 bytes removed ,  15 August 2023
m
Move page script moved page API UnitIsPVP to WoW:API UnitIsPVP without leaving a redirect
m (Move page script moved page API UnitIsPVP to WoW:API UnitIsPVP without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<center>'''UnitIsPVP''' - ''Documentation by MadJester''</center>
{{wowapi}}


'''Checks to see if a unit is flagged for PvP or not.'''
Checks to see if a unit is flagged for PvP or not.
  UnitIsPVP("unit")
  local ispvp = UnitIsPVP(unit);


== Parameters ==
----
=== Arguments ===
;''Arguments''


target, player_name
:;unit ([[API_TYPE_UnitId|UnitID]]) : the unit name (e.g., "target")


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


Elsewhere it had been said to return a True or False , to be correct it will return 1 or nothing.
:;ispvp : 1 if the unit is flagged for PvP, nil otherwise.


=== Examples ===
----
;''Example''


Example of correct use:
  if (UnitIsPVP("target")) then
  if(UnitIsPVP("target"))then
  -- Target is flagged for PvP
end


Example of incorrect use:
if(UnitIsPVP("target")=="true")then
if(UnitIsPVP("target")=="1")then
----
----
__NOTOC__
__NOTOC__
{{Template:WoW API}}
Anonymous user