<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=FornetGear</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=FornetGear"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/FornetGear"/>
	<updated>2026-06-07T20:38:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineSetAsynchronousLoading&amp;diff=39502</id>
		<title>EngineSetAsynchronousLoading</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineSetAsynchronousLoading&amp;diff=39502"/>
		<updated>2014-05-10T08:07:41Z</updated>

		<summary type="html">&lt;p&gt;FornetGear: /* Wrote script example. By FornetGear. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
{{Needs_Example}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool engineSetAsynchronousLoading ( bool enable, bool force ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''enable:''' Set to true/false to enable/disable asynchronous loading. Only works if the client's preferences has 'Asynchronous Loading' set to 'Auto'&lt;br /&gt;
*'''force:''' If set to true, ignores the client's preferences.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function executed successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	engineSetAsynchronousLoading ( true, true ) -- Enables the asynchronous loading and ignores the client's preferences.&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
If asynchronous loading is disabled, MTA requests all resources to be loaded at the time they have been requested. This will halt game execution for the time being.&lt;br /&gt;
&lt;br /&gt;
Otherwise, all resource requests are queued up on the to-be-loaded queue. At the beginning of the game frame, the GTA:SA streaming system is updated, along with its streaming slicers. This is when a model is loaded after going through multiple stages. Having asynchronous loading disabled forces all stages to be consecutively run through.&lt;br /&gt;
&lt;br /&gt;
For more details read [[GTA:SA Resource Streaming]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>FornetGear</name></author>
	</entry>
</feed>