Hello, I'm writing a simple Addon that block Zone Message everywhere except Cyrodiil/Craglorn. The test chat message display I've inserted in the Addon works correctly, the only thing missing is I can't find a way to block chat message from displaying. I've checked the wiki for events/functions but I can't find a way to block them. How should I block chat messages from displaying ?
Here is the code I've written so far.
Lua Code:
ZonePug = {}
ZonePug.name = "ZonePug"
function ZonePug.OnInitialized(eventCode, addOnName)
if (ZonePug.name ~= addOnName) then return end
EVENT_MANAGER:RegisterForEvent(ZonePug.name, EVENT_CHAT_MESSAGE_CHANNEL, ZonePug.OnChatMessage)
end
function ZonePug.OnChatMessage(eventCode, messageType, fromName, text, isFromCustomerService)
if messageType == CHAT_CHANNEL_ZONE then
if GetCurrentMapZoneIndex() == 499 or GetCurrentMapZoneIndex() == 37 then
df("%s has detected a zone message in Craglorn/Cyrodiil, let it display", ZonePug.name)
else
df("%s has detected a zone message elsewhere, block it", ZonePug.name)
-- Insert block code
end
else
df("%s has detected a non zone message, do nothing", ZonePug.name)
end
end
EVENT_MANAGER:RegisterForEvent(ZonePug.name, EVENT_ADD_ON_LOADED, ZonePug.OnInitialized)