How to send arguments in OnEvent?
Hello everyone. How to send arguments in OnEvent?
Code:
h = { "hello", "bye" } |
The arguments (payload) part of OnEvent is the ...
It means a variable number of arguments (each event has zero to lots or arguments depending on the event received) Lua Code:
You can see for the PLAYER_ENTERING_WORLD event, it contains two arguments in its payload, isInitalLogin and isReloadUI so you could: Lua Code:
|
Quote:
|
Thanks, but how send "hello" and "bye" from the loop in OnEvent?
Quote:
|
What are you trying to achieve ?
You do not send values to events. The values are returned from events for you to process as needed. If you want to debug the OnEvent function use the print(xxxx) function to output text/values etc to identify a problem in the addon. |
Lua Code:
That will print hello and bye in your chat frame but only you will be able to see it. If you want to broadcast a message to others in the game like a /say, you would need to use SendChatMessage instead of print. |
Thanks everyone for help.
|
All times are GMT -6. The time now is 02:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI