WoW:API TargetByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Add exactMatch. Reformat.)
Line 1: Line 1:
<center>'''TargetByName''' ''-Documentation by [[user:Flickering|Flickering]]-''</center>
{{wowapi}} __NOTOC__


  TargetByName("name");
Target a player by their name.
 
  TargetByName("name", exactMatch);


Target a player by their name.


----
== Parameters ==
;''Arguments''
===Arguments===


:("name")
:("name", exactMatch)
:;name : String - The [[API TYPE PlayerName]] name of the player to target.


----
:;name : String - The [[API TYPE PlayerName|name]] of the player to target.
;''Example''
:;exactMatch : Boolean


TargetByName("Norrin");
== Example ==


----
TargetByName("Norrin", true);
;''Details''


: If the user isn't nearby or doesn't exist, TargetByName seems to pick the closest match from characters nearby.  --[[User:Nightspark|Nightspark]] 20:29, 7 Jan 2005 (EST)
== Details ==
: If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards. -- [[User:Flickering|Flickering]] 20:37, 7 Jan 2005 (EST)


: If the user isn't nearby or doesn't exist, and '''exactMatch''' isn't set, TargetByName picks the closest match from characters nearby.


----
: If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards. -- [[User:Flickering|Flickering]] 20:37, 7 Jan 2005 (EST)
{{WoW API}}

Revision as of 18:52, 25 June 2006

WoW API < TargetByName

Target a player by their name.

TargetByName("name", exactMatch);


Parameters

Arguments

("name", exactMatch)
name
String - The name of the player to target.
exactMatch
Boolean

Example

TargetByName("Norrin", true);

Details

If the user isn't nearby or doesn't exist, and exactMatch isn't set, TargetByName picks the closest match from characters nearby.
If there is no close match available then an error message is displayed (Error event?) and the target is left unchanged. There is no return value from this method so the only way to check for success is see what the target ended up as afterwards. -- Flickering 20:37, 7 Jan 2005 (EST)