<?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=Fixelly</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=Fixelly"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Fixelly"/>
	<updated>2026-05-16T14:48:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&amp;diff=73123</id>
		<title>Client Scripting Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&amp;diff=73123"/>
		<updated>2021-12-08T14:28:02Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: Changed redirect target from Https://www.youtube.com/watch?v=dQw4w9WgXcQ to New website&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[New website]]&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&amp;diff=73122</id>
		<title>Client Scripting Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&amp;diff=73122"/>
		<updated>2021-12-08T14:27:50Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: Redirected page to Https://www.youtube.com/watch?v=dQw4w9WgXcQ&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[https://www.youtube.com/watch?v=dQw4w9WgXcQ]]&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=73121</id>
		<title>Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=73121"/>
		<updated>2021-12-08T14:24:55Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = 000000 |&lt;br /&gt;
   bordertype = dotted |&lt;br /&gt;
   bgcolorhex = EFEFEF |&lt;br /&gt;
   image = File:Package-x-generic.png |&lt;br /&gt;
   title = Don't forget to check out the [[Useful Classes]] |&lt;br /&gt;
   subtext = &amp;lt;span style=&amp;quot;font-size: 85%;&amp;quot;&amp;gt;''That page lists user-made classes that are not included by default in MTA. ''&amp;lt;/span&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
This page lists user-made Lua functions that are not included by default in MTA. Its purpose is to quickly provide some useful functions for scripters, so they do not waste time recreating them when needed.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
{{Useful_Functions}}&lt;br /&gt;
&lt;br /&gt;
[[HU:Useful Functions]]&lt;br /&gt;
[[ES:Funciones Útiles]]&lt;br /&gt;
[[ru:Полезные функции]]&lt;br /&gt;
[[de:Nützliche_Funktionen]]&lt;br /&gt;
[[PL:Użyteczne Funkcje]]&lt;br /&gt;
[[Ar:وظائف مفيدة]]&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=73120</id>
		<title>Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=73120"/>
		<updated>2021-12-08T14:23:12Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: Replaced content with &amp;quot;guwniarz&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;guwniarz&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawBluredRectangle&amp;diff=71438</id>
		<title>DxDrawBluredRectangle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawBluredRectangle&amp;diff=71438"/>
		<updated>2021-07-05T07:02:06Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function draws a 2D blured rectangle on the screen - rendered for one frame. This should be used in conjunction with onClientRender for continuous display.&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 dxDrawBluredRectangle ( float x, float y, float width, float height )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required Arguments === &lt;br /&gt;
* '''x:''' An float representing the '''absolute''' origin X position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''y:''' An float representing the '''absolute''' origin Y position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''width:''' An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.&lt;br /&gt;
* '''height:''' An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.&lt;br /&gt;
&lt;br /&gt;
=== Required Files === &lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170045651910686/mta-helper.fx mta-helper.fx],&lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170037255307294/blurV.fx blurV.fx],&lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170034495455232/blurH.fx blurH.fx]&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;
== Code ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local scx, scy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
Settings = {}&lt;br /&gt;
Settings.var = {}&lt;br /&gt;
Settings.var.blur = 1&lt;br /&gt;
Settings.var.optim = 4&lt;br /&gt;
Settings.screenRectangle = {}&lt;br /&gt;
&lt;br /&gt;
local current&lt;br /&gt;
&lt;br /&gt;
function createShader()&lt;br /&gt;
        myScreenSource = dxCreateScreenSource( scx/Settings.var.optim, scy/Settings.var.optim )&lt;br /&gt;
        blurHShader,tecName = dxCreateShader( &amp;quot;shaders/blurH.fx&amp;quot; )&lt;br /&gt;
        blurVShader,tecName = dxCreateShader( &amp;quot;shaders/blurV.fx&amp;quot; )&lt;br /&gt;
	bAllValid = myScreenSource and blurHShader and blurVShader&lt;br /&gt;
end&lt;br /&gt;
createShader()&lt;br /&gt;
&lt;br /&gt;
function preRender ()&lt;br /&gt;
	if not Settings.var then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	RTPool.frameStart()&lt;br /&gt;
	dxUpdateScreenSource( myScreenSource )&lt;br /&gt;
	current = myScreenSource&lt;br /&gt;
	current = applyGBlurH( current, Settings.var.blur )&lt;br /&gt;
	current = applyGBlurV( current, Settings.var.blur )&lt;br /&gt;
	dxSetRenderTarget()&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onClientRender&amp;quot;, root, preRender)&lt;br /&gt;
&lt;br /&gt;
function dxDrawBluredRectangle (pos_x, pos_y, size_x, size_y, color)&lt;br /&gt;
	 if bAllValid then&lt;br /&gt;
	 dxDrawImageSection  ( pos_x, pos_y, size_x, size_y, pos_x/Settings.var.optim, pos_y/Settings.var.optim, size_x/Settings.var.optim, size_y/Settings.var.optim, current, 0,0,0, color)&lt;br /&gt;
	 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function applyGBlurH( Src, blur )&lt;br /&gt;
	if not Src then return nil end&lt;br /&gt;
	local mx,my = dxGetMaterialSize( Src )&lt;br /&gt;
	local newRT = RTPool.GetUnused(mx,my)&lt;br /&gt;
	if not newRT then return nil end&lt;br /&gt;
	dxSetRenderTarget( newRT, true )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;TEX0&amp;quot;, Src )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;TEX0SIZE&amp;quot;, mx,my )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;BLUR&amp;quot;, blur )&lt;br /&gt;
	dxDrawImage( 0, 0, mx, my, blurHShader )&lt;br /&gt;
	return newRT&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function applyGBlurV( Src, blur )&lt;br /&gt;
	if not Src then return nil end&lt;br /&gt;
	local mx,my = dxGetMaterialSize( Src )&lt;br /&gt;
	local newRT = RTPool.GetUnused(mx,my)&lt;br /&gt;
	if not newRT then return nil end&lt;br /&gt;
	dxSetRenderTarget( newRT, true )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;TEX0&amp;quot;, Src )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;TEX0SIZE&amp;quot;, mx,my )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;BLUR&amp;quot;, blur )&lt;br /&gt;
	dxDrawImage( 0, 0, mx,my, blurVShader )&lt;br /&gt;
	return newRT&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RTPool = {}&lt;br /&gt;
RTPool.list = {}&lt;br /&gt;
&lt;br /&gt;
function RTPool.frameStart()&lt;br /&gt;
	for rt,info in pairs(RTPool.list) do&lt;br /&gt;
		info.bInUse = false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function RTPool.GetUnused( mx, my )&lt;br /&gt;
	for rt,info in pairs(RTPool.list) do&lt;br /&gt;
		if not info.bInUse and info.mx == mx and info.my == my then&lt;br /&gt;
			info.bInUse = true&lt;br /&gt;
			return rt&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local rt = dxCreateRenderTarget( mx, my )&lt;br /&gt;
	if rt then&lt;br /&gt;
		RTPool.list[rt] = { bInUse = true, mx = mx, my = my }&lt;br /&gt;
	end&lt;br /&gt;
	return rt&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local scx, scy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function drawBluredRectangle()&lt;br /&gt;
	dxDrawBluredRectangle( scx/3.8, scy/3.8, scx/2.02, scy/2 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, drawBluredRectangle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Author: fiXlly, WaRuS =====&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawBluredRectangle&amp;diff=71437</id>
		<title>DxDrawBluredRectangle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawBluredRectangle&amp;diff=71437"/>
		<updated>2021-07-05T06:59:05Z</updated>

		<summary type="html">&lt;p&gt;Fixelly: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function draws a 2D blured rectangle on the screen - rendered for one frame. This should be used in conjunction with onClientRender for continuous display.&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 dxDrawBluredRectangle ( float x, float y, float width, float height )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Required Arguments === &lt;br /&gt;
* '''x:''' An float representing the '''absolute''' origin X position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''y:''' An float representing the '''absolute''' origin Y position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''width:''' An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.&lt;br /&gt;
* '''height:''' An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.&lt;br /&gt;
&lt;br /&gt;
=== Required Files === &lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170045651910686/mta-helper.fx mta-helper.fx],&lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170037255307294/blurV.fx blurV.fx],&lt;br /&gt;
[https://cdn.discordapp.com/attachments/851000636484747274/861170034495455232/blurH.fx blurH.fx]&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;
== Code ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local scx, scy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
Settings = {}&lt;br /&gt;
Settings.var = {}&lt;br /&gt;
Settings.var.blur = 1&lt;br /&gt;
Settings.var.optim = 4&lt;br /&gt;
Settings.screenRectangle = {}&lt;br /&gt;
&lt;br /&gt;
local current&lt;br /&gt;
&lt;br /&gt;
function createShader()&lt;br /&gt;
        myScreenSource = dxCreateScreenSource( scx/Settings.var.optim, scy/Settings.var.optim )&lt;br /&gt;
        blurHShader,tecName = dxCreateShader( &amp;quot;shaders/blurH.fx&amp;quot; )&lt;br /&gt;
        blurVShader,tecName = dxCreateShader( &amp;quot;shaders/blurV.fx&amp;quot; )&lt;br /&gt;
	bAllValid = myScreenSource and blurHShader and blurVShader&lt;br /&gt;
end&lt;br /&gt;
createShader()&lt;br /&gt;
&lt;br /&gt;
function blur_createBlurRenctagle(bool)&lt;br /&gt;
	if bool then&lt;br /&gt;
		Settings.screenRectangle = {pos_x, pos_y, size_x, size_y}&lt;br /&gt;
		createShader()&lt;br /&gt;
		addEventHandler( &amp;quot;onClientHUDRender&amp;quot;, root, blur_render2)&lt;br /&gt;
        else&lt;br /&gt;
		if isElement (blurHShader) and isElement (blurVShader) then&lt;br /&gt;
			Settings.screenRectangle = {}&lt;br /&gt;
			destroyElement (blurVShader)&lt;br /&gt;
			destroyElement (blurHShader)&lt;br /&gt;
		end&lt;br /&gt;
		removeEventHandler( &amp;quot;onClientHUDRender&amp;quot;, root, blur_render2)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function preRender ()&lt;br /&gt;
	if not Settings.var then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	RTPool.frameStart()&lt;br /&gt;
	dxUpdateScreenSource( myScreenSource )&lt;br /&gt;
	current = myScreenSource&lt;br /&gt;
	current = applyGBlurH( current, Settings.var.blur )&lt;br /&gt;
	current = applyGBlurV( current, Settings.var.blur )&lt;br /&gt;
	dxSetRenderTarget()&lt;br /&gt;
end&lt;br /&gt;
addEventHandler (&amp;quot;onClientRender&amp;quot;, root, preRender)&lt;br /&gt;
&lt;br /&gt;
function dxDrawBluredRectangle (pos_x, pos_y, size_x, size_y, color)&lt;br /&gt;
	 if bAllValid then&lt;br /&gt;
	 dxDrawImageSection  ( pos_x, pos_y, size_x, size_y, pos_x/Settings.var.optim, pos_y/Settings.var.optim, size_x/Settings.var.optim, size_y/Settings.var.optim, current, 0,0,0, color)&lt;br /&gt;
	 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function applyGBlurH( Src, blur )&lt;br /&gt;
	if not Src then return nil end&lt;br /&gt;
	local mx,my = dxGetMaterialSize( Src )&lt;br /&gt;
	local newRT = RTPool.GetUnused(mx,my)&lt;br /&gt;
	if not newRT then return nil end&lt;br /&gt;
	dxSetRenderTarget( newRT, true )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;TEX0&amp;quot;, Src )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;TEX0SIZE&amp;quot;, mx,my )&lt;br /&gt;
	dxSetShaderValue( blurHShader, &amp;quot;BLUR&amp;quot;, blur )&lt;br /&gt;
	dxDrawImage( 0, 0, mx, my, blurHShader )&lt;br /&gt;
	return newRT&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function applyGBlurV( Src, blur )&lt;br /&gt;
	if not Src then return nil end&lt;br /&gt;
	local mx,my = dxGetMaterialSize( Src )&lt;br /&gt;
	local newRT = RTPool.GetUnused(mx,my)&lt;br /&gt;
	if not newRT then return nil end&lt;br /&gt;
	dxSetRenderTarget( newRT, true )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;TEX0&amp;quot;, Src )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;TEX0SIZE&amp;quot;, mx,my )&lt;br /&gt;
	dxSetShaderValue( blurVShader, &amp;quot;BLUR&amp;quot;, blur )&lt;br /&gt;
	dxDrawImage( 0, 0, mx,my, blurVShader )&lt;br /&gt;
	return newRT&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
RTPool = {}&lt;br /&gt;
RTPool.list = {}&lt;br /&gt;
&lt;br /&gt;
function RTPool.frameStart()&lt;br /&gt;
	for rt,info in pairs(RTPool.list) do&lt;br /&gt;
		info.bInUse = false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function RTPool.GetUnused( mx, my )&lt;br /&gt;
	for rt,info in pairs(RTPool.list) do&lt;br /&gt;
		if not info.bInUse and info.mx == mx and info.my == my then&lt;br /&gt;
			info.bInUse = true&lt;br /&gt;
			return rt&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local rt = dxCreateRenderTarget( mx, my )&lt;br /&gt;
	if rt then&lt;br /&gt;
		RTPool.list[rt] = { bInUse = true, mx = mx, my = my }&lt;br /&gt;
	end&lt;br /&gt;
	return rt&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local scx, scy = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function drawBluredRectangle()&lt;br /&gt;
	dxDrawBluredRectangle( scx/3.8, scy/3.8, scx/2.02, scy/2 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, drawBluredRectangle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Author: fiXlly, WaRuS =====&lt;/div&gt;</summary>
		<author><name>Fixelly</name></author>
	</entry>
</feed>