WoW:API UnitInParty: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Made an error of asumption.)
m (Move page script moved page API UnitInParty to WoW:API UnitInParty without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 10: Line 10:
=== Arguments ===
=== Arguments ===
<!-- List each argument, together with its type -->
<!-- List each argument, together with its type -->
:;arg1 : String - Unit who should be checked
:;arg1 : String - Unit who should be checked such as target, focus, party1, etc.


=== Returns ===
=== Returns ===
Line 31: Line 31:


: Pets are not considered to be part of your party.
: Pets are not considered to be part of your party.
: UnitInParty("player") should return false. (since patch 1.11.2, always returned 1 before)
: The "battleground"-raid/party-members are also not considered to be part of your party.
: UnitInParty("player") should return false. (since patch 1.11.2, always returned 1 before) Use [[API_GetNumPartyMembers|GetNumPartyMembers]]() instead.
: '''Bug:''' As of 1.11.2(5464), this function returns nil for UnitInParty("player"), possibly due to the function being defined both as a C and LUA function for reasons unknown.
: '''Bug:''' As of 1.11.2(5464), this function returns nil for UnitInParty("player"), possibly due to the function being defined both as a C and LUA function for reasons unknown.
: Observed in 2.0.3: UnitInParty("player") always returns true. Even when you are not in a party. Assumed reason being: you are always in your own party (of at least one, yourself.)
==See also==
* [[API UnitInRaid]]

Latest revision as of 04:47, 15 August 2023

WoW API < UnitInParty

Returns 1 if the unit is in your party, nil otherwise.

isTrue = UnitInParty("arg1")

Parameters

Arguments

arg1
String - Unit who should be checked such as target, focus, party1, etc.

Returns

isTrue
1 or nil

Example

local TargetInParty = UnitInParty("target")

Result

TargetInParty = 1   - If your target is in your party
TargetInParty = nil - If your target is not in your party

Details

Pets are not considered to be part of your party.
The "battleground"-raid/party-members are also not considered to be part of your party.
UnitInParty("player") should return false. (since patch 1.11.2, always returned 1 before) Use GetNumPartyMembers() instead.
Bug: As of 1.11.2(5464), this function returns nil for UnitInParty("player"), possibly due to the function being defined both as a C and LUA function for reasons unknown.
Observed in 2.0.3: UnitInParty("player") always returns true. Even when you are not in a party. Assumed reason being: you are always in your own party (of at least one, yourself.)

See also