Hello,
According to all the documentation I have found, this function should work to accept a level as granted, however, it seems that it is being skipped over.
I have tried typing /run AcceptLevelGrant() in the wow chat window, which works, however, it doesn't work in the following case even though the value for "sender" is being output to the screen (i added that for debugging).
Could someone please review this and let me know what I am doing wrong, or perhaps a more advanced way to call this function -- aka.. similulate /run .
Code:
elseif event=="LEVEL_GRANT_PROPOSED" then
isLinked = IsReferAFriendLinked(sender);
if isLinked==nil then
isLinked=RAFriendExists(sender);
end
if isLinked==1 then
if raAcceptLevels==1 then
rafLevelGranted=sender;
AcceptLevelGrant()
print(sender);
else
DeclineLevelGrant();
end
else
DeclineLevelGrant();
end
------- more code ----
Basically, the above is the condition where the event is fired, and all of the code inside that condition. RAFriendExists() is a function which basically checks an array for the value "sender" if it exists .. 1 if true... 0 if false. The rest is pretty straight-forward.
Thanks in advance.