General > Developers Corner
Disable chat messages from being broadcasted when using ULX commands.
Timmy:
--- Quote from: roastchicken on November 05, 2015, 04:11:47 PM ---Why is it in that hook? Autorun would work fine, no?
--- End quote ---
It's in that hook to make sure all ULib sayCmds are initialised before that piece of code runs.
Just putting it in autorun means you'd have no guarantee that all ULib and ULX modules are initialised.
roastchicken:
Then put it in addons/addon/lua/ulx/modules?
Timmy:
--- Quote from: roastchicken on November 05, 2015, 05:25:09 PM ---Then put it in addons/addon/lua/ulx/modules?
--- End quote ---
Putting something in ulx/modules guarantees ULX is initialised, but, it doesn't guarantee that all ULX commands (from other modules) are initialised. That's really important for this to work properly.
Edit: ULX modules are loaded alphabetically. I guess you could name the file zzzzz.lua and then that would work. :D
JamminR:
We wrote in ULib hooks for a reason.
Timmy's example of using them is the most efficient way of guaranteeing stuff gets done "right".
Props for the thinking outside the 'modify Team Ulysses code' box using hooks we wrote to help prevent that ideology.
Edned:
Thank you very much Timmy! It worked.
Thank you to everyone for their contributions.
Issue Resolved.
Navigation
[0] Message Index
[*] Previous page
Go to full version