Author Topic: Making code excecute after addons are finished loading  (Read 1172 times)

How do you do it? Solution has to work on both dedicated and non-dedicated servers.

Package onMissionLoaded(). No arguments.

If you don't want the complexity of a package, just use:

schedule(0, 0, function);

If you don't want the complexity of a package, just use:

schedule(0, 0, function);

But that would execute at the same time?

Use:

schedule(10000, 0, functionhere, 0);

As that always gives it enough time for the other add-ons to load, but doesn't load too late.

But that would execute at the same time?

Use:

schedule(10000, 0, functionhere, 0);

As that always gives it enough time for the other add-ons to load, but doesn't load too late.
When you put 0 for the time, it executes it whenever it's not busy.

When you put 0 for the time, it executes it whenever it's not busy.
It's being tested right now to see if it works.

But that would execute at the same time?

Use:

schedule(10000, 0, functionhere, 0);

As that always gives it enough time for the other add-ons to load, but doesn't load too late.

Schedules can never run while the TSVM is active, thus a schedule of 0 milliseconds will run at the next frame (and thus, as soon as all long blocking processes have finished, such as loading add-ons).