Ulysses
General => Developers Corner => Topic started by: talmera on August 09, 2013, 01:12:28 AM
-
Is there a hook or something that allows me to check if an addon (in this case ULX/Ulib) is loaded on the server, I want to check to see if it is loaded and then run a ulx function in a script I'm tinkering with. I've tried checking facepunch and here but failed to find anything that would shed some light on this.
-
There isn't a hook, but you can return the ULX table to check if it's been loaded yet.
if ulx then
run code here
end
-
If your full addon requires ULX be loaded (not just some small function of it), you could also place your addon file in <your_addon>/lua/ulx/modules</cl|/sv|/sh/&|>/file.lua.
Then it would like when ULX loads.
That gets tricky though if your full addon doesn't require it; but only that small command - then it becomes a 'which loads first, my code or ULX'. Luck of the draw at that point.
You wouldn't want the function to run as ULX is loading if your other code hadn't loaded first.
-
Also, that assumes his addon (assuming it is an addon) is only one file and has no other dependencies.
-
Also, that assumes his addon (assuming it is an addon) is only one file and has no other dependencies.
sorry for the late reply, I was making it so it was compatible with multiple admin packages, thank you for the answer MrPresident.