WoW:API CanGrantLevel: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API CanGrantLevel to API CanGrantLevel without leaving a redirect) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | {{wowapi}} __NOTOC__ | ||
Returns whether you can grant levels to a particular player. | |||
status = CanGrantLevel("unit") | status = CanGrantLevel("unit") | ||
== Arguments == | == Arguments == | ||
;unit : String ([[UnitId]]) - unit to check level grant eligibility of. | |||
== Returns == | == Returns == | ||
;status : Flag - true if you can grant levels to the unit; nil otherwise (unit is not RAF-linked to you, does not meet level requirements, or you are out of levels to grant). | |||
== Example == | == Example == | ||
The snippet below prints whether you can grant levels to your target right now. | |||
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> | <!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> | ||
local status = CanGrantLevel("target") | local status = CanGrantLevel("target") | ||
if status then | if status then | ||
print("I can grant levels to my friend!") | |||
else | else | ||
print("I am out of free levels for now.") | |||
end | end | ||
Latest revision as of 04:45, 15 August 2023
← WoW API < CanGrantLevel
Returns whether you can grant levels to a particular player.
status = CanGrantLevel("unit")
Arguments
- unit
- String (UnitId) - unit to check level grant eligibility of.
Returns
- status
- Flag - true if you can grant levels to the unit; nil otherwise (unit is not RAF-linked to you, does not meet level requirements, or you are out of levels to grant).
Example
The snippet below prints whether you can grant levels to your target right now.
local status = CanGrantLevel("target")
if status then
print("I can grant levels to my friend!")
else
print("I am out of free levels for now.")
end