WoW:API IsInInstance: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API IsInInstance to API IsInInstance without leaving a redirect)
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Checks whether the player is in an instance and the type of instance.
inInstance, instanceType = IsInInstance()


== Returns ==
;inInstance : Boolean - Whether the player is in an instance; nil otherwise.
;instanceType : String - The instance type:
;:* "none" when outside an instance
;:* "pvp" when in a battleground
;:* "arena" when in an arena
;:* "party" when in a 5-man instance
;:* "raid" when in a raid instance
;:* nil when in an unknown kind of instance, eg. in a scenario


Returns 1 if the player is in an instance and the type of instance.
== Details ==
{{Code/Begin}}
This functon returns correct results immediately upon PLAYER_ENTERING_WORLD.
inInstance, instanceType = IsInInstance()
{{Code/End}}
 
 
== Parameters ==
 
<big>'''Returns'''</big>
:inInstance, instanceType
 
:;inInstance : Boolean - nil or 1
:;instanceType : String - see below
 
 
==Details==
 
: instanceType is normally "none" when outside of an instance or inside an Arena (in 2.0.1) but is "pvp" when inside a battleground and "party" when inside a 5-man instance, have not tested with raid instances yet.
 
: Needs more testing and documentation.
 
{{Stub/API}}

Latest revision as of 04:46, 15 August 2023

WoW API < IsInInstance

Checks whether the player is in an instance and the type of instance.

inInstance, instanceType = IsInInstance()

Returns[edit]

inInstance
Boolean - Whether the player is in an instance; nil otherwise.
instanceType
String - The instance type:
  • "none" when outside an instance
  • "pvp" when in a battleground
  • "arena" when in an arena
  • "party" when in a 5-man instance
  • "raid" when in a raid instance
  • nil when in an unknown kind of instance, eg. in a scenario

Details[edit]

This functon returns correct results immediately upon PLAYER_ENTERING_WORLD.