WoW:API UnitIsPVP: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Formatting (based on UnitClassification))
m (Move page script moved page API UnitIsPVP to API UnitIsPVP without leaving a redirect)
 
(2 intermediate revisions by 2 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.
Line 23: Line 23:
----
----
__NOTOC__
__NOTOC__
{{Template:WoW API}}

Latest revision as of 04:47, 15 August 2023

WoW API < UnitIsPVP

Checks to see if a unit is flagged for PvP or not.

local ispvp = UnitIsPVP(unit);

Arguments
unit (UnitID)
the unit name (e.g., "target")

Returns
ispvp
1 if the unit is flagged for PvP, nil otherwise.

Example
if (UnitIsPVP("target")) then
 -- Target is flagged for PvP
end