WoW:API UnitInRaid: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns a number if the unit is in your raid group, nil otherwise.
index = 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")
;index : Layout position for raid members: integer ascending from 0 (which is the first member of the first group).
 
== Parameters ==
=== Arguments ===
<!-- List each argument, together with its type -->
:;arg1 : String - UnitID or unit name who should be checked
 
=== Returns ===
<!-- List each return value, together with its type -->
:;isTrue : 1 or nil


== Example ==
== Example ==
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
if UnitInRaid("target") then
local TargetInRaid = UnitInRaid("target")
  print(UnitName("target") .. " is in your raid group.");
local TargetInRaid = UnitInRaid("Duugu")
  end
 
====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.
    REMOVE the section if you're just going to restate the intro line! -->
: Pets are not considered to be part of your raid group.
: Pets are not considered to be part of your raid group.
: The "battleground"-raid/party-members are also not considered to be part of your raid.
; While in a battleground, this function returns information about your battleground group.
: Inside "battleground" UnitInRaid("unit") will return a number based on layout position