WoW API: CanSummonFriend

From AddOn Studio
Revision as of 04:45, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API CanSummonFriend to API CanSummonFriend without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < CanSummonFriend

Returns whether you can RaF summon a particular unit.

summonable = CanSummonFriend("unit")

Arguments

unit
String (UnitId) - player to check whether you can summon.

Returns

summonable
Flag - 1 if you can summon the unit using RaF, nil otherwise.

Example

The snippet below checks whether you can summon the target, and, if so, whispers and summons her to you.

local t = "target"; 
if CanSummonFriend(t) then 
  SendChatMessage("I am summoning you!","WHISPER",nil,t) 
  SummonFriend(t) 
end