engineSetAsynchronousLoading | Multi Theft Auto: Wiki Skip to content

engineSetAsynchronousLoading

Client-side
Server-side
Shared
Needs checking

This function was partially migrated from the old wiki. Please review manually:

  • Missing section: How it works

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function enables or disables asynchronous model loading. Enabling asynchronous model loading may reduce the small pauses that occur when a new model is displayed for the first time. However, it can cause the new models to appear slightly later than they might have otherwise.

Caution

Using this function with a large amounts of engineReplace* at the same time may cause loading times to be exponentially slower.

Syntax

engineSetAsynchronousLoading ( )

Code Examples

client

The next example enables the model asynchronous loading ignoring client preferences if there are a lot of objects (and the player wants to).

addEventHandler("onClientResourceStart", resourceRoot, function()
if #getElementsByType("object") > 500 then
engineSetAsynchronousLoading( true, false )
end
end)

See Also

Engine Functions
Engine Elements