<?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=Jeremy+Themans</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=Jeremy+Themans"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Jeremy_Themans"/>
	<updated>2026-05-14T00:32:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnResourceStop&amp;diff=29717</id>
		<title>OnResourceStop</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnResourceStop&amp;diff=29717"/>
		<updated>2012-03-25T10:25:10Z</updated>

		<summary type="html">&lt;p&gt;Jeremy Themans: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when the resource is stopped. This can occur for a number of reasons:&lt;br /&gt;
* The ''stop'' console command was used&lt;br /&gt;
* The ''restart'' console command was used&lt;br /&gt;
* The resource was modified (the resource will automatically restart)&lt;br /&gt;
* Another resource stopped it using [[stopResource]].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If you wish to just detect a single resource being stopped, you should attach handlers for this event to the resource's root element. You can access this using [[getResourceRootElement]]. &lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element theResourceStopped&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theResourceStopped''': The resource that is being stopped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Add the event's source in the section below --&amp;gt;&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the root [[element]] of the resource that is being stopped.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example displays a message in the chatbox when a resource is stopped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStop&amp;quot;, root, &lt;br /&gt;
    function ( resource )&lt;br /&gt;
        outputChatBox ( &amp;quot;The Resource &amp;quot; .. getResourceName(resource) .. &amp;quot; was stopped!&amp;quot;, thePlayer, root, 255, 255, 255 )&lt;br /&gt;
        outputConsole (&amp;quot;The Resource &amp;quot; ..getResourceName(resource) .. &amp;quot;Was Succesfully Stopped!&amp;quot;, theConsole, root, 255, 255, 255 )&lt;br /&gt;
   end &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Resource events}}&lt;/div&gt;</summary>
		<author><name>Jeremy Themans</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnResourceStop&amp;diff=29716</id>
		<title>OnResourceStop</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnResourceStop&amp;diff=29716"/>
		<updated>2012-03-25T10:23:10Z</updated>

		<summary type="html">&lt;p&gt;Jeremy Themans: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when the resource is stopped. This can occur for a number of reasons:&lt;br /&gt;
* The ''stop'' console command was used&lt;br /&gt;
* The ''restart'' console command was used&lt;br /&gt;
* The resource was modified (the resource will automatically restart)&lt;br /&gt;
* Another resource stopped it using [[stopResource]].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If you wish to just detect a single resource being stopped, you should attach handlers for this event to the resource's root element. You can access this using [[getResourceRootElement]]. &lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element theResourceStopped&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theResourceStopped''': The resource that is being stopped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Add the event's source in the section below --&amp;gt;&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the root [[element]] of the resource that is being stopped.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example displays a message in the chatbox when a resource is stopped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStop&amp;quot;, root, &lt;br /&gt;
    function ( resource )&lt;br /&gt;
        outputChatBox ( &amp;quot;The Resource &amp;quot; .. getResourceName(resource) .. &amp;quot; was stopped!&amp;quot;, root, 255, 255, 255 )&lt;br /&gt;
        outputConsole (&amp;quot;The Resource &amp;quot; ..getResourceName(resource) .. &amp;quot;Was Succesfully Stopped!&amp;quot;, root, 255, 255, 255 )&lt;br /&gt;
   end &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Resource events}}&lt;/div&gt;</summary>
		<author><name>Jeremy Themans</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnResourceStart&amp;diff=29715</id>
		<title>OnResourceStart</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnResourceStart&amp;diff=29715"/>
		<updated>2012-03-25T10:20:47Z</updated>

		<summary type="html">&lt;p&gt;Jeremy Themans: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event is triggered when a resource is loaded.&lt;br /&gt;
&lt;br /&gt;
'''Important:''' If you attach this event to the root element it will called when ''any'' resource starts, not just the resource your script is running inside. As such, most of the time you will want to check that the resource passed to this event matches your resource (compare with the value returned by [[getThisResource]]) before doing anything. Alternatively you can attach the event to [[getResourceRootElement]]([[getThisResource]]()).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource startedResource&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''startedResource''': The resource that was started&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the root [[element]] in the resource that started.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the resource starting is aborted and is gets unloaded again.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code will output the name of any resource that is started.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function displayLoadedRes ( res )&lt;br /&gt;
	outputChatBox ( &amp;quot;Resource &amp;quot; .. getResourceName(res) .. &amp;quot; loaded&amp;quot;, getRootElement(), 255, 255, 255 )&lt;br /&gt;
        outputConsole ( &amp;quot;Resource &amp;quot; ..getResourceName(res).. &amp;quot; Succesfuly started and is the ready to be used&amp;quot;, getRootElement(), 255, 255, 255 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getRootElement(), displayLoadedRes )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Resource events}}&lt;/div&gt;</summary>
		<author><name>Jeremy Themans</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerScreenShot&amp;diff=29714</id>
		<title>OnPlayerScreenShot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerScreenShot&amp;diff=29714"/>
		<updated>2012-03-25T10:03:30Z</updated>

		<summary type="html">&lt;p&gt;Jeremy Themans: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when the screen capture requested by [[takePlayerScreenShot]] has completed.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource theResource, string status, string imageData, int timestamp, string tag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theResource''': The resource which called [[takePlayerScreenShot]]&lt;br /&gt;
*'''status''': The status of the event which can be one of three values:&lt;br /&gt;
**''&amp;quot;ok&amp;quot;'' - The image capture was successful and imageData will contain a JPEG image.&lt;br /&gt;
**''&amp;quot;disabled&amp;quot;'' - The image capture failed because the player has disabled screen uploads.&lt;br /&gt;
**''&amp;quot;minimized&amp;quot;'' - The image capture failed because the player has minimized the screen. (i.e. alt-tabbed)&lt;br /&gt;
*'''imageData''': A string which contains the JPEG image data. This can be saved with the file functions, or sent to players with triggerClientEvent or even uploaded to a web site.&lt;br /&gt;
*'''timestamp''': The server tick count when the capture was taken.&lt;br /&gt;
*'''tag''': The tag string passed to [[takePlayerScreenShot]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]]&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example captures the screen of a random player every 2 seconds and shows it to everyone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&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;
--------------------------------------------------&lt;br /&gt;
-- Take screen shot every 2 seconds&lt;br /&gt;
function doTakeScreenShot()&lt;br /&gt;
    takePlayerScreenShot( getRandomPlayer(), 320, 200 )&lt;br /&gt;
end&lt;br /&gt;
setTimer(doTakeScreenShot, 2000, 0)&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Receive screen shot result&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerScreenShot&amp;quot;, root,&lt;br /&gt;
    function ( theResource, status, pixels, timestamp, tag )&lt;br /&gt;
        triggerClientEvent( root, &amp;quot;onMyClientScreenShot&amp;quot;, resourceRoot, pixels )  -- Relay to all players&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Turn image data into a texture at the client&lt;br /&gt;
addEvent(&amp;quot;onMyClientScreenShot&amp;quot;,true)&lt;br /&gt;
addEventHandler( &amp;quot;onMyClientScreenShot&amp;quot;, resourceRoot,&lt;br /&gt;
    function( pixels )&lt;br /&gt;
        if image then&lt;br /&gt;
            destroyElement(image)&lt;br /&gt;
        end&lt;br /&gt;
        image = dxCreateTexture( pixels )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
-- Show image&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if image then&lt;br /&gt;
            dxDrawImage( 100, 250, 320, 200, image )&lt;br /&gt;
            outputChatBox ( &amp;quot;You Just Took A Screenshot&amp;quot;, pixels )&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;
==Requirements==&lt;br /&gt;
{{Requirements|1.3|n/a|}}&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Jeremy Themans</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadTXD&amp;diff=29713</id>
		<title>EngineLoadTXD</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadTXD&amp;diff=29713"/>
		<updated>2012-03-25T09:52:44Z</updated>

		<summary type="html">&lt;p&gt;Jeremy Themans: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function loads a RenderWare Texture Dictionary (TXD) file into GTA. The texture dictionary can then be used to provide textures.&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your TXD file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
txd engineLoadTXD ( string txd_file [, bool filteringEnabled = true ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
[[Image:Filtering.jpg|thumb|Difference between texture filtering modes (left = filtering disabled, right = filtering enabled).|284x230px]]&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''txd_file:''' The [[filepath]] to the txd file you want to load&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''filteringEnabled:''' Whether to enable texture filtering.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[TXD]] if the file was loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file, with a command handler you just type the command you want and it will replace the TXD and the DFF.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function Replace&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 587 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
--You can also add a commandHandler for the replacing&lt;br /&gt;
addCommandHandler ( &amp;quot;reloadeuros&amp;quot;, Replace ) &lt;br /&gt;
--if you start this resource you have to type /reloadeuros ingame to replace the TXD and the DFF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom DFF, TXD and COL files to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>Jeremy Themans</name></author>
	</entry>
</feed>