WoW:API UnitInRaid: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Move page script moved page API UnitInRaid to API UnitInRaid without leaving a redirect)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns a number if the unit is in your raid group, nil otherwise.
raidIndex = UnitInRaid("unit")


<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
== Arguments ==
Returns 1 if the unit is in your raid group, nil otherwise.
;unit
: String - [[unitId]] to check.


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
== Returns ==
isTrue = UnitInRaid("arg1")
;raidIndex
: {{api|raidIndex|t=t}} of "unit" if he is in your raid group, otherwise nil.


== Parameters ==
== Example ==
=== Arguments ===
print("Your target is " .. (UnitInRaid("target") and "" or "not ") .. "in your raid group.")
<!-- List each argument, together with its type -->
:;arg1 : String - Unit who should be checked


=== Returns ===
<!-- List each return value, together with its type -->
:;isTrue : 1 or nil
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
local TargetInRaid = UnitInRaid("target")


====Result====
<!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. -->
TargetInRaid = 1  - If your target is in your raid group.
TargetInRaid = nil - If your target is not in raid group.


==Details==
==Details==
<!-- Details not appropriate for the main description can go here.  
* The return value is the same index used to retrieve information about raid members using [[API GetRaidRosterInfo]].
    REMOVE the section if you're just going to restate the intro line! -->
* Pets are not considered to be part of your raid group.
* While in a battleground, this function returns information about your battleground group.


: Pets are not considered to be part of your raid group.
==See also==
: The "battleground"-raid/party-members are also not considered to be part of your raid.
* [[API UnitInParty]]
* [[API GetRaidRosterInfo]]

Latest revision as of 04:47, 15 August 2023

WoW API < UnitInRaid

Returns a number if the unit is in your raid group, nil otherwise.

raidIndex = UnitInRaid("unit")

Arguments[edit]

unit
String - unitId to check.

Returns[edit]

raidIndex
raidIndex of "unit" if he is in your raid group, otherwise nil.

Example[edit]

print("Your target is " .. (UnitInRaid("target") and "" or "not ") .. "in your raid group.")


Details[edit]

  • The return value is the same index used to retrieve information about raid members using API GetRaidRosterInfo.
  • Pets are not considered to be part of your raid group.
  • While in a battleground, this function returns information about your battleground group.

See also[edit]