And I'm not sure if wowprogramming is even correct. I swore it returned numeric index of the position in the raid starting at 0 (so UnitInRaid("raid1") == 0 and UnitInRaid("raid40") == 39).
And I'm not sure if wowprogramming is even correct. I swore it returned numeric index of the position in the raid starting at 0 (so UnitInRaid("raid1") == 0 and UnitInRaid("raid40") == 39).
Whats the best way to check if the player is in a party/raid group?
and
GetNumRaidMembers() > 0
UnitInRaid() does not return a boolean value.
GetNumPartyMembers() > 0
GetNumRaidMembers() > 0
Remember to check both, as GetNumPartyMembers() can return 0 in a raid, if you are alone in a sub-group.
EDIT: Crap, Nevcairiel posted while I was posting. =(
http://www.wowwiki.com/API_GetNumPartyMembers
http://www.wowwiki.com/API_GetPartyMember
http://www.wowwiki.com/API_GetNumRaidMembers
http://www.wowwiki.com/API_GetRaidRosterInfo
^this is how I do it.
Actually it does not.
And I'm not sure if wowprogramming is even correct. I swore it returned numeric index of the position in the raid starting at 0 (so UnitInRaid("raid1") == 0 and UnitInRaid("raid40") == 39).
See TargetFrame.lua:
Which confirms it.
Back to the OP's question.
This is the solution used prominently by Blizzard code, so it is likely to stay a good way to determine if the player is in a party or raid.