WoW:API UnitPlayerControlled: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 27: Line 27:


:;[[API ScrollingMessageFrame AddMessage|ScrollingMessageFrame:AddMessage("text",r,g,b,id)]] : Valid Frame names:<br>DEFAULT_CHAT_FRAME<br>ChatFrame1 - ChatFrame7
:;[[API ScrollingMessageFrame AddMessage|ScrollingMessageFrame:AddMessage("text",r,g,b,id)]] : Valid Frame names:<br>DEFAULT_CHAT_FRAME<br>ChatFrame1 - ChatFrame7


----
----
__NOTOC__
{{WoW API}}
{{Template:WoW API}}
[[Category:API Functions|UnitPlayerControlled]]
[[Category:API Unit Functions|UnitPlayerControlled]]

Revision as of 05:36, 4 January 2006

UnitPlayerControlled - Documentation by VelvetPaw

Return whether the "unit" is controlled by a player or an NPC.

UnitIsPlayerControlled = UnitPlayerControlled("unit")

Parameters

Arguments

("unit")
unit
String - The UnitId to select as a target.

Returns

UnitIsPlayerControlled
UnitIsPlayerControlled
Boolean - Returns true if the "unit" is controlled by a player.
Returns false if the "unit" is an NPC.

Example

if (UnitPlayerControlled("target")) then
  DEFAULT_CHAT_FRAME:AddMessage("Your selected target is a player.",1,1,0)
else
  DEFAULT_CHAT_FRAME:AddMessage("Your selected target is an NPC.",1,1,0)
end

Info

DEFAULT_CHAT_FRAME:AddMessage("text",r,g,b)

ScrollingMessageFrame:AddMessage("text",r,g,b,id)
Valid Frame names:
DEFAULT_CHAT_FRAME
ChatFrame1 - ChatFrame7



Template:WoW API