WoW:API TargetByName: Difference between revisions

m
Move page script moved page API TargetByName to WoW:API TargetByName without leaving a redirect
(New document)
 
m (Move page script moved page API TargetByName to WoW:API TargetByName without leaving a redirect)
 
(8 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<center>'''TargetByName''' ''-Documentation by [[user:Flickering|Flickering]]-''</center>
{{wowapi}} __NOTOC__
{{removedapi|2.0.1|For alternatives, try [[API_SecureTemplates|Secure Templates]] or the /target}}


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


Target a player by their name.
TargetByName("name", exactMatch);
 
 
== Parameters ==
===Arguments===
 
:("name", exactMatch)


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


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


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


TargetByName("Norrin");
== Details ==


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


: It's probably worth testing what happens if the name isn't close by, or doesn't exist, or is an enemy or NPC, etc. -- [[User:Flickering|Flickering]] 14:06, 28 Dec 2004 (EST)
: If '''exactMatch''' is set, TargetByName can also target party members even if they are out of visible range.


----
: 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.
{{Template:WoW API}}
[[Category:API Targetting Functions|TargetByName]]
Anonymous user