Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:API UnitInBattleground
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} __NOTOC__ <!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> Used to determine the position number of the specified unit in the battleground raid. <!-- List return values and arguments as well as function name, follow Blizzard usage convention for args --> position = UnitInBattleground("unit") == Parameters == === Arguments === <!-- List each argument, together with its type --> :("unit") :;unit : String - The [[API TYPE UnitId|UnitId]] to query (e.g. "player", "party2", "pet", "target" etc.) === Returns === <!-- List each return value, together with its type --> :;position : Number - The position in the battleground raid of the specified unit, "nil" if outside of the battleground, and 0 if "unit" is "player" and player is the last person left standing inside of a finished battleground. == Example == <!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> <!-- begin code --> local position = UnitInBattleground("player"); ChatFrame1:AddMessage('Position in battleground raid: ' .. (position or "(?)")); <!-- end code --> ====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. --> :Prints the player's position number in the battleground raid. e.g. (depending on number left in battleground raid when call is made) <!-- begin code --> Position in battleground raid: (?) Position in battleground raid: 0 Position in battleground raid: 12 <!-- end code --> ==Details== <!-- Details not appropriate for the main description can go here. REMOVE the section if you're just going to restate the intro line! --> * If 'UnitInBattleground("player")' call is made ... Returns nil if outside of a battleground. Returns '0' if you are the last person inside of a battleground after the match is over, and everybody else has left. Returns 1-#, where # is the maximum number of players allowed in the battleground raid.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)