View Single Post
09/29/19, 07:23 PM   #3
Shawn5150
 
Shawn5150's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2019
Posts: 2
Thank you so much ! It seems to have done the trick.
For anyone curious, here is the new code :

Lua Code:
  1. ZonePug = {}
  2. ZonePug.name = "ZonePug"
  3.  
  4. function ZonePug.OnInitialized(eventCode, addOnName)
  5.     if (ZonePug.name ~= addOnName) then return end
  6.     ZO_PreHook(CHAT_SYSTEM, "OnChatEvent", ZonePug.OnChatMessage)
  7. end
  8.  
  9. function ZonePug.OnChatMessage(eventCode, messageType, fromName, text, isFromCustomerService)
  10.     if fromName == CHAT_CHANNEL_ZONE then
  11.         if GetCurrentMapZoneIndex() == 499 or GetCurrentMapZoneIndex() == 37 then
  12.             -- df("%s has detected a zone message in Craglorn/Cyrodiil, let it display", ZonePug.name)
  13.         else
  14.             -- df("%s has detected a zone message elsewhere, block it", ZonePug.name)
  15.             return true
  16.         end
  17.     else
  18.         -- df("%s has detected a non zone message, do nothing", ZonePug.name)
  19.     end
  20. end
  21.  
  22. EVENT_MANAGER:RegisterForEvent(ZonePug.name, EVENT_ADD_ON_LOADED, ZonePug.OnInitialized)
  Reply With Quote