<?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=TEDERIs</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=TEDERIs"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/TEDERIs"/>
	<updated>2026-04-17T19:30:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=81704</id>
		<title>EngineLoadIMG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=81704"/>
		<updated>2025-01-13T07:31:57Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21708|This function loads an IMG container into GTA.&lt;br /&gt;
}}&lt;br /&gt;
{{Note|&lt;br /&gt;
If you're experiencing crashes/game hangs with default values, try to adjust memory/buffer/cache sizes with [[engineStreamingSetMemorySize]], [[engineStreamingSetBufferSize]] and/or [[engineStreamingSetModelCacheLimits]].}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
img engineLoadIMG ( string img_file )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineIMG]]}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''img_file''': The [[filepath]] to the [[IMG]] file you want to load.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[IMG]] element if the [[IMG]] file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
This example loads IMG file from directory and then prints number of files in it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local img = engineLoadIMG('file.img')&lt;br /&gt;
&lt;br /&gt;
iprint('Number of files: ',#engineImageGetFiles(img))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Changes in 1.6.0]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=81693</id>
		<title>CreateTeam</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateTeam&amp;diff=81693"/>
		<updated>2025-01-11T11:19:46Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function is for creating a new [[team]], which can be used to group players. Players will not join the team until they are respawned.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
team createTeam ( string teamName [, int colorR = 235, int colorG = 221, int colorB = 178 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||Team.create||}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''teamName:''' A string representing the teams name.&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''colorR:''' An integer representing the red color value.&lt;br /&gt;
*'''colorG:''' An integer representing the green color value.&lt;br /&gt;
*'''colorB:''' An integer representing the blue color value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a team element if it was successfully created, ''false'' if invalid arguments are passed or a team with that name already exists.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
'''Example 1:''' This example creates a new team for a player, then adds him to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function gimmeATeam(source, commandName, teamName)&lt;br /&gt;
    local newTeam = createTeam(teamName) -- create a new team with the specified name&lt;br /&gt;
    if newTeam then -- if it was successfully created&lt;br /&gt;
        setPlayerTeam(source, newTeam) -- add the player to the new team&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;giveteam&amp;quot;, gimmeATeam)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example creates two teams, one for Admin and one for Freeroamers, when the resource this script is in is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeamsOnStart()&lt;br /&gt;
    teamAdmmin = createTeam(&amp;quot;Admin&amp;quot;, 0, 255, 0) -- change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB&lt;br /&gt;
    teamFreeroamers = createTeam(&amp;quot;Freeroamer&amp;quot;, 200, 0, 100)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createTeamsOnStart) -- we attach the function to this resource's root element&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example creates a team for Admin and when an admin logs in, he will be set in the Admin team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createAdminTeamOnStart()&lt;br /&gt;
    AdminTeam = createTeam(&amp;quot;Admin&amp;quot;, 0, 255, 0) -- create a new team and name it 'Admin'&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, createAdminTeamOnStart) -- add an event handler&lt;br /&gt;
&lt;br /&gt;
function setAdminTeam()&lt;br /&gt;
    if isObjectInACLGroup(&amp;quot;user.&amp;quot; .. getAccountName(getPlayerAccount(source)), aclGetGroup(&amp;quot;Admin&amp;quot;)) then -- if he is admin&lt;br /&gt;
        setPlayerTeam(source, AdminTeam) -- set him to admin team&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root, setAdminTeam) -- add an event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Team_functions|server}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=81629</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=81629"/>
		<updated>2025-01-03T16:10:49Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22708|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] or [[onClientPreRender]] in order to display continuously. Note that a model must be loaded at the time this function is called. A model can be loaded and unloaded with the help of [[engineStreamingRequestModel]] and [[engineStreamingReleaseModel]] functions.&lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX = 1, float scaleY = 1, float scaleZ = 1, float lighting = 0 ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22862|&lt;br /&gt;
*'''lighting:''' Lighting of model. Allowed range is [0, 1].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, 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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    engineStreamingRequestModel(3276)&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=81628</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=81628"/>
		<updated>2025-01-03T16:10:15Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22708|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] or [[onClientPreRender]] in order to display continuously. Note that a model must be loaded at the time this function is called. A model can be loaded and unloaded with the help of [[engineStreamingRequestModel]] and [[engineStreamingReleaseModel]] functions.&lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX = 1, float scaleY = 1, float scaleZ = 1, float lighting = 0 ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22862|&lt;br /&gt;
*'''lighting:''' Lighting of model. Allowed range is [0, 1].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    engineStreamingRequestModel(3276)&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80120</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80120"/>
		<updated>2024-09-05T12:37:44Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22708|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] or [[onClientPreRender]] in order to display continuously. Note that a model must be loaded at the time this function is called. A model can be loaded and unloaded with the help of [[engineStreamingRequestModel]] and [[engineStreamingReleaseModel]] functions.&lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    engineStreamingRequestModel(3276)&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80119</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80119"/>
		<updated>2024-09-05T12:31:24Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22708|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] or [[onClientPreRender]] in order to display continuously. &lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80118</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80118"/>
		<updated>2024-09-05T12:30:25Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22271|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] or [[onClientPreRender]] in order to display continuously. &lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80117</id>
		<title>DxDrawModel3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawModel3D&amp;diff=80117"/>
		<updated>2024-09-05T12:29:55Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
{{Important Note|You can not use this function to draw vehicles and ped}}&lt;br /&gt;
{{Important Note|This function doesn't obey any streaming limits, you can draw as many models as you want}}&lt;br /&gt;
{{Important Note|You can not render model to render target.}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22271|&lt;br /&gt;
This function draws a 3D model - rendered for '''one''' frame. Drawn models are indistinguishable from this one created by [[createObject]] function. This should be used in conjunction with [[onClientRender]] in order to display continuously. &lt;br /&gt;
}}&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 dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:DxDrawModel3D_at_day.png|thumb|Model during day]]&lt;br /&gt;
[[Image:DxDrawModel3D_at_night.png|thumb|Model during night]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''modelId:''' Model you want to draw, must be regular object, you can not draw vehicles and peds&lt;br /&gt;
* '''positionX/Y/Z:''' Position of model&lt;br /&gt;
* '''rotationX/Y/Z:''' Rotation of model&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''scaleX/Y/Z:''' Scale of model, by default {1,1,1}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the operation was successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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;
Simple example&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)&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;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive3D&amp;diff=79444</id>
		<title>DxDrawPrimitive3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive3D&amp;diff=79444"/>
		<updated>2024-05-27T04:41:38Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a 3D primitive in the 3D world - rendered for '''one''' frame.  This should be used in conjunction with [[onClientRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawPrimitive3D ( string primitiveType, bool postGUI, table vertex1, table vertex2, table vertex3 [, table vertex4, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Primitive.png|thumb|A four vertex primitive example using &amp;quot;trianglefan&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''primitiveType:''' The type of primitive to be drawn. This could be:&lt;br /&gt;
    &amp;quot;pointlist&amp;quot;&lt;br /&gt;
    &amp;quot;linelist&amp;quot;&lt;br /&gt;
    &amp;quot;linestrip&amp;quot;&lt;br /&gt;
    &amp;quot;trianglefan&amp;quot;&lt;br /&gt;
    &amp;quot;trianglelist&amp;quot;&lt;br /&gt;
    &amp;quot;trianglestrip&amp;quot;&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertex1:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex2:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex3:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
&lt;br /&gt;
The vertex should be passed like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{x, y, z, color}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''vertexN:''' A table with the coordinates of the vertex plus its color. You can add as much as you want.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawPrimitive3D ( string primitiveType, string stage, table vertex1, table vertex2, table vertex3 [, table vertex4, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Primitive.png|thumb|A four vertex primitive example using &amp;quot;trianglefan&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''primitiveType:''' The type of primitive to be drawn. This could be:&lt;br /&gt;
    &amp;quot;pointlist&amp;quot;&lt;br /&gt;
    &amp;quot;linelist&amp;quot;&lt;br /&gt;
    &amp;quot;linestrip&amp;quot;&lt;br /&gt;
    &amp;quot;trianglefan&amp;quot;&lt;br /&gt;
    &amp;quot;trianglelist&amp;quot;&lt;br /&gt;
    &amp;quot;trianglestrip&amp;quot;&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Primitives are rendered before the color correction. This stage makes primitives look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Primitives are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Primitives are rendered after GUI. The primitive should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertex1:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex2:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex3:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
&lt;br /&gt;
The vertex should be passed like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{x, y, z, color}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''vertexN:''' A table with the coordinates of the vertex plus its color. You can add as much as you want.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a small example of creating 3D Primitive object with 4 vertex that will spawn on 'The Well Stacked Pizza Co.' in Idlewood.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local primitive = {&lt;br /&gt;
    {2087.8, -1804.2, 13.5, tocolor(255, 0, 0)}, &lt;br /&gt;
    {2087.7, -1810.5, 13.5, tocolor(0, 255, 0)}, &lt;br /&gt;
    {2092.7, -1813.6, 17.7, tocolor(0, 0, 255)},&lt;br /&gt;
    {2097.5, -1806.8, 16, tocolor(255, 255, 255)}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function draw()&lt;br /&gt;
    dxDrawPrimitive3D(&amp;quot;trianglefan&amp;quot;, false, unpack(primitive))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, draw)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.7-9.19626|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialPrimitive3D&amp;diff=79443</id>
		<title>DxDrawMaterialPrimitive3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialPrimitive3D&amp;diff=79443"/>
		<updated>2024-05-27T04:41:15Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a 3D primitive shape with material applied to it in the 3D world - rendered for one frame. This should be used in conjunction with [[onClientRender]] in order to display continuously.&lt;br /&gt;
If image file is used, it should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialPrimitive3D ( primitiveType pType, mixed material, bool postGUI, table vertex1 [, table vertex2, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''pType:''' Type of primitive to be drawn.&lt;br /&gt;
* '''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertices:''' Tables representing each primitive vertex, required amount of them is determined by primitive type.&lt;br /&gt;
&lt;br /&gt;
==Allowed types==&lt;br /&gt;
[[Image:MTAsa_primitives.png|thumb|240px|Available primitive types.]]&lt;br /&gt;
More info on primitives may be found on [https://msdn.microsoft.com/en-us/library/windows/desktop/bb147291.aspx this MSDN site] &lt;br /&gt;
* '''pointlist:''' Renders the vertices as a collection of isolated points.&lt;br /&gt;
* '''linelist:''' Renders the vertices as a list of isolated straight line segments.&lt;br /&gt;
* '''linestrip:''' Renders the vertices as a single polyline.&lt;br /&gt;
* '''trianglelist:''' Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.&lt;br /&gt;
* '''trianglestrip:''' Renders the vertices as a triangle strip.&lt;br /&gt;
* '''trianglefan:''' Renders the vertices as a triangle fan.&lt;br /&gt;
&lt;br /&gt;
==Vertices format==&lt;br /&gt;
* '''posX:''' An float representing the X position of the vertex in the GTA world.&lt;br /&gt;
* '''posY:''' An float representing the Y position of the vertex in the GTA world.&lt;br /&gt;
* '''posZ:''' An float representing the Z position of the vertex in the GTA world.&lt;br /&gt;
* '''color (optional):''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB. If it's not specified, white color is used.&lt;br /&gt;
* '''u:''' An float representing  the relative X coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
* '''v:''' An float representing  the relative Y coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialPrimitive3D ( primitiveType pType, mixed material, string stage, table vertex1 [, table vertex2, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''pType:''' Type of primitive to be drawn.&lt;br /&gt;
* '''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Primitives are rendered before the color correction. This stage makes primitives look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Primitives are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Primitives are rendered after GUI. The primitives should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertices:''' Tables representing each primitive vertex, required amount of them is determined by primitive type.&lt;br /&gt;
&lt;br /&gt;
==Allowed types==&lt;br /&gt;
[[Image:MTAsa_primitives.png|thumb|240px|Available primitive types.]]&lt;br /&gt;
More info on primitives may be found on [https://msdn.microsoft.com/en-us/library/windows/desktop/bb147291.aspx this MSDN site] &lt;br /&gt;
* '''pointlist:''' Renders the vertices as a collection of isolated points.&lt;br /&gt;
* '''linelist:''' Renders the vertices as a list of isolated straight line segments.&lt;br /&gt;
* '''linestrip:''' Renders the vertices as a single polyline.&lt;br /&gt;
* '''trianglelist:''' Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.&lt;br /&gt;
* '''trianglestrip:''' Renders the vertices as a triangle strip.&lt;br /&gt;
* '''trianglefan:''' Renders the vertices as a triangle fan.&lt;br /&gt;
&lt;br /&gt;
==Vertices format==&lt;br /&gt;
* '''posX:''' An float representing the X position of the vertex in the GTA world.&lt;br /&gt;
* '''posY:''' An float representing the Y position of the vertex in the GTA world.&lt;br /&gt;
* '''posZ:''' An float representing the Z position of the vertex in the GTA world.&lt;br /&gt;
* '''color (optional):''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB. If it's not specified, white color is used.&lt;br /&gt;
* '''u:''' An float representing  the relative X coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
* '''v:''' An float representing  the relative Y coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Remarks==&lt;br /&gt;
When a 3D draw call is issued by any such material MTA function then the principle to [https://github.com/multitheftauto/mtasa-blue/blob/16769b8d1c94e2b9fe6323dcba46d1305f87a190/Client/core/Graphics/CMaterialPrimitive3DBatcher.cpp#L42 push it directly to the 3D adapter] does apply. To achieve this there is '''no software-side 3D clipping mathematics''' being performed. This way the vertex data is always being pushed to the vertex shader, leaving the entire freedom to the developer on how to interpret this vertex data in the shader. For example, even though this function does imply an use in 3D world space, the vertex coordinates could be translated directly into Direct3D 9 screen space instead, effectively discarding any multiplication with the camera projection matrix. The mathematical model for translation into valid Direct3D 9 screen-space coordinates is described [https://docs.microsoft.com/en-us/windows/win32/direct3d9/viewports-and-clipping here]. Let's assume that you are drawing the rectangle on a classic sheet of paper with a mathematical 2D X,Y coordinate system.&lt;br /&gt;
&lt;br /&gt;
[[File:D3d9_screen_space_transformation.png|frameless|center|Direct3D 9 screen-space transformation]]&lt;br /&gt;
&lt;br /&gt;
To transform the coordinates you first have to flip the Y coordinate using negation and then apply the Direct3D 9 screen-space rasterization cross-hair by using the screen dimensions (sw, sh). Since linear shapes are being preserved across linear translations, you can simplify each vertex-based figure into it's set of vertices for the purpose shown above. By using this function in such a way it can perform all the operations in the same quality such as the simpler [[dxDrawMaterialPrimitive]] function.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example draws the picture with the file name 'test.png' on the ground of Grove Street and adds a /flip command to flip it. The 'test.png' file needs to be included in the [[meta.xml]] in order for this example to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local picture = &amp;quot;test.png&amp;quot;&lt;br /&gt;
local worldRenderPositions = { -- create a table with all the world positions&lt;br /&gt;
    &lt;br /&gt;
    { 2483, -1663, 12.4, 0, 0 }, -- top left&lt;br /&gt;
    { 2493, -1663, 12.4, 1, 0 }, -- top right&lt;br /&gt;
    { 2483, -1673, 12.4, 0, 1 }, -- bottom left&lt;br /&gt;
    { 2493, -1673, 12.4, 1, 1 }, -- bottom right&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
function renderPicture()&lt;br /&gt;
    dxDrawMaterialPrimitive3D( &amp;quot;trianglestrip&amp;quot;, picture, false, unpack(worldRenderPositions) ) -- use unpack() to separate the points&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root, renderPicture )&lt;br /&gt;
&lt;br /&gt;
function flipPicture()&lt;br /&gt;
    for index, point in ipairs(worldRenderPositions) do&lt;br /&gt;
        if point[4] == 1 then&lt;br /&gt;
            point[4] = 0&lt;br /&gt;
        else&lt;br /&gt;
            point[4] = 1&lt;br /&gt;
        end&lt;br /&gt;
        if point[5] == 1 then&lt;br /&gt;
            point[5] = 0&lt;br /&gt;
        else&lt;br /&gt;
            point[5] = 1&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;flip&amp;quot;, flipPicture )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function can be used to draw billboards in the game world. You have to [https://forum.mtasa.com/topic/133065-naruto-jutsus-help-me/?do=findComment&amp;amp;comment=1003073 understand the mathematical models about the human vision] to calculate the proper vertices.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.7-9.19626|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive3D&amp;diff=79442</id>
		<title>DxDrawPrimitive3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawPrimitive3D&amp;diff=79442"/>
		<updated>2024-05-27T04:32:52Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a 3D primitive in the 3D world - rendered for '''one''' frame.  This should be used in conjunction with [[onClientRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawPrimitive3D ( string primitiveType, bool postGUI, table vertex1, table vertex2, table vertex3 [, table vertex4, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Primitive.png|thumb|A four vertex primitive example using &amp;quot;trianglefan&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''primitiveType:''' The type of primitive to be drawn. This could be:&lt;br /&gt;
    &amp;quot;pointlist&amp;quot;&lt;br /&gt;
    &amp;quot;linelist&amp;quot;&lt;br /&gt;
    &amp;quot;linestrip&amp;quot;&lt;br /&gt;
    &amp;quot;trianglefan&amp;quot;&lt;br /&gt;
    &amp;quot;trianglelist&amp;quot;&lt;br /&gt;
    &amp;quot;trianglestrip&amp;quot;&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertex1:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex2:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex3:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
&lt;br /&gt;
The vertex should be passed like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{x, y, z, color}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''vertexN:''' A table with the coordinates of the vertex plus its color. You can add as much as you want.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawPrimitive3D ( string primitiveType, string stage=&amp;quot;postfx&amp;quot;, table vertex1, table vertex2, table vertex3 [, table vertex4, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Primitive.png|thumb|A four vertex primitive example using &amp;quot;trianglefan&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''primitiveType:''' The type of primitive to be drawn. This could be:&lt;br /&gt;
    &amp;quot;pointlist&amp;quot;&lt;br /&gt;
    &amp;quot;linelist&amp;quot;&lt;br /&gt;
    &amp;quot;linestrip&amp;quot;&lt;br /&gt;
    &amp;quot;trianglefan&amp;quot;&lt;br /&gt;
    &amp;quot;trianglelist&amp;quot;&lt;br /&gt;
    &amp;quot;trianglestrip&amp;quot;&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Primitives are rendered before the color correction. This stage makes primitives look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Primitives are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Primitives are rendered after GUI. The primitive should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertex1:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex2:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
* '''vertex3:''' A table with the coordinates of the vertex plus its color.&lt;br /&gt;
&lt;br /&gt;
The vertex should be passed like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{x, y, z, color}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''vertexN:''' A table with the coordinates of the vertex plus its color. You can add as much as you want.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a small example of creating 3D Primitive object with 4 vertex that will spawn on 'The Well Stacked Pizza Co.' in Idlewood.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local primitive = {&lt;br /&gt;
    {2087.8, -1804.2, 13.5, tocolor(255, 0, 0)}, &lt;br /&gt;
    {2087.7, -1810.5, 13.5, tocolor(0, 255, 0)}, &lt;br /&gt;
    {2092.7, -1813.6, 17.7, tocolor(0, 0, 255)},&lt;br /&gt;
    {2097.5, -1806.8, 16, tocolor(255, 255, 255)}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function draw()&lt;br /&gt;
    dxDrawPrimitive3D(&amp;quot;trianglefan&amp;quot;, false, unpack(primitive))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, draw)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.7-9.19626|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialPrimitive3D&amp;diff=79441</id>
		<title>DxDrawMaterialPrimitive3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialPrimitive3D&amp;diff=79441"/>
		<updated>2024-05-27T04:29:14Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a 3D primitive shape with material applied to it in the 3D world - rendered for one frame. This should be used in conjunction with [[onClientRender]] in order to display continuously.&lt;br /&gt;
If image file is used, it should ideally have dimensions that are a power of two, to prevent possible blurring.&lt;br /&gt;
Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialPrimitive3D ( primitiveType pType, mixed material, bool postGUI, table vertex1 [, table vertex2, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''pType:''' Type of primitive to be drawn.&lt;br /&gt;
* '''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertices:''' Tables representing each primitive vertex, required amount of them is determined by primitive type.&lt;br /&gt;
&lt;br /&gt;
==Allowed types==&lt;br /&gt;
[[Image:MTAsa_primitives.png|thumb|240px|Available primitive types.]]&lt;br /&gt;
More info on primitives may be found on [https://msdn.microsoft.com/en-us/library/windows/desktop/bb147291.aspx this MSDN site] &lt;br /&gt;
* '''pointlist:''' Renders the vertices as a collection of isolated points.&lt;br /&gt;
* '''linelist:''' Renders the vertices as a list of isolated straight line segments.&lt;br /&gt;
* '''linestrip:''' Renders the vertices as a single polyline.&lt;br /&gt;
* '''trianglelist:''' Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.&lt;br /&gt;
* '''trianglestrip:''' Renders the vertices as a triangle strip.&lt;br /&gt;
* '''trianglefan:''' Renders the vertices as a triangle fan.&lt;br /&gt;
&lt;br /&gt;
==Vertices format==&lt;br /&gt;
* '''posX:''' An float representing the X position of the vertex in the GTA world.&lt;br /&gt;
* '''posY:''' An float representing the Y position of the vertex in the GTA world.&lt;br /&gt;
* '''posZ:''' An float representing the Z position of the vertex in the GTA world.&lt;br /&gt;
* '''color (optional):''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB. If it's not specified, white color is used.&lt;br /&gt;
* '''u:''' An float representing  the relative X coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
* '''v:''' An float representing  the relative Y coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialPrimitive3D ( primitiveType pType, mixed material, string stage=&amp;quot;postfx&amp;quot;, table vertex1 [, table vertex2, ...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''pType:''' Type of primitive to be drawn.&lt;br /&gt;
* '''image:''' Either a [[material]] element or a [[filepath]] of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Use a texture created with [[dxCreateTexture]] to '''speed up drawing'''.&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Primitives are rendered before the color correction. This stage makes primitives look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Primitives are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Primitives are rendered after GUI. The primitives should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''vertices:''' Tables representing each primitive vertex, required amount of them is determined by primitive type.&lt;br /&gt;
&lt;br /&gt;
==Allowed types==&lt;br /&gt;
[[Image:MTAsa_primitives.png|thumb|240px|Available primitive types.]]&lt;br /&gt;
More info on primitives may be found on [https://msdn.microsoft.com/en-us/library/windows/desktop/bb147291.aspx this MSDN site] &lt;br /&gt;
* '''pointlist:''' Renders the vertices as a collection of isolated points.&lt;br /&gt;
* '''linelist:''' Renders the vertices as a list of isolated straight line segments.&lt;br /&gt;
* '''linestrip:''' Renders the vertices as a single polyline.&lt;br /&gt;
* '''trianglelist:''' Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.&lt;br /&gt;
* '''trianglestrip:''' Renders the vertices as a triangle strip.&lt;br /&gt;
* '''trianglefan:''' Renders the vertices as a triangle fan.&lt;br /&gt;
&lt;br /&gt;
==Vertices format==&lt;br /&gt;
* '''posX:''' An float representing the X position of the vertex in the GTA world.&lt;br /&gt;
* '''posY:''' An float representing the Y position of the vertex in the GTA world.&lt;br /&gt;
* '''posZ:''' An float representing the Z position of the vertex in the GTA world.&lt;br /&gt;
* '''color (optional):''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB. If it's not specified, white color is used.&lt;br /&gt;
* '''u:''' An float representing  the relative X coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
* '''v:''' An float representing  the relative Y coordinate of the top left corner of the material which should be drawn from image&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Remarks==&lt;br /&gt;
When a 3D draw call is issued by any such material MTA function then the principle to [https://github.com/multitheftauto/mtasa-blue/blob/16769b8d1c94e2b9fe6323dcba46d1305f87a190/Client/core/Graphics/CMaterialPrimitive3DBatcher.cpp#L42 push it directly to the 3D adapter] does apply. To achieve this there is '''no software-side 3D clipping mathematics''' being performed. This way the vertex data is always being pushed to the vertex shader, leaving the entire freedom to the developer on how to interpret this vertex data in the shader. For example, even though this function does imply an use in 3D world space, the vertex coordinates could be translated directly into Direct3D 9 screen space instead, effectively discarding any multiplication with the camera projection matrix. The mathematical model for translation into valid Direct3D 9 screen-space coordinates is described [https://docs.microsoft.com/en-us/windows/win32/direct3d9/viewports-and-clipping here]. Let's assume that you are drawing the rectangle on a classic sheet of paper with a mathematical 2D X,Y coordinate system.&lt;br /&gt;
&lt;br /&gt;
[[File:D3d9_screen_space_transformation.png|frameless|center|Direct3D 9 screen-space transformation]]&lt;br /&gt;
&lt;br /&gt;
To transform the coordinates you first have to flip the Y coordinate using negation and then apply the Direct3D 9 screen-space rasterization cross-hair by using the screen dimensions (sw, sh). Since linear shapes are being preserved across linear translations, you can simplify each vertex-based figure into it's set of vertices for the purpose shown above. By using this function in such a way it can perform all the operations in the same quality such as the simpler [[dxDrawMaterialPrimitive]] function.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example draws the picture with the file name 'test.png' on the ground of Grove Street and adds a /flip command to flip it. The 'test.png' file needs to be included in the [[meta.xml]] in order for this example to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local picture = &amp;quot;test.png&amp;quot;&lt;br /&gt;
local worldRenderPositions = { -- create a table with all the world positions&lt;br /&gt;
    &lt;br /&gt;
    { 2483, -1663, 12.4, 0, 0 }, -- top left&lt;br /&gt;
    { 2493, -1663, 12.4, 1, 0 }, -- top right&lt;br /&gt;
    { 2483, -1673, 12.4, 0, 1 }, -- bottom left&lt;br /&gt;
    { 2493, -1673, 12.4, 1, 1 }, -- bottom right&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
function renderPicture()&lt;br /&gt;
    dxDrawMaterialPrimitive3D( &amp;quot;trianglestrip&amp;quot;, picture, false, unpack(worldRenderPositions) ) -- use unpack() to separate the points&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root, renderPicture )&lt;br /&gt;
&lt;br /&gt;
function flipPicture()&lt;br /&gt;
    for index, point in ipairs(worldRenderPositions) do&lt;br /&gt;
        if point[4] == 1 then&lt;br /&gt;
            point[4] = 0&lt;br /&gt;
        else&lt;br /&gt;
            point[4] = 1&lt;br /&gt;
        end&lt;br /&gt;
        if point[5] == 1 then&lt;br /&gt;
            point[5] = 0&lt;br /&gt;
        else&lt;br /&gt;
            point[5] = 1&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;flip&amp;quot;, flipPicture )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function can be used to draw billboards in the game world. You have to [https://forum.mtasa.com/topic/133065-naruto-jutsus-help-me/?do=findComment&amp;amp;comment=1003073 understand the mathematical models about the human vision] to calculate the proper vertices.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.7-9.19626|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=79440</id>
		<title>DxDrawMaterialSectionLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=79440"/>
		<updated>2024-05-27T04:17:47Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialSectionLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ,&lt;br /&gt;
                                   float u, float v, float usize, float vsize, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                                 [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section &lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section &lt;br /&gt;
*'''usize:''' the absolute width of the section&lt;br /&gt;
*'''vsize:''' the absolute height of the section&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''postGUI''': A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialSectionLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ,&lt;br /&gt;
                                   float u, float v, float usize, float vsize, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                                 [ int color = white, [ bool stage = &amp;quot;postfx&amp;quot;, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section &lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section &lt;br /&gt;
*'''usize:''' the absolute width of the section&lt;br /&gt;
*'''vsize:''' the absolute height of the section&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Lines are rendered before the color correction. This stage makes lines look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Lines are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Lines are rendered after GUI. The line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example draws corona like effects near the player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
coronaTexture = dxCreateTexture(&amp;quot;corona.png&amp;quot;)&lt;br /&gt;
red = tocolor(255,0,0)&lt;br /&gt;
green = tocolor(0,255,0)&lt;br /&gt;
blue = tocolor(0,0,255)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
    function()&lt;br /&gt;
        local x,y,z = getElementPosition(localPlayer)&lt;br /&gt;
&lt;br /&gt;
        dxSetBlendMode(&amp;quot;add&amp;quot;)   -- Add blend mode looks best for corona effects&lt;br /&gt;
        drawCorona( x+2, y+2, z+1, 1, red )&lt;br /&gt;
        drawCorona( x+1, y+3, z+2, 1, green )&lt;br /&gt;
        drawCorona( x-1, y+2, z+3, 1, blue )&lt;br /&gt;
        dxSetBlendMode(&amp;quot;blend&amp;quot;) -- Restore default&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Draw the corona texture&lt;br /&gt;
function drawCorona( x, y, z, size, color )&lt;br /&gt;
    dxDrawMaterialSectionLine3D ( x, y, z+size,&lt;br /&gt;
                                  x, y, z-size,&lt;br /&gt;
                                  0,0,1,1, coronaTexture, size, color)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-9.11998|Added ''postGUI'' argument}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20862|Added ''flipUV'' argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawMaterialSectionLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=79439</id>
		<title>DxDrawMaterialLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=79439"/>
		<updated>2024-05-27T04:15:29Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
3D lines are drawn at a particular place in the [[Game_Processing_Order|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                          [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''postGUI''': A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                          [ int color = white, [ string stage = &amp;quot;postfx&amp;quot;, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Lines are rendered before the color correction. This stage makes lines look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Lines are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Lines are rendered after GUI. The line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Draws [[:File:DxDrawMaterialLine3D-example.png|an image]] in coordiantes -2422.68555, -608.78986, 132.56250:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local redcircle = dxCreateTexture(&amp;quot;red.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
x,y,z = -2422.68555, -608.78986, 132.56250&lt;br /&gt;
&lt;br /&gt;
size = 1&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawMaterialLine3D(x+size, y+size, z-0.95, x-size, y-size, z-0.95, redcircle, size*2,tocolor(255, 255, 255, 255), false, x, y, z)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-9.11998|Added ''postGUI'' argument}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20862|Added ''flipUV'' argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=79438</id>
		<title>DxDrawMaterialLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=79438"/>
		<updated>2024-05-27T04:15:10Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
3D lines are drawn at a particular place in the [[Game_Processing_Order|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                          [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''postGUI''': A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                          [ int color = white, [ string postGUI = &amp;quot;postfx&amp;quot;, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20862|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Lines are rendered before the color correction. This stage makes lines look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Lines are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Lines are rendered after GUI. The line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Draws [[:File:DxDrawMaterialLine3D-example.png|an image]] in coordiantes -2422.68555, -608.78986, 132.56250:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local redcircle = dxCreateTexture(&amp;quot;red.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
x,y,z = -2422.68555, -608.78986, 132.56250&lt;br /&gt;
&lt;br /&gt;
size = 1&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawMaterialLine3D(x+size, y+size, z-0.95, x-size, y-size, z-0.95, redcircle, size*2,tocolor(255, 255, 255, 255), false, x, y, z)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-9.11998|Added ''postGUI'' argument}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20862|Added ''flipUV'' argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawLine3D&amp;diff=79437</id>
		<title>DxDrawLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawLine3D&amp;diff=79437"/>
		<updated>2024-05-27T04:12:06Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a 3D line between two points in the 3D world - rendered for '''one''' frame.  This should be used in conjunction with [[onClientRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.9|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ [, int color = 0xFFFFFFFF, float width = 1.0, bool postGUI = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX:''' The start X position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''startY:''' The start Y position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''startZ:''' The start Z position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX:''' The end X position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endY:''' The end Y position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endZ:''' The end Z position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''width:''' The width/thickness of the line&lt;br /&gt;
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
|22465}}&lt;br /&gt;
&lt;br /&gt;
{{Updated feature/item|1.5.9|1.5.9|22465|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dxDrawLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ [, int color = 0xFFFFFFFF, float width = 1.0, string stage = &amp;quot;postfx&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX:''' The start X position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''startY:''' The start Y position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''startZ:''' The start Z position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX:''' The end X position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endY:''' The end Y position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endZ:''' The end Z position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB.&lt;br /&gt;
* '''width:''' The width/thickness of the line&lt;br /&gt;
* '''stage:''' A string representing a stage at which the actual drawcall should happen:&lt;br /&gt;
** prefx - Lines are rendered before the color correction. This stage makes lines look natural to SA but colors could be distorted.&lt;br /&gt;
** postfx - Lines are rendered after the color correction. This stage conveys a color from the function to a screen without distortions.&lt;br /&gt;
** postgui - Lines are rendered after GUI. The line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a small example of creating 3D Line / &amp;quot;Rope&amp;quot; between vehicle and player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function makeLineAppear()&lt;br /&gt;
	testVehicle = createVehicle ( 411, 0, 0, 5 ) -- Create our test vehicle.&lt;br /&gt;
	addEventHandler(&amp;quot;onClientRender&amp;quot;, root, createLine)        -- onClientRender keeps the 3D Line visible.&lt;br /&gt;
end&lt;br /&gt;
function createLine ( )&lt;br /&gt;
	x1, y1, z1 = getElementPosition ( testVehicle )                       -- Get test vehicles position.&lt;br /&gt;
	x2, y2, z2 = getElementPosition ( localPlayer )                  -- Get local players position.&lt;br /&gt;
	dxDrawLine3D ( x1, y1, z1, x2, y2, z2, tocolor ( 0, 255, 0, 230 ), 2) -- Create 3D Line between test vehicle and local player.&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;line&amp;quot;, makeLineAppear)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77211</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77211"/>
		<updated>2023-07-26T01:48:10Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[areTrafficLightsLocked]]&lt;br /&gt;
* [[createSWATRope]]&lt;br /&gt;
* [[getAircraftMaxHeight]]&lt;br /&gt;
* [[getAircraftMaxVelocity]]&lt;br /&gt;
* [[getBirdsEnabled]]&lt;br /&gt;
* [[getCloudsEnabled]]&lt;br /&gt;
* [[getCoronaReflectionsEnabled]]&lt;br /&gt;
* [[getFarClipDistance]]&lt;br /&gt;
* [[getFogDistance]]&lt;br /&gt;
* [[getGameSpeed]]&lt;br /&gt;
* [[getGarageBoundingBox]]&lt;br /&gt;
* [[getGaragePosition]]&lt;br /&gt;
* [[getGarageSize]]&lt;br /&gt;
* [[getGravity]]&lt;br /&gt;
* [[getGroundPosition]]&lt;br /&gt;
* [[getHeatHaze]]&lt;br /&gt;
* [[getInteriorFurnitureEnabled]]&lt;br /&gt;
* [[getInteriorSoundsEnabled]]&lt;br /&gt;
* [[getJetpackMaxHeight]]&lt;br /&gt;
* [[getMinuteDuration]]&lt;br /&gt;
* [[getMoonSize]]&lt;br /&gt;
* [[getNearClipDistance]]&lt;br /&gt;
* [[getOcclusionsEnabled]]&lt;br /&gt;
* [[getPedsLODDistance]]&lt;br /&gt;
* [[getPlayerBlurLevel]]&lt;br /&gt;
* [[getRainLevel]]&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20675|&lt;br /&gt;
* [[getRoofPosition]]&lt;br /&gt;
}}&lt;br /&gt;
* [[getScreenFromWorldPosition]]&lt;br /&gt;
* [[getSunColor]]&lt;br /&gt;
* [[getSunSize]]&lt;br /&gt;
* [[getTime]]&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[getWeather]]&lt;br /&gt;
* [[getWindVelocity]]&lt;br /&gt;
* [[getWorldFromScreenPosition]]&lt;br /&gt;
* [[getZoneName]]&lt;br /&gt;
* [[isAmbientSoundEnabled]]&lt;br /&gt;
* [[isGarageOpen]]&lt;br /&gt;
* [[isLineOfSightClear]]&lt;br /&gt;
* [[isWorldSoundEnabled]]&lt;br /&gt;
* [[isWorldSpecialPropertyEnabled]]&lt;br /&gt;
* [[processLineOfSight]]&lt;br /&gt;
* [[removeWorldModel]]&lt;br /&gt;
* [[resetAmbientSounds]]&lt;br /&gt;
* [[resetBlurLevel]]&lt;br /&gt;
* [[resetColorFilter]]&lt;br /&gt;
* [[resetCoronaReflectionsEnabled]]&lt;br /&gt;
* [[resetFarClipDistance]]&lt;br /&gt;
* [[resetFogDistance]]&lt;br /&gt;
* [[resetHeatHaze]]&lt;br /&gt;
* [[resetMoonSize]]&lt;br /&gt;
* [[resetNearClipDistance]]&lt;br /&gt;
* [[resetPedsLODDistance]]&lt;br /&gt;
* [[resetRainLevel]]&lt;br /&gt;
* [[resetSkyGradient]]&lt;br /&gt;
* [[resetSunColor]]&lt;br /&gt;
* [[resetSunSize]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[resetWindVelocity]]&lt;br /&gt;
* [[resetWorldSounds]]&lt;br /&gt;
* [[restoreAllWorldModels]]&lt;br /&gt;
* [[restoreWorldModel]]&lt;br /&gt;
* [[setAircraftMaxHeight]]&lt;br /&gt;
* [[setAircraftMaxVelocity]]&lt;br /&gt;
* [[setAmbientSoundEnabled]]&lt;br /&gt;
* [[setBirdsEnabled]]&lt;br /&gt;
* [[setCloudsEnabled]]&lt;br /&gt;
* [[setColorFilter]]&lt;br /&gt;
* [[setCoronaReflectionsEnabled]]&lt;br /&gt;
* [[setFarClipDistance]]&lt;br /&gt;
* [[setFogDistance]]&lt;br /&gt;
* [[setGameSpeed]]&lt;br /&gt;
* [[setGarageOpen]]&lt;br /&gt;
* [[setGravity]]&lt;br /&gt;
* [[setHeatHaze]]&lt;br /&gt;
* [[setInteriorFurnitureEnabled]]&lt;br /&gt;
* [[setInteriorSoundsEnabled]]&lt;br /&gt;
* [[setJetpackMaxHeight]]&lt;br /&gt;
* [[setMinuteDuration]]&lt;br /&gt;
* [[setMoonSize]]&lt;br /&gt;
* [[setNearClipDistance]]&lt;br /&gt;
* [[setOcclusionsEnabled]]&lt;br /&gt;
* [[setPedsLODDistance]]&lt;br /&gt;
* [[setPlayerBlurLevel]]&lt;br /&gt;
* [[setRainLevel]]&lt;br /&gt;
* [[setSkyGradient]]&lt;br /&gt;
* [[setSunColor]]&lt;br /&gt;
* [[setSunSize]]&lt;br /&gt;
* [[setTime]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
* [[setWeather]]&lt;br /&gt;
* [[setWeatherBlended]]&lt;br /&gt;
* [[setWindVelocity]]&lt;br /&gt;
* [[setWorldSoundEnabled]]&lt;br /&gt;
* [[setWorldSpecialPropertyEnabled]]&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|&lt;br /&gt;
* [[setGrainLevel]]&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|&lt;br /&gt;
* [[setGrainMultiplier]]&lt;br /&gt;
}}&lt;br /&gt;
* [[testLineAgainstWater]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77210</id>
		<title>SetGrainLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77210"/>
		<updated>2023-07-26T01:46:59Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|This function sets a level of the overlay grain effect. The game will draw it on top of other grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example.}}&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 setGrainLevel ( int level  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''level:''' The amount of grain (0-255).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain level was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a radioactive zone at Missionary Hills:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function()&lt;br /&gt;
	local zx, zy, zz = -2405.49268, -599.97339, 132.64844 -- Zone position&lt;br /&gt;
	local radius = 20 -- Zone radius&lt;br /&gt;
&lt;br /&gt;
	local x, y, z = getElementPosition( localPlayer )&lt;br /&gt;
	local dist = getDistanceBetweenPoints3D( x, y, z, zx, zy, zz )&lt;br /&gt;
	local intensity = math.max( radius - dist, 0 ) / radius&lt;br /&gt;
&lt;br /&gt;
	setGrainLevel( intensity * 255 )&lt;br /&gt;
end, 100, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77209</id>
		<title>SetGrainMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77209"/>
		<updated>2023-07-26T01:46:29Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay.}}&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 setGrainMultiplier ( string modifierName, float multiplier )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modifierName :''' The modifier name to use which can be one of:&lt;br /&gt;
**'''master:''' The overall intersity that modulates the other ones.&lt;br /&gt;
**'''infrared:''' The intersity of a grain effect for infrared goggles.&lt;br /&gt;
**'''night:''' The intersity of a grain effect for night vision goggles.&lt;br /&gt;
**'''rain :''' The intersity of a grain effect for rain.&lt;br /&gt;
**'''overlay :''' The intersity of a grain effect for the screen overlay(see [[setGrainLevel]]).&lt;br /&gt;
**'''all :''' Can be used to set all the modifiers above at once.&lt;br /&gt;
*'''multiplier :''' The multiplier (0-1).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain multiplier was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables a grain effect for the rain.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;disable_rain_grain&amp;quot;, function()&lt;br /&gt;
	setGrainMultiplier( &amp;quot;rain&amp;quot;, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineAddImage&amp;diff=77208</id>
		<title>EngineAddImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineAddImage&amp;diff=77208"/>
		<updated>2023-07-26T01:44:31Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Undo revision 77204 by TEDERIs (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only two additional archives can be enabled once'''}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
boolean engineAddImage ( img imgArchive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[img]]:add}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=77207</id>
		<title>EngineLoadIMG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=77207"/>
		<updated>2023-07-26T01:44:16Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Undo revision 77203 by TEDERIs (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21708|This function loads an IMG container into GTA. '''Only 2 IMG archives can be loaded into GTA'''&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
img engineLoadIMG ( string img_file )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineIMG]]}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''img_file''': The [[filepath]] to the [[IMG]] file you want to load.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[IMG]] element if the [[IMG]] file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
This example loads IMG file from directory and then prints number of files in it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local img = engineLoadIMG('file.img')&lt;br /&gt;
&lt;br /&gt;
iprint('Number of files: ',#engineImageGetFiles(img))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Changes in 1.6.0]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineAddImage&amp;diff=77204</id>
		<title>EngineAddImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineAddImage&amp;diff=77204"/>
		<updated>2023-07-25T15:56:01Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only 239 additional archives can be enabled once'''}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
boolean engineAddImage ( img imgArchive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[img]]:add}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=77203</id>
		<title>EngineLoadIMG</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadIMG&amp;diff=77203"/>
		<updated>2023-07-25T15:55:33Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21708|This function loads an IMG container into GTA. '''Only 239 IMG archives can be loaded into GTA'''&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
img engineLoadIMG ( string img_file )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineIMG]]}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''img_file''': The [[filepath]] to the [[IMG]] file you want to load.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[IMG]] element if the [[IMG]] file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
This example loads IMG file from directory and then prints number of files in it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local img = engineLoadIMG('file.img')&lt;br /&gt;
&lt;br /&gt;
iprint('Number of files: ',#engineImageGetFiles(img))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Changes in 1.6.0]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77202</id>
		<title>SetGrainMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77202"/>
		<updated>2023-07-25T15:51:31Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay.}}&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 setGrainMultiplier ( string modifierName, float multiplier )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modifierName :''' The modifier name to use which can be one of:&lt;br /&gt;
**'''master:''' The overall intersity that modulates the other ones.&lt;br /&gt;
**'''infrared:''' The intersity of a grain effect for infrared goggles.&lt;br /&gt;
**'''night:''' The intersity of a grain effect for night vision goggles.&lt;br /&gt;
**'''rain :''' The intersity of a grain effect for rain.&lt;br /&gt;
**'''overlay :''' The intersity of a grain effect for the screen overlay(see [[setGrainLevel]]).&lt;br /&gt;
**'''all :''' Can be used to set all the modifiers above at once.&lt;br /&gt;
*'''multiplier :''' The multiplier (0-1).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain multiplier was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables a grain effect for the rain.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;disable_rain_grain&amp;quot;, function()&lt;br /&gt;
	setGrainMultiplier( &amp;quot;rain&amp;quot;, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77201</id>
		<title>SetGrainMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77201"/>
		<updated>2023-07-25T15:51:17Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay.}}&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 setGrainMultiplier ( string modifierName, float multiplier )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modifierName :''' The modifier name to use which can be one of:&lt;br /&gt;
**'''master:''' The overall intersity that modulates the other ones.&lt;br /&gt;
**'''infrared:''' The intersity of a grain effect for infrared goggles.&lt;br /&gt;
**'''night:''' The intersity of a grain effect for night vision goggles.&lt;br /&gt;
**'''rain :''' The intersity of a grain effect for rain.&lt;br /&gt;
**'''overlay :''' The intersity of a grain effect for a screen overlay(see [[setGrainLevel]]).&lt;br /&gt;
**'''all :''' Can be used to set all the modifiers above at once.&lt;br /&gt;
*'''multiplier :''' The multiplier (0-1).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain multiplier was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables a grain effect for the rain.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;disable_rain_grain&amp;quot;, function()&lt;br /&gt;
	setGrainMultiplier( &amp;quot;rain&amp;quot;, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77200</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77200"/>
		<updated>2023-07-25T15:49:12Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[areTrafficLightsLocked]]&lt;br /&gt;
* [[createSWATRope]]&lt;br /&gt;
* [[getAircraftMaxHeight]]&lt;br /&gt;
* [[getAircraftMaxVelocity]]&lt;br /&gt;
* [[getBirdsEnabled]]&lt;br /&gt;
* [[getCloudsEnabled]]&lt;br /&gt;
* [[getCoronaReflectionsEnabled]]&lt;br /&gt;
* [[getFarClipDistance]]&lt;br /&gt;
* [[getFogDistance]]&lt;br /&gt;
* [[getGameSpeed]]&lt;br /&gt;
* [[getGarageBoundingBox]]&lt;br /&gt;
* [[getGaragePosition]]&lt;br /&gt;
* [[getGarageSize]]&lt;br /&gt;
* [[getGravity]]&lt;br /&gt;
* [[getGroundPosition]]&lt;br /&gt;
* [[getHeatHaze]]&lt;br /&gt;
* [[getInteriorFurnitureEnabled]]&lt;br /&gt;
* [[getInteriorSoundsEnabled]]&lt;br /&gt;
* [[getJetpackMaxHeight]]&lt;br /&gt;
* [[getMinuteDuration]]&lt;br /&gt;
* [[getMoonSize]]&lt;br /&gt;
* [[getNearClipDistance]]&lt;br /&gt;
* [[getOcclusionsEnabled]]&lt;br /&gt;
* [[getPedsLODDistance]]&lt;br /&gt;
* [[getPlayerBlurLevel]]&lt;br /&gt;
* [[getRainLevel]]&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20675|&lt;br /&gt;
* [[getRoofPosition]]&lt;br /&gt;
}}&lt;br /&gt;
* [[getScreenFromWorldPosition]]&lt;br /&gt;
* [[getSunColor]]&lt;br /&gt;
* [[getSunSize]]&lt;br /&gt;
* [[getTime]]&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[getWeather]]&lt;br /&gt;
* [[getWindVelocity]]&lt;br /&gt;
* [[getWorldFromScreenPosition]]&lt;br /&gt;
* [[getZoneName]]&lt;br /&gt;
* [[isAmbientSoundEnabled]]&lt;br /&gt;
* [[isGarageOpen]]&lt;br /&gt;
* [[isLineOfSightClear]]&lt;br /&gt;
* [[isWorldSoundEnabled]]&lt;br /&gt;
* [[isWorldSpecialPropertyEnabled]]&lt;br /&gt;
* [[processLineOfSight]]&lt;br /&gt;
* [[removeWorldModel]]&lt;br /&gt;
* [[resetAmbientSounds]]&lt;br /&gt;
* [[resetBlurLevel]]&lt;br /&gt;
* [[resetColorFilter]]&lt;br /&gt;
* [[resetCoronaReflectionsEnabled]]&lt;br /&gt;
* [[resetFarClipDistance]]&lt;br /&gt;
* [[resetFogDistance]]&lt;br /&gt;
* [[resetHeatHaze]]&lt;br /&gt;
* [[resetMoonSize]]&lt;br /&gt;
* [[resetNearClipDistance]]&lt;br /&gt;
* [[resetPedsLODDistance]]&lt;br /&gt;
* [[resetRainLevel]]&lt;br /&gt;
* [[resetSkyGradient]]&lt;br /&gt;
* [[resetSunColor]]&lt;br /&gt;
* [[resetSunSize]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[resetWindVelocity]]&lt;br /&gt;
* [[resetWorldSounds]]&lt;br /&gt;
* [[restoreAllWorldModels]]&lt;br /&gt;
* [[restoreWorldModel]]&lt;br /&gt;
* [[setAircraftMaxHeight]]&lt;br /&gt;
* [[setAircraftMaxVelocity]]&lt;br /&gt;
* [[setAmbientSoundEnabled]]&lt;br /&gt;
* [[setBirdsEnabled]]&lt;br /&gt;
* [[setCloudsEnabled]]&lt;br /&gt;
* [[setColorFilter]]&lt;br /&gt;
* [[setCoronaReflectionsEnabled]]&lt;br /&gt;
* [[setFarClipDistance]]&lt;br /&gt;
* [[setFogDistance]]&lt;br /&gt;
* [[setGameSpeed]]&lt;br /&gt;
* [[setGarageOpen]]&lt;br /&gt;
* [[setGravity]]&lt;br /&gt;
* [[setHeatHaze]]&lt;br /&gt;
* [[setInteriorFurnitureEnabled]]&lt;br /&gt;
* [[setInteriorSoundsEnabled]]&lt;br /&gt;
* [[setJetpackMaxHeight]]&lt;br /&gt;
* [[setMinuteDuration]]&lt;br /&gt;
* [[setMoonSize]]&lt;br /&gt;
* [[setNearClipDistance]]&lt;br /&gt;
* [[setOcclusionsEnabled]]&lt;br /&gt;
* [[setPedsLODDistance]]&lt;br /&gt;
* [[setPlayerBlurLevel]]&lt;br /&gt;
* [[setRainLevel]]&lt;br /&gt;
* [[setSkyGradient]]&lt;br /&gt;
* [[setSunColor]]&lt;br /&gt;
* [[setSunSize]]&lt;br /&gt;
* [[setTime]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
* [[setWeather]]&lt;br /&gt;
* [[setWeatherBlended]]&lt;br /&gt;
* [[setWindVelocity]]&lt;br /&gt;
* [[setWorldSoundEnabled]]&lt;br /&gt;
* [[setWorldSpecialPropertyEnabled]]&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|&lt;br /&gt;
* [[setGrainLevel]]&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|&lt;br /&gt;
* [[setGrainMultiplier]]&lt;br /&gt;
}}&lt;br /&gt;
* [[testLineAgainstWater]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77199</id>
		<title>SetGrainMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainMultiplier&amp;diff=77199"/>
		<updated>2023-07-25T15:48:21Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Created page with &amp;quot;__NOTOC__  {{Client function}} {{New feature/item|3.0161|1.6.0|21894|This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay.}}  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool setGrainMultiplier ( string modifierName, float multiplier ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments===  *'''modifierName :''' The modifier name to u...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay.}}&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 setGrainMultiplier ( string modifierName, float multiplier )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modifierName :''' The modifier name to use which can be one of:&lt;br /&gt;
**'''master:''' The overall intersity that modulates the other ones.&lt;br /&gt;
**'''infrared:''' The intersity of a grain effect for infrared goggles.&lt;br /&gt;
**'''night:''' The intersity of a grain effect for night vision goggles.&lt;br /&gt;
**'''rain :''' The intersity of a grain effect for rain.&lt;br /&gt;
**'''overlay :''' The intersity of a grain effect for a screen overlay(see setGrainLevel).&lt;br /&gt;
**'''all :''' Can be used to set all the modifiers above at once.&lt;br /&gt;
*'''multiplier :''' The multiplier (0-1).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain multiplier was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example disables a grain effect for the rain.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( &amp;quot;disable_rain_grain&amp;quot;, function()&lt;br /&gt;
	setGrainMultiplier( &amp;quot;rain&amp;quot;, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77196</id>
		<title>SetGrainLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77196"/>
		<updated>2023-07-25T15:30:19Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function sets a level of the overlay grain effect. The game will draw it on top of other grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example.}}&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 setGrainLevel ( int level  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''level:''' The amount of grain (0-255).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain level was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a radioactive zone at Missionary Hills:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function()&lt;br /&gt;
	local zx, zy, zz = -2405.49268, -599.97339, 132.64844 -- Zone position&lt;br /&gt;
	local radius = 20 -- Zone radius&lt;br /&gt;
&lt;br /&gt;
	local x, y, z = getElementPosition( localPlayer )&lt;br /&gt;
	local dist = getDistanceBetweenPoints3D( x, y, z, zx, zy, zz )&lt;br /&gt;
	local intensity = math.max( radius - dist, 0 ) / radius&lt;br /&gt;
&lt;br /&gt;
	setGrainLevel( intensity * 255 )&lt;br /&gt;
end, 100, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77195</id>
		<title>SetGrainLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77195"/>
		<updated>2023-07-25T15:29:50Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function sets a level of the overlay grain effect. The game will draw it on top of another grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example.}}&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 setGrainLevel ( int level  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''level:''' The amount of grain (0-255).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain level was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a radioactive zone at Missionary Hills:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function()&lt;br /&gt;
	local zx, zy, zz = -2405.49268, -599.97339, 132.64844 -- Zone position&lt;br /&gt;
	local radius = 20 -- Zone radius&lt;br /&gt;
&lt;br /&gt;
	local x, y, z = getElementPosition( localPlayer )&lt;br /&gt;
	local dist = getDistanceBetweenPoints3D( x, y, z, zx, zy, zz )&lt;br /&gt;
	local intensity = math.max( radius - dist, 0 ) / radius&lt;br /&gt;
&lt;br /&gt;
	setGrainLevel( intensity * 255 )&lt;br /&gt;
end, 100, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77194</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77194"/>
		<updated>2023-07-25T15:29:30Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[areTrafficLightsLocked]]&lt;br /&gt;
* [[createSWATRope]]&lt;br /&gt;
* [[getAircraftMaxHeight]]&lt;br /&gt;
* [[getAircraftMaxVelocity]]&lt;br /&gt;
* [[getBirdsEnabled]]&lt;br /&gt;
* [[getCloudsEnabled]]&lt;br /&gt;
* [[getCoronaReflectionsEnabled]]&lt;br /&gt;
* [[getFarClipDistance]]&lt;br /&gt;
* [[getFogDistance]]&lt;br /&gt;
* [[getGameSpeed]]&lt;br /&gt;
* [[getGarageBoundingBox]]&lt;br /&gt;
* [[getGaragePosition]]&lt;br /&gt;
* [[getGarageSize]]&lt;br /&gt;
* [[getGravity]]&lt;br /&gt;
* [[getGroundPosition]]&lt;br /&gt;
* [[getHeatHaze]]&lt;br /&gt;
* [[getInteriorFurnitureEnabled]]&lt;br /&gt;
* [[getInteriorSoundsEnabled]]&lt;br /&gt;
* [[getJetpackMaxHeight]]&lt;br /&gt;
* [[getMinuteDuration]]&lt;br /&gt;
* [[getMoonSize]]&lt;br /&gt;
* [[getNearClipDistance]]&lt;br /&gt;
* [[getOcclusionsEnabled]]&lt;br /&gt;
* [[getPedsLODDistance]]&lt;br /&gt;
* [[getPlayerBlurLevel]]&lt;br /&gt;
* [[getRainLevel]]&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20675|&lt;br /&gt;
* [[getRoofPosition]]&lt;br /&gt;
}}&lt;br /&gt;
* [[getScreenFromWorldPosition]]&lt;br /&gt;
* [[getSunColor]]&lt;br /&gt;
* [[getSunSize]]&lt;br /&gt;
* [[getTime]]&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[getWeather]]&lt;br /&gt;
* [[getWindVelocity]]&lt;br /&gt;
* [[getWorldFromScreenPosition]]&lt;br /&gt;
* [[getZoneName]]&lt;br /&gt;
* [[isAmbientSoundEnabled]]&lt;br /&gt;
* [[isGarageOpen]]&lt;br /&gt;
* [[isLineOfSightClear]]&lt;br /&gt;
* [[isWorldSoundEnabled]]&lt;br /&gt;
* [[isWorldSpecialPropertyEnabled]]&lt;br /&gt;
* [[processLineOfSight]]&lt;br /&gt;
* [[removeWorldModel]]&lt;br /&gt;
* [[resetAmbientSounds]]&lt;br /&gt;
* [[resetBlurLevel]]&lt;br /&gt;
* [[resetColorFilter]]&lt;br /&gt;
* [[resetCoronaReflectionsEnabled]]&lt;br /&gt;
* [[resetFarClipDistance]]&lt;br /&gt;
* [[resetFogDistance]]&lt;br /&gt;
* [[resetHeatHaze]]&lt;br /&gt;
* [[resetMoonSize]]&lt;br /&gt;
* [[resetNearClipDistance]]&lt;br /&gt;
* [[resetPedsLODDistance]]&lt;br /&gt;
* [[resetRainLevel]]&lt;br /&gt;
* [[resetSkyGradient]]&lt;br /&gt;
* [[resetSunColor]]&lt;br /&gt;
* [[resetSunSize]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[resetWindVelocity]]&lt;br /&gt;
* [[resetWorldSounds]]&lt;br /&gt;
* [[restoreAllWorldModels]]&lt;br /&gt;
* [[restoreWorldModel]]&lt;br /&gt;
* [[setAircraftMaxHeight]]&lt;br /&gt;
* [[setAircraftMaxVelocity]]&lt;br /&gt;
* [[setAmbientSoundEnabled]]&lt;br /&gt;
* [[setBirdsEnabled]]&lt;br /&gt;
* [[setCloudsEnabled]]&lt;br /&gt;
* [[setColorFilter]]&lt;br /&gt;
* [[setCoronaReflectionsEnabled]]&lt;br /&gt;
* [[setFarClipDistance]]&lt;br /&gt;
* [[setFogDistance]]&lt;br /&gt;
* [[setGameSpeed]]&lt;br /&gt;
* [[setGarageOpen]]&lt;br /&gt;
* [[setGravity]]&lt;br /&gt;
* [[setHeatHaze]]&lt;br /&gt;
* [[setInteriorFurnitureEnabled]]&lt;br /&gt;
* [[setInteriorSoundsEnabled]]&lt;br /&gt;
* [[setJetpackMaxHeight]]&lt;br /&gt;
* [[setMinuteDuration]]&lt;br /&gt;
* [[setMoonSize]]&lt;br /&gt;
* [[setNearClipDistance]]&lt;br /&gt;
* [[setOcclusionsEnabled]]&lt;br /&gt;
* [[setPedsLODDistance]]&lt;br /&gt;
* [[setPlayerBlurLevel]]&lt;br /&gt;
* [[setRainLevel]]&lt;br /&gt;
* [[setSkyGradient]]&lt;br /&gt;
* [[setSunColor]]&lt;br /&gt;
* [[setSunSize]]&lt;br /&gt;
* [[setTime]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
* [[setWeather]]&lt;br /&gt;
* [[setWeatherBlended]]&lt;br /&gt;
* [[setWindVelocity]]&lt;br /&gt;
* [[setWorldSoundEnabled]]&lt;br /&gt;
* [[setWorldSpecialPropertyEnabled]]&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|&lt;br /&gt;
* [[setGrainLevel]]&lt;br /&gt;
}}&lt;br /&gt;
* [[testLineAgainstWater]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77193</id>
		<title>SetGrainLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGrainLevel&amp;diff=77193"/>
		<updated>2023-07-25T15:22:35Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Created page with &amp;quot;__NOTOC__  {{Client function}} {{New feature/item|3.0161|1.6.0|21894|This function sets the level of the overlay grain effect. The game will draw it on top of another grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example.}}  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool setGrainLevel ( int level  ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments===  *'''level:''' The amount of grain (0-255).  ===Returns=== Returns ''true''...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21894|This function sets the level of the overlay grain effect. The game will draw it on top of another grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example.}}&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 setGrainLevel ( int level  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''level:''' The amount of grain (0-255).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the grain level was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a radioactive zone at Missionary Hills:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer( function()&lt;br /&gt;
	local zx, zy, zz = -2405.49268, -599.97339, 132.64844 -- Zone position&lt;br /&gt;
	local radius = 20 -- Zone radius&lt;br /&gt;
&lt;br /&gt;
	local x, y, z = getElementPosition( localPlayer )&lt;br /&gt;
	local dist = getDistanceBetweenPoints3D( x, y, z, zx, zy, zz )&lt;br /&gt;
	local intensity = math.max( radius - dist, 0 ) / radius&lt;br /&gt;
&lt;br /&gt;
	setGrainLevel( intensity * 255 )&lt;br /&gt;
end, 100, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=70918</id>
		<title>DxDrawMaterialSectionLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialSectionLine3D&amp;diff=70918"/>
		<updated>2021-04-24T01:48:32Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}} &lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&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 dxDrawMaterialSectionLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ,&lt;br /&gt;
                                   float u, float v, float usize, float vsize, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                                 [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
*'''u:''' the absolute X coordinate of the top left corner of the section &lt;br /&gt;
*'''v:''' the absolute Y coordinate of the top left corner of the section &lt;br /&gt;
*'''usize:''' the absolute width of the section&lt;br /&gt;
*'''vsize:''' the absolute height of the section&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
|20862}}&lt;br /&gt;
* '''color:''' An integer of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
{{New items|5.0155|1.5.5-9.11998|&lt;br /&gt;
* '''postGUI''': A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
}}&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example draws corona like effects near the player&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
coronaTexture = dxCreateTexture(&amp;quot;corona.png&amp;quot;)&lt;br /&gt;
red = tocolor(255,0,0)&lt;br /&gt;
green = tocolor(0,255,0)&lt;br /&gt;
blue = tocolor(0,0,255)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
    function()&lt;br /&gt;
        local x,y,z = getElementPosition(localPlayer)&lt;br /&gt;
&lt;br /&gt;
        dxSetBlendMode(&amp;quot;add&amp;quot;)   -- Add blend mode looks best for corona effects&lt;br /&gt;
        drawCorona( x+2, y+2, z+1, 1, red )&lt;br /&gt;
        drawCorona( x+1, y+3, z+2, 1, green )&lt;br /&gt;
        drawCorona( x-1, y+2, z+3, 1, blue )&lt;br /&gt;
        dxSetBlendMode(&amp;quot;blend&amp;quot;) -- Restore default&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Draw the corona texture&lt;br /&gt;
function drawCorona( x, y, z, size, color )&lt;br /&gt;
    dxDrawMaterialSectionLine3D ( x, y, z+size,&lt;br /&gt;
                                  x, y, z-size,&lt;br /&gt;
                                  0,0,1,1, coronaTexture, size, color)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-9.11998|Added postGUI argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawMaterialSectionLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=70917</id>
		<title>DxDrawMaterialLine3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawMaterialLine3D&amp;diff=70917"/>
		<updated>2021-04-24T01:46:21Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function draws a textured 3D line between two points in the 3D world - rendered for one frame.  This should be used in conjunction with [[onClientPreRender]] in order to display continuously.&lt;br /&gt;
&lt;br /&gt;
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.&lt;br /&gt;
&lt;br /&gt;
3D lines are drawn at a particular place in the [[Game_Processing_Order|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.&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 dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool flipUV = false, ] element material, float width,&lt;br /&gt;
                          [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.&lt;br /&gt;
* '''material:''' A [[material]] to draw the line with.&lt;br /&gt;
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
* '''flipUV''': A bool representing whether a UV orientation should be flipped.&lt;br /&gt;
|20862}}&lt;br /&gt;
* '''color:''' An [[int|integer]] of the hex color, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
* '''postGUI''': A bool representing whether the line should be drawn on top of or behind any ingame GUI.&lt;br /&gt;
|11998}}&lt;br /&gt;
* '''faceTowardX/Y/Z:''' The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Draws [[:File:DxDrawMaterialLine3D-example.png|an image]] in coordiantes -2422.68555, -608.78986, 132.56250&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local redcircle = dxCreateTexture(&amp;quot;red.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
x,y,z = -2422.68555, -608.78986, 132.56250&lt;br /&gt;
&lt;br /&gt;
size = 1&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
    dxDrawMaterialLine3D(x+size, y+size, z-0.95, x-size, y-size, z-0.95, redcircle, size*2,tocolor(255, 255, 255, 255), x, y, z)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03931|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-9.11998|Added postGUI argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxDrawMaterialLine3D]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=70549</id>
		<title>DxCreateShader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=70549"/>
		<updated>2021-04-15T05:19:38Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[shader]] element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [[shader|Effect File]] contains a fallback technique which will work on every PC in the universe.&lt;br /&gt;
{{Note|It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateShader.}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.8|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [ [, table macros = {} ], float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''macros:''' A table contains macros in an ordered and/or unordered way. See example below.&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myShader then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myShader )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch shader on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myShader then&lt;br /&gt;
            myShader = dxCreateShader( &amp;quot;fancything.fx&amp;quot; )  -- Create shader&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myShader )                    -- Destroy shader&lt;br /&gt;
            myShader = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|3.0157|1.5.6-9.14403|&lt;br /&gt;
This example creates basic shader from raw data (without i/o) on resource start:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myShader_raw_data = [[&lt;br /&gt;
	texture tex;&lt;br /&gt;
	technique replace {&lt;br /&gt;
		pass P0 {&lt;br /&gt;
			Texture[0] = tex;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	local myShader = dxCreateShader(myShader_raw_data) -- create shader from raw data&lt;br /&gt;
	if isElement(myShader) then&lt;br /&gt;
		local myTexture = dxCreateTexture(&amp;quot;some_image.png&amp;quot;) -- create texture from image file&lt;br /&gt;
		if isElement(myTexture) then&lt;br /&gt;
			-- apply image to world texture via shader&lt;br /&gt;
			dxSetShaderValue(myShader, &amp;quot;tex&amp;quot;, myTexture)&lt;br /&gt;
			engineApplyShaderToWorldTexture(myShader, &amp;quot;shad_ped&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			outputDebugString(&amp;quot;Unable to load texture&amp;quot;, 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Unable to create shader&amp;quot;, 1)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can pass raw data (shader code) directly into the function (example uses variable ''myShader_raw_data'').&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
This example creates a basic shader using macros to change shader's behaviour&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local shaderRawStr = [[&lt;br /&gt;
    texture MACRO_TEX_NAME;&lt;br /&gt;
&lt;br /&gt;
    technique simple&lt;br /&gt;
    {&lt;br /&gt;
        pass P0&lt;br /&gt;
        {&lt;br /&gt;
            //-- Set up texture stage 0&lt;br /&gt;
            Texture[0] = MACRO_TEX_NAME;&lt;br /&gt;
	    ColorOp[0] = SelectArg1;&lt;br /&gt;
	#ifdef MACRO_FIRST_ARG&lt;br /&gt;
	    ColorArg1[0] = Texture;&lt;br /&gt;
	#else&lt;br /&gt;
	    ColorArg1[0] = Diffuse;&lt;br /&gt;
	#endif&lt;br /&gt;
	    AlphaOp[0] = SelectArg1;&lt;br /&gt;
	    AlphaArg1[0] = Texture;&lt;br /&gt;
                &lt;br /&gt;
            //-- Disable texture stage 1&lt;br /&gt;
            ColorOp[1] = Disable;&lt;br /&gt;
            AlphaOp[1] = Disable;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local shader, tech = dxCreateShader( shaderRawStr,  { MACRO_TEX_NAME = &amp;quot;Tex0&amp;quot;,  MACRO_FIRST_ARG = true } )&lt;br /&gt;
        if not shader or tech ~= &amp;quot;simple&amp;quot; then&lt;br /&gt;
            outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
        end	&lt;br /&gt;
        &lt;br /&gt;
        local texture = dxCreateTexture( &amp;quot;test.png&amp;quot; )&lt;br /&gt;
        if not texture then&lt;br /&gt;
	    outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	dxSetShaderValue( shader, &amp;quot;Tex0&amp;quot;, texture )&lt;br /&gt;
		&lt;br /&gt;
	addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
	    function()&lt;br /&gt;
	        dxDrawImage( 0, 0, 500, 500, shader )&lt;br /&gt;
	    end&lt;br /&gt;
	, false )&lt;br /&gt;
    end&lt;br /&gt;
, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also pass macros in key-value pairs when the order is important.&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04435|Added layered and elementTypes arguments}}&lt;br /&gt;
{{ChangelogItem|1.5.6-9.14403|Added option to use raw data instead of a file name}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20688|Added option to use macros}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxCreateShader]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=70548</id>
		<title>DxCreateShader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=70548"/>
		<updated>2021-04-15T05:15:18Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[shader]] element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [[shader|Effect File]] contains a fallback technique which will work on every PC in the universe.&lt;br /&gt;
{{Note|It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateShader.}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated items|3.0159|1.5.8|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, [table macros = {},] float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''macros:''' A table contains macros in an ordered and/or unordered way. See example below.&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myShader then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myShader )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch shader on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myShader then&lt;br /&gt;
            myShader = dxCreateShader( &amp;quot;fancything.fx&amp;quot; )  -- Create shader&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myShader )                    -- Destroy shader&lt;br /&gt;
            myShader = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|3.0157|1.5.6-9.14403|&lt;br /&gt;
This example creates basic shader from raw data (without i/o) on resource start:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myShader_raw_data = [[&lt;br /&gt;
	texture tex;&lt;br /&gt;
	technique replace {&lt;br /&gt;
		pass P0 {&lt;br /&gt;
			Texture[0] = tex;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	local myShader = dxCreateShader(myShader_raw_data) -- create shader from raw data&lt;br /&gt;
	if isElement(myShader) then&lt;br /&gt;
		local myTexture = dxCreateTexture(&amp;quot;some_image.png&amp;quot;) -- create texture from image file&lt;br /&gt;
		if isElement(myTexture) then&lt;br /&gt;
			-- apply image to world texture via shader&lt;br /&gt;
			dxSetShaderValue(myShader, &amp;quot;tex&amp;quot;, myTexture)&lt;br /&gt;
			engineApplyShaderToWorldTexture(myShader, &amp;quot;shad_ped&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			outputDebugString(&amp;quot;Unable to load texture&amp;quot;, 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Unable to create shader&amp;quot;, 1)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can pass raw data (shader code) directly into the function (example uses variable ''myShader_raw_data'').&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|3.0159|1.5.8|&lt;br /&gt;
This example creates a basic shader using macros to change shader's behaviour&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local shaderRawStr = [[&lt;br /&gt;
    texture MACRO_TEX_NAME;&lt;br /&gt;
&lt;br /&gt;
    technique simple&lt;br /&gt;
    {&lt;br /&gt;
        pass P0&lt;br /&gt;
        {&lt;br /&gt;
            //-- Set up texture stage 0&lt;br /&gt;
            Texture[0] = MACRO_TEX_NAME;&lt;br /&gt;
	    ColorOp[0] = SelectArg1;&lt;br /&gt;
	#ifdef MACRO_FIRST_ARG&lt;br /&gt;
	    ColorArg1[0] = Texture;&lt;br /&gt;
	#else&lt;br /&gt;
	    ColorArg1[0] = Diffuse;&lt;br /&gt;
	#endif&lt;br /&gt;
	    AlphaOp[0] = SelectArg1;&lt;br /&gt;
	    AlphaArg1[0] = Texture;&lt;br /&gt;
                &lt;br /&gt;
            //-- Disable texture stage 1&lt;br /&gt;
            ColorOp[1] = Disable;&lt;br /&gt;
            AlphaOp[1] = Disable;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local shader, tech = dxCreateShader( shaderRawStr,  { MACRO_TEX_NAME = &amp;quot;Tex0&amp;quot;,  MACRO_FIRST_ARG = true } )&lt;br /&gt;
        if not shader or tech ~= &amp;quot;simple&amp;quot; then&lt;br /&gt;
            outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
        end	&lt;br /&gt;
        &lt;br /&gt;
        local texture = dxCreateTexture( &amp;quot;test.png&amp;quot; )&lt;br /&gt;
        if not texture then&lt;br /&gt;
	    outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	dxSetShaderValue( shader, &amp;quot;Tex0&amp;quot;, texture )&lt;br /&gt;
		&lt;br /&gt;
	addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
	    function()&lt;br /&gt;
	        dxDrawImage( 0, 0, 500, 500, shader )&lt;br /&gt;
	    end&lt;br /&gt;
	, false )&lt;br /&gt;
    end&lt;br /&gt;
, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also pass macros in key-value pairs when the order is important.&lt;br /&gt;
|20688}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04435|Added layered and elementTypes arguments}}&lt;br /&gt;
{{ChangelogItem|1.5.6-9.14403|Added option to use raw data instead of a file name}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20688|Added option to use macros}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxCreateShader]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=67732</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=67732"/>
		<updated>2020-11-09T10:17:46Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[areTrafficLightsLocked]]&lt;br /&gt;
* [[createSWATRope]]&lt;br /&gt;
* [[getAircraftMaxHeight]]&lt;br /&gt;
* [[getAircraftMaxVelocity]]&lt;br /&gt;
* [[getBirdsEnabled]]&lt;br /&gt;
* [[getCloudsEnabled]]&lt;br /&gt;
* [[getFarClipDistance]]&lt;br /&gt;
* [[getFogDistance]]&lt;br /&gt;
* [[getGameSpeed]]&lt;br /&gt;
* [[getGarageBoundingBox]]&lt;br /&gt;
* [[getGaragePosition]]&lt;br /&gt;
* [[getGarageSize]]&lt;br /&gt;
* [[getGravity]]&lt;br /&gt;
* [[getGroundPosition]]&lt;br /&gt;
* [[getHeatHaze]]&lt;br /&gt;
* [[getInteriorFurnitureEnabled]]&lt;br /&gt;
* [[getInteriorSoundsEnabled]]&lt;br /&gt;
* [[getJetpackMaxHeight]]&lt;br /&gt;
* [[getMinuteDuration]]&lt;br /&gt;
* [[getMoonSize]]&lt;br /&gt;
* [[getNearClipDistance]]&lt;br /&gt;
* [[resetNearClipDistance]]&lt;br /&gt;
* [[getOcclusionsEnabled]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[getPedsLODDistance]]&lt;br /&gt;
*[[setPedsLODDistance]]&lt;br /&gt;
*[[resetPedsLODDistance]]&lt;br /&gt;
|13771}}&lt;br /&gt;
* [[getPlayerBlurLevel]]&lt;br /&gt;
* [[getRainLevel]]&lt;br /&gt;
* [[getScreenFromWorldPosition]]&lt;br /&gt;
* [[getSunColor]]&lt;br /&gt;
* [[getSunSize]]&lt;br /&gt;
* [[getTime]]&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[getWeather]]&lt;br /&gt;
* [[getWindVelocity]]&lt;br /&gt;
* [[getWorldFromScreenPosition]]&lt;br /&gt;
* [[getZoneName]]&lt;br /&gt;
* [[isAmbientSoundEnabled]]&lt;br /&gt;
* [[isGarageOpen]]&lt;br /&gt;
* [[isLineOfSightClear]]&lt;br /&gt;
* [[isWorldSoundEnabled]]&lt;br /&gt;
* [[isWorldSpecialPropertyEnabled]]&lt;br /&gt;
* [[processLineOfSight]]&lt;br /&gt;
* [[removeWorldModel]]&lt;br /&gt;
* [[resetAmbientSounds]]&lt;br /&gt;
{{New items|3.0158|1.5.7|&lt;br /&gt;
*[[resetBlurLevel]]&lt;br /&gt;
|20450}}&lt;br /&gt;
* [[resetFarClipDistance]]&lt;br /&gt;
* [[resetFogDistance]]&lt;br /&gt;
* [[resetHeatHaze]]&lt;br /&gt;
* [[resetMoonSize]]&lt;br /&gt;
* [[resetRainLevel]]&lt;br /&gt;
* [[resetSkyGradient]]&lt;br /&gt;
* [[resetSunColor]]&lt;br /&gt;
* [[resetSunSize]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[resetWindVelocity]]&lt;br /&gt;
* [[resetWorldSounds]]&lt;br /&gt;
{{New items|3.0160|1.5.8|&lt;br /&gt;
*[[resetColorFilter]]&lt;br /&gt;
|20718}}&lt;br /&gt;
* [[restoreAllWorldModels]]&lt;br /&gt;
* [[restoreWorldModel]]&lt;br /&gt;
* [[setAircraftMaxHeight]]&lt;br /&gt;
* [[setAircraftMaxVelocity]]&lt;br /&gt;
* [[setAmbientSoundEnabled]]&lt;br /&gt;
* [[setBirdsEnabled]]&lt;br /&gt;
* [[setCloudsEnabled]]&lt;br /&gt;
* [[setFarClipDistance]]&lt;br /&gt;
* [[setFogDistance]]&lt;br /&gt;
* [[setGameSpeed]]&lt;br /&gt;
* [[setGarageOpen]]&lt;br /&gt;
* [[setGravity]]&lt;br /&gt;
* [[setHeatHaze]]&lt;br /&gt;
* [[setInteriorFurnitureEnabled]]&lt;br /&gt;
* [[setInteriorSoundsEnabled]]&lt;br /&gt;
* [[setJetpackMaxHeight]]&lt;br /&gt;
* [[setMinuteDuration]]&lt;br /&gt;
* [[setMoonSize]]&lt;br /&gt;
* [[setNearClipDistance]]&lt;br /&gt;
* [[setOcclusionsEnabled]]&lt;br /&gt;
* [[setPlayerBlurLevel]]&lt;br /&gt;
* [[setRainLevel]]&lt;br /&gt;
* [[setSkyGradient]]&lt;br /&gt;
* [[setSunColor]]&lt;br /&gt;
* [[setSunSize]]&lt;br /&gt;
* [[setTime]]&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
* [[setWeather]]&lt;br /&gt;
* [[setWeatherBlended]]&lt;br /&gt;
* [[setWindVelocity]]&lt;br /&gt;
* [[setWorldSoundEnabled]]&lt;br /&gt;
* [[setWorldSpecialPropertyEnabled]]&lt;br /&gt;
{{New items|3.0160|1.5.8|&lt;br /&gt;
*[[setColorFilter]]&lt;br /&gt;
|20718}}&lt;br /&gt;
* [[testLineAgainstWater]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetColorFilter&amp;diff=67731</id>
		<title>ResetColorFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetColorFilter&amp;diff=67731"/>
		<updated>2020-11-09T10:16:45Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Created page with &amp;quot;__NOTOC__  {{Client function}} {{New feature/item|3.0160|1.5.8|20718|This function is used to reset the color filtering to its default values.}}  ==Syntax==  &amp;lt;syntaxhighlight...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20718|This function is used to reset the color filtering to its default values.}}&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 resetColorFilter ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the color filtering was reset, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets any player reset the color filtering&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetFilter()&lt;br /&gt;
   resetColorFilter()&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;reset_filter&amp;quot;, resetFilter) -- Add the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=67730</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=67730"/>
		<updated>2020-11-09T10:09:20Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[areTrafficLightsLocked]]&lt;br /&gt;
* [[createSWATRope]]&lt;br /&gt;
* [[getAircraftMaxHeight]]&lt;br /&gt;
* [[getAircraftMaxVelocity]]&lt;br /&gt;
* [[getBirdsEnabled]]&lt;br /&gt;
* [[getCloudsEnabled]]&lt;br /&gt;
* [[getFarClipDistance]]&lt;br /&gt;
* [[getFogDistance]]&lt;br /&gt;
* [[getGameSpeed]]&lt;br /&gt;
* [[getGarageBoundingBox]]&lt;br /&gt;
* [[getGaragePosition]]&lt;br /&gt;
* [[getGarageSize]]&lt;br /&gt;
* [[getGravity]]&lt;br /&gt;
* [[getGroundPosition]]&lt;br /&gt;
* [[getHeatHaze]]&lt;br /&gt;
* [[getInteriorFurnitureEnabled]]&lt;br /&gt;
* [[getInteriorSoundsEnabled]]&lt;br /&gt;
* [[getJetpackMaxHeight]]&lt;br /&gt;
* [[getMinuteDuration]]&lt;br /&gt;
* [[getMoonSize]]&lt;br /&gt;
* [[getNearClipDistance]]&lt;br /&gt;
* [[resetNearClipDistance]]&lt;br /&gt;
* [[getOcclusionsEnabled]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[getPedsLODDistance]]&lt;br /&gt;
*[[setPedsLODDistance]]&lt;br /&gt;
*[[resetPedsLODDistance]]&lt;br /&gt;
|13771}}&lt;br /&gt;
* [[getPlayerBlurLevel]]&lt;br /&gt;
* [[getRainLevel]]&lt;br /&gt;
* [[getScreenFromWorldPosition]]&lt;br /&gt;
* [[getSunColor]]&lt;br /&gt;
* [[getSunSize]]&lt;br /&gt;
* [[getTime]]&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[getWeather]]&lt;br /&gt;
* [[getWindVelocity]]&lt;br /&gt;
* [[getWorldFromScreenPosition]]&lt;br /&gt;
* [[getZoneName]]&lt;br /&gt;
* [[isAmbientSoundEnabled]]&lt;br /&gt;
* [[isGarageOpen]]&lt;br /&gt;
* [[isLineOfSightClear]]&lt;br /&gt;
* [[isWorldSoundEnabled]]&lt;br /&gt;
* [[isWorldSpecialPropertyEnabled]]&lt;br /&gt;
* [[processLineOfSight]]&lt;br /&gt;
* [[removeWorldModel]]&lt;br /&gt;
* [[resetAmbientSounds]]&lt;br /&gt;
{{New items|3.0158|1.5.7|&lt;br /&gt;
*[[resetBlurLevel]]&lt;br /&gt;
|20450}}&lt;br /&gt;
* [[resetFarClipDistance]]&lt;br /&gt;
* [[resetFogDistance]]&lt;br /&gt;
* [[resetHeatHaze]]&lt;br /&gt;
* [[resetMoonSize]]&lt;br /&gt;
* [[resetRainLevel]]&lt;br /&gt;
* [[resetSkyGradient]]&lt;br /&gt;
* [[resetSunColor]]&lt;br /&gt;
* [[resetSunSize]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[resetWindVelocity]]&lt;br /&gt;
* [[resetWorldSounds]]&lt;br /&gt;
* [[restoreAllWorldModels]]&lt;br /&gt;
* [[restoreWorldModel]]&lt;br /&gt;
* [[setAircraftMaxHeight]]&lt;br /&gt;
* [[setAircraftMaxVelocity]]&lt;br /&gt;
* [[setAmbientSoundEnabled]]&lt;br /&gt;
* [[setBirdsEnabled]]&lt;br /&gt;
* [[setCloudsEnabled]]&lt;br /&gt;
* [[setFarClipDistance]]&lt;br /&gt;
* [[setFogDistance]]&lt;br /&gt;
* [[setGameSpeed]]&lt;br /&gt;
* [[setGarageOpen]]&lt;br /&gt;
* [[setGravity]]&lt;br /&gt;
* [[setHeatHaze]]&lt;br /&gt;
* [[setInteriorFurnitureEnabled]]&lt;br /&gt;
* [[setInteriorSoundsEnabled]]&lt;br /&gt;
* [[setJetpackMaxHeight]]&lt;br /&gt;
* [[setMinuteDuration]]&lt;br /&gt;
* [[setMoonSize]]&lt;br /&gt;
* [[setNearClipDistance]]&lt;br /&gt;
* [[setOcclusionsEnabled]]&lt;br /&gt;
* [[setPlayerBlurLevel]]&lt;br /&gt;
* [[setRainLevel]]&lt;br /&gt;
* [[setSkyGradient]]&lt;br /&gt;
* [[setSunColor]]&lt;br /&gt;
* [[setSunSize]]&lt;br /&gt;
* [[setTime]]&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
* [[setWeather]]&lt;br /&gt;
* [[setWeatherBlended]]&lt;br /&gt;
* [[setWindVelocity]]&lt;br /&gt;
* [[setWorldSoundEnabled]]&lt;br /&gt;
* [[setWorldSpecialPropertyEnabled]]&lt;br /&gt;
{{New items|3.0160|1.5.8|&lt;br /&gt;
*[[setColorFilter]]&lt;br /&gt;
|20718}}&lt;br /&gt;
* [[testLineAgainstWater]]&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetColorFilter&amp;diff=67729</id>
		<title>SetColorFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetColorFilter&amp;diff=67729"/>
		<updated>2020-11-09T09:47:25Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Created page with &amp;quot;__NOTOC__  {{Client function}} {{New feature/item|3.0160|1.5.8|20718|This function is used to override the default color filtering values.}} {{Tip|Normally the game is adding...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0160|1.5.8|20718|This function is used to override the default color filtering values.}}&lt;br /&gt;
{{Tip|Normally the game is adding these colors to a screen to simulate weather effects. Sometimes it can be important to disable these effects. You can get rid of the effects by calling this function with zero values.}} &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 setColorFilter ( int aRed, int aGreen, int aBlue, int aAlpha, int bRed, int bGreen, int bBlue, int bAlpha  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''aRed:''' The amount of red (0-255).&lt;br /&gt;
*'''aGreen:''' The amount of green (0-255).&lt;br /&gt;
*'''aBlue:''' The amount of blue (0-255).&lt;br /&gt;
*'''aAlpha:''' The amount of alpha (0-255).&lt;br /&gt;
*'''bRed:''' The amount of red (0-255).&lt;br /&gt;
*'''bGreen:''' The amount of green (0-255).&lt;br /&gt;
*'''bBlue:''' The amount of blue (0-255).&lt;br /&gt;
*'''bAlpha:''' The amount of alpha (0-255).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the color filter was set, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets any player disable the default color filtering&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function disableFilter()&lt;br /&gt;
   setColorFilter(0, 0, 0, 0, 0, 0, 0, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;disable_filter&amp;quot;, disableFilter) -- Add the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67646</id>
		<title>DxCreateShader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67646"/>
		<updated>2020-10-27T10:00:47Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[shader]] element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [[shader|Effect File]] contains a fallback technique which will work on every PC in the universe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateShader.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.8-9.20688|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, table macros = {}, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''macros:''' A table contains macros in an ordered and/or unordered way. See example below.&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myShader then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myShader )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch shader on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myShader then&lt;br /&gt;
            myShader = dxCreateShader( &amp;quot;fancything.fx&amp;quot; )  -- Create shader&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myShader )                    -- Destroy shader&lt;br /&gt;
            myShader = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0156|1.5.6-9.14403|&lt;br /&gt;
This example creates basic shader from raw data (without i/o) on resource start:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myShader_raw_data = [[&lt;br /&gt;
	texture tex;&lt;br /&gt;
	technique replace {&lt;br /&gt;
		pass P0 {&lt;br /&gt;
			Texture[0] = tex;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	local myShader = dxCreateShader(myShader_raw_data) -- create shader from raw data&lt;br /&gt;
	if isElement(myShader) then&lt;br /&gt;
		local myTexture = dxCreateTexture(&amp;quot;some_image.png&amp;quot;) -- create texture from image file&lt;br /&gt;
		if isElement(myTexture) then&lt;br /&gt;
			-- apply image to world texture via shader&lt;br /&gt;
			dxSetShaderValue(myShader, &amp;quot;tex&amp;quot;, myTexture)&lt;br /&gt;
			engineApplyShaderToWorldTexture(myShader, &amp;quot;shad_ped&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			outputDebugString(&amp;quot;Unable to load texture&amp;quot;, 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Unable to create shader&amp;quot;, 1)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can pass raw data (shader code) directly into the function (example uses variable ''myShader_raw_data'').&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.8-9.20688|&lt;br /&gt;
This example creates a basic shader using macros to change shader's behaviour&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local shaderRawStr = [[&lt;br /&gt;
    texture MACRO_TEX_NAME;&lt;br /&gt;
&lt;br /&gt;
    technique simple&lt;br /&gt;
    {&lt;br /&gt;
        pass P0&lt;br /&gt;
        {&lt;br /&gt;
            //-- Set up texture stage 0&lt;br /&gt;
            Texture[0] = MACRO_TEX_NAME;&lt;br /&gt;
	    ColorOp[0] = SelectArg1;&lt;br /&gt;
	#ifdef MACRO_FIRST_ARG&lt;br /&gt;
	    ColorArg1[0] = Texture;&lt;br /&gt;
	#else&lt;br /&gt;
	    ColorArg1[0] = Diffuse;&lt;br /&gt;
	#endif&lt;br /&gt;
	    AlphaOp[0] = SelectArg1;&lt;br /&gt;
	    AlphaArg1[0] = Texture;&lt;br /&gt;
                &lt;br /&gt;
            //-- Disable texture stage 1&lt;br /&gt;
            ColorOp[1] = Disable;&lt;br /&gt;
            AlphaOp[1] = Disable;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local shader, tech = dxCreateShader( shaderRawStr,  { MACRO_TEX_NAME = &amp;quot;Tex0&amp;quot;,  MACRO_FIRST_ARG = true } )&lt;br /&gt;
        if not shader or tech ~= &amp;quot;simple&amp;quot; then&lt;br /&gt;
            outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
        end	&lt;br /&gt;
        &lt;br /&gt;
        local texture = dxCreateTexture( &amp;quot;test.png&amp;quot; )&lt;br /&gt;
        if not texture then&lt;br /&gt;
	    outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	dxSetShaderValue( shader, &amp;quot;Tex0&amp;quot;, texture )&lt;br /&gt;
		&lt;br /&gt;
	addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
	    function()&lt;br /&gt;
	        dxDrawImage( 0, 0, 500, 500, shader )&lt;br /&gt;
	    end&lt;br /&gt;
	, false )&lt;br /&gt;
    end&lt;br /&gt;
, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also pass macros in key-value pairs when the order is important.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04435|Added layered and elementTypes arguments}}&lt;br /&gt;
{{ChangelogItem|1.5.6-9.14403|Added option to use raw data instead of a file name}}&lt;br /&gt;
{{ChangelogItem|1.5.8-9.20688|Added option to use macros}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxCreateShader]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67645</id>
		<title>DxCreateShader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67645"/>
		<updated>2020-10-27T08:49:12Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[shader]] element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [[shader|Effect File]] contains a fallback technique which will work on every PC in the universe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateShader.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.8-9.20688|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, table macros = {}, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''macros:''' A table contains macros in an ordered and/or unordered way. See example below.&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myShader then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myShader )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch shader on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myShader then&lt;br /&gt;
            myShader = dxCreateShader( &amp;quot;fancything.fx&amp;quot; )  -- Create shader&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myShader )                    -- Destroy shader&lt;br /&gt;
            myShader = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0156|1.5.6-9.14403|&lt;br /&gt;
This example creates basic shader from raw data (without i/o) on resource start:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myShader_raw_data = [[&lt;br /&gt;
	texture tex;&lt;br /&gt;
	technique replace {&lt;br /&gt;
		pass P0 {&lt;br /&gt;
			Texture[0] = tex;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	local myShader = dxCreateShader(myShader_raw_data) -- create shader from raw data&lt;br /&gt;
	if isElement(myShader) then&lt;br /&gt;
		local myTexture = dxCreateTexture(&amp;quot;some_image.png&amp;quot;) -- create texture from image file&lt;br /&gt;
		if isElement(myTexture) then&lt;br /&gt;
			-- apply image to world texture via shader&lt;br /&gt;
			dxSetShaderValue(myShader, &amp;quot;tex&amp;quot;, myTexture)&lt;br /&gt;
			engineApplyShaderToWorldTexture(myShader, &amp;quot;shad_ped&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			outputDebugString(&amp;quot;Unable to load texture&amp;quot;, 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Unable to create shader&amp;quot;, 1)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can pass raw data (shader code) directly into the function (example uses variable ''myShader_raw_data'').&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.8-9.20688|&lt;br /&gt;
This example creates a basic shader using macros to change shader's behaviour&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local shaderRawStr = [[&lt;br /&gt;
    texture MACRO_TEX_NAME;&lt;br /&gt;
&lt;br /&gt;
    technique simple&lt;br /&gt;
    {&lt;br /&gt;
        pass P0&lt;br /&gt;
        {&lt;br /&gt;
            //-- Set up texture stage 0&lt;br /&gt;
            Texture[0] = MACRO_TEX_NAME;&lt;br /&gt;
	    ColorOp[0] = SelectArg1;&lt;br /&gt;
	#ifdef MACRO_FIRST_ARG&lt;br /&gt;
	    ColorArg1[0] = Texture;&lt;br /&gt;
	#else&lt;br /&gt;
	    ColorArg1[0] = Diffuse;&lt;br /&gt;
	#endif&lt;br /&gt;
	    AlphaOp[0] = SelectArg1;&lt;br /&gt;
	    AlphaArg1[0] = Texture;&lt;br /&gt;
                &lt;br /&gt;
            //-- Disable texture stage 1&lt;br /&gt;
            ColorOp[1] = Disable;&lt;br /&gt;
            AlphaOp[1] = Disable;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function ( )&lt;br /&gt;
        local shader, tech = dxCreateShader( shaderRawStr,  { MACRO_TEX_NAME = &amp;quot;Tex0&amp;quot;,  MACRO_FIRST_ARG = true } )&lt;br /&gt;
        if not shader or tech ~= &amp;quot;simple&amp;quot; then&lt;br /&gt;
            outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
        end	&lt;br /&gt;
        &lt;br /&gt;
        local texture = dxCreateTexture( &amp;quot;test.png&amp;quot; )&lt;br /&gt;
        if not texture then&lt;br /&gt;
	    outputDebugString( &amp;quot;An error was occured&amp;quot; )&lt;br /&gt;
	    return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	dxSetShaderValue( shader, &amp;quot;Tex0&amp;quot;, texture )&lt;br /&gt;
		&lt;br /&gt;
	addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
	    function()&lt;br /&gt;
	        dxDrawImage( 0, 0, 500, 500, shader )&lt;br /&gt;
	    end&lt;br /&gt;
	, false )&lt;br /&gt;
    end&lt;br /&gt;
, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can also pass macros in key-value pairs when the order is important.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04435|Added layered and elementTypes arguments}}&lt;br /&gt;
{{ChangelogItem|1.5.6-9.14403|Added option to use raw data instead of a file name}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxCreateShader]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67644</id>
		<title>DxCreateShader</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxCreateShader&amp;diff=67644"/>
		<updated>2020-10-27T08:12:30Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a [[shader]] element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [[shader|Effect File]] contains a fallback technique which will work on every PC in the universe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;It is highly recommended that [[dxSetTestMode]] is used when writing and testing scripts using dxCreateShader.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.8-9.20688|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element, string dxCreateShader ( string filepath / string raw_data [, table macros = {}, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = &amp;quot;world,vehicle,object,other&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Shader|DxShader]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath / raw_data:''' The filepath of the [[shader|shader  Effect File]] (.fx) file or whole data buffer of the shader file&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
''All the following optional arguments are only relevant when the shader is used with [[engineApplyShaderToWorldTexture]]''&lt;br /&gt;
*'''macros:''' A table contains macros in an ordered and/or unordered way. See example below.&lt;br /&gt;
*'''priority:''' If more than one shader is matched to a world texture, the shader with the highest priority will be used. If there is more than one shader with the same highest priority, the most recently created shader is used.&lt;br /&gt;
*'''maxDistance:''' If non-zero, the shader will be applied to textures nearer than maxDistance only. This can speed up rendering, but (to look good) may require the shader to fade out it's own effect as the texture reaches maxDistance.&lt;br /&gt;
*'''layered:''' When set to true, the shader will be drawn in a separate render pass. Several layered shaders can be drawn on the same world texture. (To avoid [http://en.wikipedia.org/wiki/Z-fighting Z fighting] artifacts, you may have to add '''DepthBias&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;-0.0002;''' to the technique pass, but this might cause visual artifacts when applied on vehicles)&lt;br /&gt;
*'''elementTypes:''' A comma seperated list of element types to restrict this shader to. Valid element types are:&lt;br /&gt;
** world - Textures in the GTA world&lt;br /&gt;
** ped - Player and ped textures&lt;br /&gt;
** vehicle - Vehicles textures&lt;br /&gt;
** object - Objects textures&lt;br /&gt;
** other - Element textures which are not peds, vehicles or objects&lt;br /&gt;
** all - Everything&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''element:''' A [[shader]] element if successful, ''false'' if invalid arguments were passed to the function. '''You should always check to see if this function has returned false.'''&lt;br /&gt;
*'''string:''' The name of the technique that will be used.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myShader then&lt;br /&gt;
            dxDrawImage( 100, 350, 300, 350, myShader )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
-- Use 'toggle' command to switch shader on and off&lt;br /&gt;
addCommandHandler( &amp;quot;toggle&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        if not myShader then&lt;br /&gt;
            myShader = dxCreateShader( &amp;quot;fancything.fx&amp;quot; )  -- Create shader&lt;br /&gt;
        else        &lt;br /&gt;
            destroyElement( myShader )                    -- Destroy shader&lt;br /&gt;
            myShader = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{New items|5.0156|1.5.6-9.14403|&lt;br /&gt;
This example creates basic shader from raw data (without i/o) on resource start:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myShader_raw_data = [[&lt;br /&gt;
	texture tex;&lt;br /&gt;
	technique replace {&lt;br /&gt;
		pass P0 {&lt;br /&gt;
			Texture[0] = tex;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
	local myShader = dxCreateShader(myShader_raw_data) -- create shader from raw data&lt;br /&gt;
	if isElement(myShader) then&lt;br /&gt;
		local myTexture = dxCreateTexture(&amp;quot;some_image.png&amp;quot;) -- create texture from image file&lt;br /&gt;
		if isElement(myTexture) then&lt;br /&gt;
			-- apply image to world texture via shader&lt;br /&gt;
			dxSetShaderValue(myShader, &amp;quot;tex&amp;quot;, myTexture)&lt;br /&gt;
			engineApplyShaderToWorldTexture(myShader, &amp;quot;shad_ped&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			outputDebugString(&amp;quot;Unable to load texture&amp;quot;, 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		outputDebugString(&amp;quot;Unable to create shader&amp;quot;, 1)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can pass raw data (shader code) directly into the function (example uses variable ''myShader_raw_data'').&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.0-9.04435|Added layered and elementTypes arguments}}&lt;br /&gt;
{{ChangelogItem|1.5.6-9.14403|Added option to use raw data instead of a file name}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:dxCreateShader]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39645</id>
		<title>RU/engineStreamingSetProperty/validProps</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39645"/>
		<updated>2014-05-28T07:47:53Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Undo revision 39642 by TEDERIs (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[EngineStreamingSetProperty/validProps ru]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39644</id>
		<title>MTA Eir/Functions/engineStreamingSetProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39644"/>
		<updated>2014-05-28T07:46:39Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{*Client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the behavior of the GTA:SA streaming system. It is meant to optimize the performance of the game for your custom server. Changes in these properties affect the gameplay quality of the entire server.&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 engineStreamingSetProperty ( string propertyName, var propValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
*'''propertyName:''' the name of the streaming property you want to change&lt;br /&gt;
*'''propValue:''' value to pass to the property&lt;br /&gt;
&lt;br /&gt;
===Valid Properties===&lt;br /&gt;
{{:MTA:Eir/functions/engineStreamingSetProperty/validProps_ru}}&lt;br /&gt;
&lt;br /&gt;
===Useful Media===&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_opt.zip - streaming debugging resource&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_test.zip - streaming mode example resource&lt;br /&gt;
* http://youtu.be/sk8WsHwPgsU - showcase video&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if valid arguments have been passed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples== &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;
This snippet ultimatively fixes the world flickering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;gcOnDemand&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
&lt;br /&gt;
local lastBusyTime = false;&lt;br /&gt;
local fiberedDuration = 5000;&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local isBusy = engineGetStreamingInfo().isBusy;&lt;br /&gt;
&lt;br /&gt;
        if ( isBusy ) then&lt;br /&gt;
            local now = getTickCount();&lt;br /&gt;
&lt;br /&gt;
            if not ( lastBusyTime ) then&lt;br /&gt;
                lastBusyTime = now;&lt;br /&gt;
&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
            end&lt;br /&gt;
        elseif ( lastBusyTime ) then&lt;br /&gt;
            if ( now - lastBusyTime &amp;gt; fiberedDuration ) then&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;fiberedPerfMult&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA:Eir/functions/engineStreamingSetProperty&amp;diff=39643</id>
		<title>MTA:Eir/functions/engineStreamingSetProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA:Eir/functions/engineStreamingSetProperty&amp;diff=39643"/>
		<updated>2014-05-28T07:45:36Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Undo revision 39626 by TEDERIs (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{*Client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the behavior of the GTA:SA streaming system. It is meant to optimize the performance of the game for your custom server. Changes in these properties affect the gameplay quality of the entire server.&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 engineStreamingSetProperty ( string propertyName, var propValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
*'''propertyName:''' the name of the streaming property you want to change&lt;br /&gt;
*'''propValue:''' value to pass to the property&lt;br /&gt;
&lt;br /&gt;
===Valid Properties===&lt;br /&gt;
{{:MTA:Eir/functions/engineStreamingSetProperty/validProps}}&lt;br /&gt;
&lt;br /&gt;
===Useful Media===&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_opt.zip - streaming debugging resource&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_test.zip - streaming mode example resource&lt;br /&gt;
* http://youtu.be/sk8WsHwPgsU - showcase video&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if valid arguments have been passed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples== &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;
This snippet ultimatively fixes the world flickering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;gcOnDemand&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
&lt;br /&gt;
local lastBusyTime = false;&lt;br /&gt;
local fiberedDuration = 5000;&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local isBusy = engineGetStreamingInfo().isBusy;&lt;br /&gt;
&lt;br /&gt;
        if ( isBusy ) then&lt;br /&gt;
            local now = getTickCount();&lt;br /&gt;
&lt;br /&gt;
            if not ( lastBusyTime ) then&lt;br /&gt;
                lastBusyTime = now;&lt;br /&gt;
&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
            end&lt;br /&gt;
        elseif ( lastBusyTime ) then&lt;br /&gt;
            if ( now - lastBusyTime &amp;gt; fiberedDuration ) then&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;fiberedPerfMult&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39642</id>
		<title>RU/engineStreamingSetProperty/validProps</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39642"/>
		<updated>2014-05-28T07:44:07Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39641</id>
		<title>MTA Eir/Functions/engineStreamingSetProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39641"/>
		<updated>2014-05-28T07:42:00Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: Undo revision 39628 by TEDERIs (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{*Client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function changes the behavior of the GTA:SA streaming system. It is meant to optimize the performance of the game for your custom server. Changes in these properties affect the gameplay quality of the entire server.&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 engineStreamingSetProperty ( string propertyName, var propValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
*'''propertyName:''' the name of the streaming property you want to change&lt;br /&gt;
*'''propValue:''' value to pass to the property&lt;br /&gt;
&lt;br /&gt;
===Valid Properties===&lt;br /&gt;
{{:MTA:Eir/functions/engineStreamingSetProperty/validProps_ru}}&lt;br /&gt;
&lt;br /&gt;
===Useful Media===&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_opt.zip - streaming debugging resource&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_test.zip - streaming mode example resource&lt;br /&gt;
* http://youtu.be/sk8WsHwPgsU - showcase video&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if valid arguments have been passed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples== &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;
This snippet ultimatively fixes the world flickering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;gcOnDemand&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
&lt;br /&gt;
local lastBusyTime = false;&lt;br /&gt;
local fiberedDuration = 5000;&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local isBusy = engineGetStreamingInfo().isBusy;&lt;br /&gt;
&lt;br /&gt;
        if ( isBusy ) then&lt;br /&gt;
            local now = getTickCount();&lt;br /&gt;
&lt;br /&gt;
            if not ( lastBusyTime ) then&lt;br /&gt;
                lastBusyTime = now;&lt;br /&gt;
&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
            end&lt;br /&gt;
        elseif ( lastBusyTime ) then&lt;br /&gt;
            if ( now - lastBusyTime &amp;gt; fiberedDuration ) then&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;fiberedPerfMult&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ru:engineStreamingSetProperty]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39640</id>
		<title>MTA Eir/Functions/engineStreamingSetProperty</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=MTA_Eir/Functions/engineStreamingSetProperty&amp;diff=39640"/>
		<updated>2014-05-28T07:41:30Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{*Client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Эта функция изменяет поведение системы стриминга GTA:SA. Это может увеличить производительность игры для ваших пользовательских серверов. Изменение этих свойств затрагивает качество игрового процесса на всем сервере.&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 engineStreamingSetProperty ( string propertyName, var propValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
*'''propertyName:''' the name of the streaming property you want to change&lt;br /&gt;
*'''propValue:''' value to pass to the property&lt;br /&gt;
&lt;br /&gt;
===Valid Properties===&lt;br /&gt;
{{:MTA:Eir/functions/engineStreamingSetProperty/validProps_ru}}&lt;br /&gt;
&lt;br /&gt;
===Useful Media===&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_opt.zip - streaming debugging resource&lt;br /&gt;
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/streaming_test.zip - streaming mode example resource&lt;br /&gt;
* http://youtu.be/sk8WsHwPgsU - showcase video&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if valid arguments have been passed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples== &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;
This snippet ultimatively fixes the world flickering.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;gcOnDemand&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;infiniteStreaming&amp;quot;, false );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;strictNodeDistrib&amp;quot;, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
&lt;br /&gt;
local lastBusyTime = false;&lt;br /&gt;
local fiberedDuration = 5000;&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local isBusy = engineGetStreamingInfo().isBusy;&lt;br /&gt;
&lt;br /&gt;
        if ( isBusy ) then&lt;br /&gt;
            local now = getTickCount();&lt;br /&gt;
&lt;br /&gt;
            if not ( lastBusyTime ) then&lt;br /&gt;
                lastBusyTime = now;&lt;br /&gt;
&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
            end&lt;br /&gt;
        elseif ( lastBusyTime ) then&lt;br /&gt;
            if ( now - lastBusyTime &amp;gt; fiberedDuration ) then&lt;br /&gt;
                engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, false );&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&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;
This snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;isFibered&amp;quot;, true );&lt;br /&gt;
engineStreamingSetProperty( &amp;quot;fiberedPerfMult&amp;quot;, 0 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ru:engineStreamingSetProperty]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineStreamingSetProperty/validProps_ru&amp;diff=39637</id>
		<title>EngineStreamingSetProperty/validProps ru</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineStreamingSetProperty/validProps_ru&amp;diff=39637"/>
		<updated>2014-05-28T07:37:45Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Имя&lt;br /&gt;
! Тип&lt;br /&gt;
! Описание&lt;br /&gt;
! Значение&lt;br /&gt;
|-&lt;br /&gt;
|strictNodeDistrib&lt;br /&gt;
|boolean&lt;br /&gt;
|Это действительно только в связке с '''infiniteStreaming'''. Если включено, сущности сначала выделяются из существующих нодов. Если отключено, сущностям разрешено выделять новые ноды стриминга из кучи не задевая существующие ноды.&lt;br /&gt;
|Enabled&lt;br /&gt;
|-&lt;br /&gt;
|infiniteStreaming&lt;br /&gt;
|boolean&lt;br /&gt;
|Включает или отключает выделение кучи [[GTA:SA_Streaming_Garbage_Collection|Сборшика мусора нодов стриминга]]. Поведение порядка выделения может быть изменено используя '''strictNodeDistrib'''. Если включено, GTA:SA теоритически может держать бесконечное количество сущностей внутри сборщика мусора стриминга. Это также означает, что на экране теоритически может быть отрисовано бесконечное количество сущностей в одно время.&lt;br /&gt;
|Disabled&lt;br /&gt;
|-&lt;br /&gt;
|gcOnDemand&lt;br /&gt;
|boolean&lt;br /&gt;
|Используется для запуска [[GTA:SA_Streaming_Garbage_Collection|Сборшика мусора стриминга]] в случае, когда потеряет все свободные доступные ноды GC стриминга. Весь мир проверяется на сущности за пределами экрана или находящиеся слишком далеко. Каждая сущность находит и теряет свои RenderWare данные. Когда информация об определенной модели сущности больше не используется, она освобождается. Таким образом, несколько нодов GC стриминга становятся доступными для выделения. Этот путь выделения нодов из игровых сущностей безопаснее, чем изъятие нодов стриминга реализованное Rockstar Games.&lt;br /&gt;
|Disabled&lt;br /&gt;
|-&lt;br /&gt;
|nodeStealing&lt;br /&gt;
|boolean&lt;br /&gt;
|Позволяет или запрещает нодами [[GTA:SA_Streaming_Garbage_Collection|GC Стриминга]] изыматься первоначальной GTA:SA. Эта функциональность, которая непосредственно вызывает мерцание мира если существует нехватка нодов GC стриминга. Отключение этой функциональности будет ограничивать количество сущностей, которые могут быть высвобождены их нодами GC стриминга.&lt;br /&gt;
|Enabled&lt;br /&gt;
|-&lt;br /&gt;
|isFibered&lt;br /&gt;
|boolean&lt;br /&gt;
|Переключает между оригинальной и fibered загрузкой [[GTA:SA_Resource_Streaming|Системы GTA:SA стриминга]]. В оригинальном режиме, большинство ресурсов загружаются одномоментно, но некоторые большие (превышают размер буфера слайсера) исключительны для загрузки и выполняются в два толчка. В fibered режиме, система стриминга может только получать определенный пользователем процентаж от времени игрового кадра, что позволяет ресурсам брать произвольное количество точков в зависимости от сложности указанных ресуров.&lt;br /&gt;
|Enabled&lt;br /&gt;
|-&lt;br /&gt;
|fiberedPerfMult&lt;br /&gt;
|number&lt;br /&gt;
|Эта функция изменяет fibered процентаж времени загрузки кадра [[GTA:SA_Resource_Streaming|Системы стриминга MTA:Eir]]. 100% означает что система стриминга может брать так много, сколько движок забрал в последнем кадре. Если установлено на 0%, система стриминга не остановится, но сделает шаг игнорируя все настройки времени.&lt;br /&gt;
Низкий процентаж снизит нагрузку на CPU, которую загрузчик стриминга передает каждый кадр. Пока это незаметно на высокопроизводительных CPU, но довольно значительно проявляется на слабых CPU при низких показателях процентажа когда игрок пересекает мир или входит в плотно застроенные зоны. В общем, низкий процентаж ограничивает лаги, которые происходят при загрузке плотных застроенных зон.&lt;br /&gt;
|0.6&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39636</id>
		<title>RU/engineStreamingSetProperty/validProps</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/engineStreamingSetProperty/validProps&amp;diff=39636"/>
		<updated>2014-05-28T07:36:34Z</updated>

		<summary type="html">&lt;p&gt;TEDERIs: TEDERIs moved page RU/engineStreamingSetProperty/validProps to EngineStreamingSetProperty/validProps ru: Russian version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[EngineStreamingSetProperty/validProps ru]]&lt;/div&gt;</summary>
		<author><name>TEDERIs</name></author>
	</entry>
</feed>