View Single Post
03/02/20, 03:44 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
You can! All you need to do is call UnregisterForUpdate for the name the callLater is registered with. It will return an id when you call it, so you can unregister it like this:

Lua Code:
  1. local function ClearCallLater(id)
  2.     EVENT_MANAGER:UnregisterForUpdate("CallLaterFunction"..id)
  3. end
  4.  
  5. function foo.EnterCombat()
  6.   foo.myHandle = zo_callLater(function() d("you take too long") end, 5000)
  7. end
  8.      
  9. function foo.LeaveCombat()
  10.   ClearCallLater(foo.myHandle)
  11. end
  Reply With Quote