I am having trouble understanding how addEvent is supposed to work. Given the following example:
[lua]addEvent("eventName", listenerFunction1);
addEvent("eventName", listenerFunction2);[/lua]
I would expect listenerFunction1 and listenerFunction2 to listen to the same event "eventName". However, it seems only one or the other can be added as a listener. This makes scripting separate command handlers impossible. For example, I have:
[lua]
function motdCommands(event)
-- some code here
end
addEvent("PlayerCommand", motdCommands);
[/lua]
[lua]
function areaProtectCommands(event)
-- some code here
end
addEvent("PlayerCommand", areaProtectCommands);
[/lua]
I would have expected both of these functions to have registered as listeners of the PlayerCommand event. But only one of them listens to that event. Am I wrong? Both were reported to have registered successfully in the console output.