<?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=Danilo</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=Danilo"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Danilo"/>
	<updated>2026-04-08T11:26:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82645</id>
		<title>SetPedStat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82645"/>
		<updated>2025-12-22T00:14:59Z</updated>

		<summary type="html">&lt;p&gt;Danilo: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Shared function}}&lt;br /&gt;
{{Needs_Checking|&lt;br /&gt;
*Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to set the value of a specific statistic for a [[ped]]. '''Visual stats (FAT and BODY_MUSCLE) can only be used on the CJ skin''', they have no effect on other skins. When this function is used client-side, it can only be used on client-side created peds.&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 setPedStat ( ped thePed, int stat, float value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed''': the [[ped]] whose statistic you want to modify.&lt;br /&gt;
*'''stat''': the stat ID. &lt;br /&gt;
{{Stats}}&lt;br /&gt;
&lt;br /&gt;
*'''value''': the new value of the stat. It must be between 0 and 1000.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the statistic was changed succesfully. Returns ''false'' if an invalid player is specified, if the stat ID/value is out of acceptable range or if the FAT or BODY_MUSCLE stats are used on non-CJ players.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example allows a player to type the command 'beefcake' to change his player's BODY_MUSCLE stat (#23) to the maximum value of 1000. This will result in him looking really muscular.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function changeBodyStrength(thePlayer, commandName)&lt;br /&gt;
    -- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT     &lt;br /&gt;
    if setPedStat(thePlayer, 23, 1000) then&lt;br /&gt;
    	outputChatBox(&amp;quot;Your player looks really muscular&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Failed to make your player look muscular.&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;beefcake&amp;quot;, changeBodyStrength)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example adds a ''/upgradeskills'' command to give the player who types it the maximum skill with every weapon and maximum health.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
Skills to upgrade:&lt;br /&gt;
&lt;br /&gt;
24 = Max Player Health&lt;br /&gt;
69 = Weapon Type Pistol Skill&lt;br /&gt;
70 = Weapon Type Pistol Silenced Skill&lt;br /&gt;
71 = Weapon Type Desert Eagle Skill&lt;br /&gt;
72 = Weapon Type Shotgun Skill&lt;br /&gt;
73 = Weapon Type Sawn off Shotgun Skill&lt;br /&gt;
74 = Weapon Type Spas 12 Shotgun Skill&lt;br /&gt;
76 = Weapon Type MP5 Skill&lt;br /&gt;
77 = Weapon Type AK47 Skill&lt;br /&gt;
78 = Weapon Type M4 Skill&lt;br /&gt;
79 = Weapon Type Sniper Rifle Skill&lt;br /&gt;
&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;upgradeskills&amp;quot;, function(thePlayer)&lt;br /&gt;
    -- Set every stat to 1000 (the maximum value)&lt;br /&gt;
    for _, stat in ipairs({24, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79}) do&lt;br /&gt;
        setPedStat(thePlayer, stat, 1000)&lt;br /&gt;
        outputChatBox(&amp;quot;Your game stats upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    end&lt;br /&gt;
    -- Set player health to the maximum, as changing the stat keeps the current one&lt;br /&gt;
    if (isPedDead(thePlayer) ~= true) then&lt;br /&gt;
        setElementHealth(thePlayer, 200)&lt;br /&gt;
        -- Tell the player what we did&lt;br /&gt;
        outputChatBox(&amp;quot;And your health upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Your health can't be restored because you are already dead!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[ru:setPedStat]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82644</id>
		<title>SetPedStat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82644"/>
		<updated>2025-12-22T00:14:14Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Shared function}}&lt;br /&gt;
{{Needs_Checking|&lt;br /&gt;
*Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to set the value of a specific statistic for a [[ped]]. '''Visual stats (FAT and BODY_MUSCLE) can only be used on the CJ skin''', they have no effect on other skins. When this function is used client-side, it can only be used on client-side created peds.&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 setPedStat ( ped thePed, int stat, float value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed''': the [[ped]] whose statistic you want to modify.&lt;br /&gt;
*'''stat''': the stat ID. &lt;br /&gt;
{{Stats}}&lt;br /&gt;
&lt;br /&gt;
*'''value''': the new value of the stat. It must be between 0 and 1000.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the statistic was changed succesfully. Returns ''false'' if an invalid player is specified, if the stat ID/value is out of acceptable range or if the FAT or BODY_MUSCLE stats are used on non-CJ players.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example allows a player to type the command 'beefcake' to change his player's BODY_MUSCLE stat (#23) to the maximum value of 1000. This will result in him looking really muscular.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function changeBodyStrength(thePlayer, commandName)&lt;br /&gt;
    -- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT     &lt;br /&gt;
    if setPedStat(thePlayer, 23, 1000) then&lt;br /&gt;
    	outputChatBox(&amp;quot;Your player looks really muscular&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Failed to make your player look muscular.&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;beefcake&amp;quot;, changeBodyStrength)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example adds a ''/upgradeskills'' command to give the player who types it the maximum skill with every weapon and maximum health.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
Skills to upgrade:&lt;br /&gt;
&lt;br /&gt;
24 = Max Player Health&lt;br /&gt;
69 = Weapon Type Pistol Skill&lt;br /&gt;
70 = Weapon Type Pistol Silenced Skill&lt;br /&gt;
71 = Weapon Type Desert Eagle Skill&lt;br /&gt;
72 = Weapon Type Shotgun Skill&lt;br /&gt;
73 = Weapon Type Sawn off Shotgun Skill&lt;br /&gt;
74 = Weapon Type Spas 12 Shotgun Skill&lt;br /&gt;
76 = Weapon Type MP5 Skill&lt;br /&gt;
77 = Weapon Type AK47 Skill&lt;br /&gt;
78 = Weapon Type M4 Skill&lt;br /&gt;
79 = Weapon Type Sniper Rifle Skill&lt;br /&gt;
&lt;br /&gt;
--]] addCommandHandler(&amp;quot;upgradeskills&amp;quot;, function(thePlayer)&lt;br /&gt;
    -- Set every stat to 1000 (the maximum value)&lt;br /&gt;
    for _, stat in ipairs({24, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79}) do&lt;br /&gt;
        setPedStat(thePlayer, stat, 1000)&lt;br /&gt;
        outputChatBox(&amp;quot;Your game stats upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    end&lt;br /&gt;
    -- Set player health to the maximum, as changing the stat keeps the current one&lt;br /&gt;
    if (isPedDead(thePlayer) ~= true) then&lt;br /&gt;
        setElementHealth(thePlayer, 200)&lt;br /&gt;
        -- Tell the player what we did&lt;br /&gt;
        outputChatBox(&amp;quot;And your health upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Your health can't be restored because you are already dead!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[ru:setPedStat]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82643</id>
		<title>SetPedStat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedStat&amp;diff=82643"/>
		<updated>2025-12-22T00:06:00Z</updated>

		<summary type="html">&lt;p&gt;Danilo: fix example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Shared function}}&lt;br /&gt;
{{Needs_Checking|&lt;br /&gt;
*Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allows you to set the value of a specific statistic for a [[ped]]. '''Visual stats (FAT and BODY_MUSCLE) can only be used on the CJ skin''', they have no effect on other skins. When this function is used client-side, it can only be used on client-side created peds.&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 setPedStat ( ped thePed, int stat, float value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed''': the [[ped]] whose statistic you want to modify.&lt;br /&gt;
*'''stat''': the stat ID. &lt;br /&gt;
{{Stats}}&lt;br /&gt;
&lt;br /&gt;
*'''value''': the new value of the stat. It must be between 0 and 1000.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the statistic was changed succesfully. Returns ''false'' if an invalid player is specified, if the stat ID/value is out of acceptable range or if the FAT or BODY_MUSCLE stats are used on non-CJ players.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example allows a player to type the command 'beefcake' to change his player's BODY_MUSCLE stat (#23) to the maximum value of 1000. This will result in him looking really muscular.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function changeBodyStrength(thePlayer, commandName)&lt;br /&gt;
    -- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT     &lt;br /&gt;
    if setPedStat(thePlayer, 23, 1000) then&lt;br /&gt;
    	outputChatBox(&amp;quot;Your player looks really muscular&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Failed to make your player look muscular.&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;beefcake&amp;quot;, changeBodyStrength)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example adds a ''/upgradeskills'' command to give the player who types it the maximum skill with every weapon and maximum health.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
Skills to upgrade:&lt;br /&gt;
&lt;br /&gt;
24 = Max Player Health&lt;br /&gt;
69 = Weapon Type Pistol Skill&lt;br /&gt;
70 = Weapon Type Pistol Silenced Skill&lt;br /&gt;
71 = Weapon Type Desert Eagle Skill&lt;br /&gt;
72 = Weapon Type Shotgun Skill&lt;br /&gt;
73 = Weapon Type Sawn off Shotgun Skill&lt;br /&gt;
74 = Weapon Type Spas 12 Shotgun Skill&lt;br /&gt;
76 = Weapon Type MP5 Skill&lt;br /&gt;
77 = Weapon Type AK47 Skill&lt;br /&gt;
78 = Weapon Type M4 Skill&lt;br /&gt;
79 = Weapon Type Sniper Rifle Skill&lt;br /&gt;
&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;upgradeskills&amp;quot;, function(thePlayer)&lt;br /&gt;
	-- Set every stat to 1000 (the maximum value)&lt;br /&gt;
	for _, stat in ipairs({ 24, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79 }) do&lt;br /&gt;
		setPedStat(thePlayer, stat, 1000)&lt;br /&gt;
		outputChatBox(&amp;quot;Your game stats upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
	end&lt;br /&gt;
	-- Set player health to the maximum, as changing the stat keeps the current one&lt;br /&gt;
	if (isPedDead (thePlayer) ~= true) then&lt;br /&gt;
		setElementHealth(thePlayer, 200)&lt;br /&gt;
		-- Tell the player what we did&lt;br /&gt;
		outputChatBox(&amp;quot;And your health upgraded to maximum!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox(&amp;quot;Your health can't be restored because you are already dead!&amp;quot;, thePlayer, 0, 255, 0, false)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[ru:setPedStat]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Byte2human&amp;diff=82488</id>
		<title>Byte2human</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Byte2human&amp;diff=82488"/>
		<updated>2025-09-23T03:17:07Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Useful Function}}&lt;br /&gt;
This function lets you transform a number of bytes into a human readable unit.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string byte2human ( int bytes )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bytes:''' The value which you want to get the human readable version.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string which shows the number transformed into a human-friendly string.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server/Client-Side Script&amp;quot; class=&amp;quot;both&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;
function byte2human(bytes, si)&lt;br /&gt;
	local threshold = si and 1000 or 1024&lt;br /&gt;
	if (math.abs(bytes) &amp;lt; threshold) then&lt;br /&gt;
		return bytes .. &amp;quot; B&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local units = &lt;br /&gt;
	si and {&amp;quot;KB&amp;quot;, &amp;quot;MB&amp;quot;, &amp;quot;GB&amp;quot;, &amp;quot;TB&amp;quot;, &amp;quot;PB&amp;quot;, &amp;quot;EB&amp;quot;, &amp;quot;ZB&amp;quot;, &amp;quot;YB&amp;quot;}&lt;br /&gt;
	    or {&amp;quot;KiB&amp;quot;, &amp;quot;MiB&amp;quot;, &amp;quot;GiB&amp;quot;, &amp;quot;TiB&amp;quot;, &amp;quot;PiB&amp;quot;, &amp;quot;EiB&amp;quot;, &amp;quot;ZiB&amp;quot;, &amp;quot;YiB&amp;quot;}&lt;br /&gt;
	local unitIndex = 0&lt;br /&gt;
	repeat&lt;br /&gt;
		bytes = bytes / threshold&lt;br /&gt;
		unitIndex = unitIndex + 1&lt;br /&gt;
	until not (math.abs(bytes) &amp;gt;= threshold and unitIndex &amp;lt; #units)&lt;br /&gt;
	return math.round(bytes, 2) .. &amp;quot; &amp;quot; .. units[unitIndex]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function math.round(num, decimals)&lt;br /&gt;
    decimals = math.pow(10, decimals or 0)&lt;br /&gt;
    num = num * decimals&lt;br /&gt;
    if num &amp;gt;= 0 then num = math.floor(num + 0.5) else num = math.ceil(num - 0.5) end&lt;br /&gt;
    return num / decimals&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;
'''Author: Renkon'''&lt;br /&gt;
(based on http://stackoverflow.com/a/14919494/2980812)&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineImageGetFiles&amp;diff=82472</id>
		<title>EngineImageGetFiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineImageGetFiles&amp;diff=82472"/>
		<updated>2025-09-15T02:39:05Z</updated>

		<summary type="html">&lt;p&gt;Danilo: fix example&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 gets the list of files from an IMG container.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table engineImageGetFiles ( img imgArchive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[img]]:getFiles|files}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''imgArchive''': The [[IMG]] file handler you want to get files from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns array table with files in the [[IMG]] element if successfull, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local img = engineLoadIMG( &amp;quot;file.img&amp;quot; )&lt;br /&gt;
local filesInArchive = engineImageGetFiles( img )&lt;br /&gt;
&lt;br /&gt;
outputChatBox(&amp;quot;'file.img' contains files:&amp;quot;)&lt;br /&gt;
for fileId = 1, #filesInArchive do&lt;br /&gt;
    outputChatBox(fileId .. &amp;quot;: &amp;quot; .. filesInArchive[fileId])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=78621</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=78621"/>
		<updated>2023-11-23T03:22:26Z</updated>

		<summary type="html">&lt;p&gt;Danilo: move to table functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=== Table functions ===&lt;br /&gt;
*[[addTableChangeHandler]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function monitors the changes of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getKeyFromValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the key of the specified value in a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTableFromSql]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isValueInTable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns true if the value exists in the table, false if the value does not exist in the table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[pairsByKeys]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sort pairs table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[rangeToTable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a string range to a table containing number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableToSql]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is used to save the table in the database (sql).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Sort_Functions]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» These functions are able to sort your tables by a key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.compare]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether two given tables are equal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.deepmerge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function deep merges two tables. Every nested table will be correspondingly merged.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.element]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a new table with only userdata content.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.flip]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the table from the last value to the first value, such as reflection.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.fromString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts string to a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.getRandomRows]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns random rows from table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.merge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function merges two or more tables together.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.removeValue]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function removes a specified value from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ACL functions ===&lt;br /&gt;
*[[aclGroupClone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function clone a group to another group with/without ACLs and/or objects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerAcls]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all ACL groups on a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInACLGroup]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns all players in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInACL]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player element is in an ACL group.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[renameAclGroup]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gives an existing ACL group a new name.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Account functions ===&lt;br /&gt;
*[[getPlayerFromAccountName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is used to obtain a player by the name of his account.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Camera functions ===&lt;br /&gt;
*[[smoothMoveCamera]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to create a cinematic camera flight.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Colshape functions ===&lt;br /&gt;
*[[createGarageColShape]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a collision shape from the specified garage.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cursor functions ===&lt;br /&gt;
*[[getCursorMovedOn]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setCursorCenteredOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This functions will center the cursor inside a rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drawing functions ===&lt;br /&gt;
*[[dxDrawAnimWindow]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws an animated 2D window on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawBorderedText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a bordered text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawDashedLine]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a line with dashes.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawEditbox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a edit box across the screen - rendered for one frame. This should be used in conjunction with '''onClientRender''' in order to display continuously.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites in 2D.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImageOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws an image on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLinedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a rectangle outline with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawLoading]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a loading bar on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawOctagon3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a 3D Octagon&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a custom polygon on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawProgressBar]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function simulates a progress bar drawed using DirectDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle in GTA world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangleOnPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle above the player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a ring with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRombo]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a Rhombus.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawSprite]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draw a sprite in the 3D world.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function draws a text on any element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTextOnRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Esta funcion crea un rectangle con un texto dentro.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawTriangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a triangle with dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxFade]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function fade-in or fade-out any dxDraw by gradually changing its alpha value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the font size from given height.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetRealFontHeight]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the height of a font.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenStartPositionFromBox]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function helps with getting the correct position for your dx-effects.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wordWrap]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[CreateRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is a function that will create a 3d rectangle on the player screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[DxDrawBordered3DLine]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;»This function creates a bordered area with 3D dx lines.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Effects functions ===&lt;br /&gt;
*[[attachEffect]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you attach an effect to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setScreenFlash]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make the screen flash(like a screenshot).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Element functions === &lt;br /&gt;
*[[autoAttach]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function attaches one element into another at the same position and rotation they are.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[attachElementToBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to attach an element to ped bone accurately using new bone functions.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementDirectionCardialPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the direction of the element according to the ''wind rose''.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the specified element's speed in m/s, km/h or mph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementUsingData]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns table elements that contains the elements data with the given key and value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementZoneFullName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to retrieve the zone full name of a element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsInDimension]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are in the specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementsWithinMarker]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of elements that are within a marker's collision shape.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getNearestElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the nearest element (of a specific type) to a player.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInAir]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in air or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is in the player's camera picture area.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if an element's range to a main point is within the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementMoving]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementPlayer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether the element is a player or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementWithinAColShape]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element is within a collision shape element.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set the speed of an element in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPositionInFrontOfElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns position in provided distance away from element, including element's rotation.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
*[[onClientPlayerTimeChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player's real time change.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onPlayerZoneChange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when the player enters a new area on the map.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Input functions ===&lt;br /&gt;
*[[bindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBoundControls]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of control names that are bound to the specified key.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[unbindControlKeys]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCommandHandlerAdded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check if a command is added or not in the respective resource.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Data functions === &lt;br /&gt;
*[[byte2human]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts an integer (number of bytes) into a human-readable unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[capitalize]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function capitalizes a given string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertDate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts date to another look.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertServerTickToTimeStamp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts server ticks to a unix timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[convertTextToSpeech]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts the provided text to a speech in the provided language which players can hear.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation3D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[formatDate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[formatNumber]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function formats large numbers by adding commas.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateRandomASCIIString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a random string which uses ASCII characters. &amp;lt;/span&amp;gt;&lt;br /&gt;
*[[generateString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function generates a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a given birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenElements]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns the distance between two elements.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getEasterDate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns easter date monthday and month for a given year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementRelatedAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the related angle between one element to another. This is useful to check which side an element is to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getFreeDimension]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function get free dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRealMonth]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the current month name&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRGColorFromPercentage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia', sans-serif; font-size:smaller;&amp;quot;&amp;gt;»This function returns two integers representing red and green colors according to the specified percentage.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getScreenRotationFromWorldPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a screen relative rotation to a world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the UNIX timestamp of a specified date and time.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[gradientString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function transforms a string in a new coloured gradient string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hex2rgb]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex to rgb.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[hexColorToRGB]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert hex string/number to RGBA values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a boolean representing if a given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isValidMail]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a provided e-mail string is valid.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[removeHex]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is used to remove hexadecimal numbers (colors, for example) from strings.&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHSV]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to HSV color space.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToDecimal]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert RGB to Decimal color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[secondsToTimeDesc]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a plain seconds-integer into a user-friendly time description.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function counts the amount of occurences of a string in a string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.insert]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function inserts a string within another string at a given position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[splitMultiple]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function improves the split function so that multiple characters can be used as the split at character.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[tocolor2rgba]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function convert tocolor to rgba.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[wavelengthToRGBA]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a physical wavelength of light to a RGBA color.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GUI functions === &lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function centers a CEGUI window element responsively in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiMoveElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function moves guiElement by/like using moveObject.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiSetStaticImageMovable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to move a static image like a gui window.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGUICloseButton]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseOnGuiElement]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether or not your mouse is over a specific gui element, this is especially useful if the gui element has a parent. &amp;lt;/span&amp;gt;&lt;br /&gt;
=====Comboboxes=====&lt;br /&gt;
*[[guiComboBoxAdjustHeight]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function adjusts a CEGUI combobox element to have the correct height.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Gridlists=====&lt;br /&gt;
*[[convertGridListToText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts grid list contents to text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGridListRowIndexFromText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the GridList row index from the specified text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListAddPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function add all online players to a grid list.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetColumnIDFromTitle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a gridlist's column ID from the column title.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListGetSelectedText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string containing the inner text of a selected gridlist item.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[guiGridListSetColumnNonSortable]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function makes a gridlist column become non-sortable.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isTextInGridList]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if some text exist or not in the GridList.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Labels=====&lt;br /&gt;
*[[guiLabelAddEffect]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function add an effects to the gui-label like (shadow, outline).&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Marker functions ===&lt;br /&gt;
*[[createMarkerAttachedTo]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a marker that is attached to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Math functions ===&lt;br /&gt;
*[[math.clamp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number between range of numbers or it's minimum or maximum.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.getBezierPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get N-th order bezier point.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.hypot]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the Hypotenuse of the triangle given by sides x and y.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.isPointInPolygon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Check if point is inside polygon or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.lerp]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Get val between two integer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.percent]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a percentage from two number values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.polygonArea]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Compute area of any polygon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.randomDiff]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Generates a pseudo-random integer that's always different from the last random number generated.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.rotVecToEulerAngle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Rotation Vector To Euler Angle&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[mathNumber]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is a workaround for the client-side floating-point precision of 24-bits.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[reMap]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Re-maps a number from one range to another.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Math.percentProgress|math.percentProgress]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Returns a percentage progress from two specific values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.average]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the simple arithmetic mean of multiple numbers.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Map functions ===&lt;br /&gt;
*[[assignLod]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function lets you conveniently generate and apply a LOD model to a mapping object.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getWorldPositionFromMapPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts an F11 map position to world position.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ped functions ===&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getGuestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a players not login or players Guest .&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all logged-in administrators.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedEyesPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds eyes position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedGender]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get peds their gender.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxHealth]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a pedestrians's maximum health by converting it from their maximum health stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedMaxOxygenLevel]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedWeaponSkill]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a ped's corresponding weapon skill level name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPedHitBone]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the approximate number of the bone where the ped is hit.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from partial name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromSerial]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a player from their serial.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersByData]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of players that have the specified data name.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all players in photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInVehicles]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the players insides vehicles from a specified dimension.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAiming]]&amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a pedestrian is aiming their weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedAimingNearPed]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This is similar to isPedAiming but uses a colshape to be more precise.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDiving]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This feature checks that pedestrian is diving in the water.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedDrivingVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified pedestrian is driving a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPedNearbyWall]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if player/ped is nearby a objects like buildings or walls.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is in a specified team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setPedAttack]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped attack a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setPedFollow]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will make a ped follow a specified target.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function will get the player name from the ID element data.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player functions ===&lt;br /&gt;
*[[countPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the number of players that are within a certain range of the specified coordinates.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerPreviousAndNextWeapon]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the player previous and next weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInRange]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function make a table of players within certain range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerActuallyInVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a player is actually in a vehicle instead of just in the process of entering.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerHitByVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function cancels event when a element is hit by a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&lt;br /&gt;
*[[getFilesInResourceFolder]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a list of files that are inside a folder of a resource.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceScripts]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource scripts.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSize]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the size of a specified resource in kB(kilobyte)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[refreshResource]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function refreshes your resource if you changed any of the files&lt;br /&gt;
*[[setResourcePriority]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function set resource download priority group.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound functions ===&lt;br /&gt;
*[[isSoundFinished]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element has finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isSoundPlaying]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a sound element is playing or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[stopSoundSlowly]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function stop your sound element slowly.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser functions ===&lt;br /&gt;
*[[playVideo]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function plays a video on the screen.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Team functions ===&lt;br /&gt;
*[[getTeamFromColor]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element by the specified color.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTeamWithFewestPlayers]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a team element with least players of all the specified teams.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle functions ===&lt;br /&gt;
*[[findEmptyCarSeat]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds you the first empty seat in a vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getNearestVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the nearest vehicle to the specified player in a specified distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getRandomVehicle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a random vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getValidVehicleModels]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of all valid vehicle models.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehiclesCountByType]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the amount of vehicles by the given type as an integer value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getVehicleTurnVelocityCenterOfMass]]&amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleDoubleExhaust]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is exhaust vehicle double.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleEmpty]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a vehicle is empty.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOccupied]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is occupied.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnFire]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the vehicle is on fire or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleReversing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a specified vehicle is moving backwards.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleUpgraded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks is vehicle upgraded by upgrade ID.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleTurnVelocityCenterOfMass]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleHandlingFromText]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function sets a vehicle's handling from text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleWheelModel]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function changes the wheel model of the informed vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Weapon functions === &lt;br /&gt;
*[[getJetpackWeaponsEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of enabled weapons usable on a jetpack.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Object functions ===&lt;br /&gt;
*[[getDynamicDoorObjectOpenRatio]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you how open a dynamic door is in a range from 0 to 1.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementObject]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function tells you if an element is an object or no.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XML functions ===&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns all children of a XML node.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Engine functions ===&lt;br /&gt;
*[[engineGetCOLsFromLibrary]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets the collision data from the col library.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[engineLoadIMGContainer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function loads the IMG container.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Utility ===&lt;br /&gt;
*[[animate]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use interpolateBetween without render event and easily used.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any client-side function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[check]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if its arguments are of the right type and calls the error-function if one is not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[checkPassiveTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to use passive timers in your conditions. For example you want to prevent players repeatedly using a command.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function applies a fix for hidden coroutine error messages.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[compact]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function create table containing variables and their values.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[fingerprint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function calculates a fingerprint unique to each computer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanFromName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This functions returns the ban of the given playername.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCurrentFPS]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the frames per second at which GTA: SA is running.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getSkinNameFromID]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the skin from the given id.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isCharInString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This shared function allows you to check if a char specified is in a string value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLastExecuteInTimer]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function check if the execute is the last execute in the timer.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInCircle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a cursor position is in circular area or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isMouseInPosition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns ''a time-saving'' iterator for your for-loops.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[PlotTrajectoryAtTime]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» Calculate projectile/water trajectory.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[preprocessor]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function allow you to use gcc macros.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[vector3:compare]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This method checks whether two vectors match, with optional precision.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[svgCreateRoundedRectangle]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a rectangle with rounded edges.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[debounce]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function is removing unwanted input noise.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDir&amp;diff=78580</id>
		<title>Modules/FileSystem/translator/scanDir</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDir&amp;diff=78580"/>
		<updated>2023-11-14T21:28:04Z</updated>

		<summary type="html">&lt;p&gt;Danilo: fix code example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function loops through all translator filesystem entries that are captured by the wildcard and the directory specifier. The wildcard is glob-style and supports '''*''' and '''?''' modifiers. The scan can be made recursive to enter every directory it finds, so that files and folders of a whole directory tree are captured. This function is used to process filesystem objects inside of directories without having to add the filenames into a configuration file. This greatly increases flexibility when processing files. Other than [[MTA:Eir/FileSystem/translator/scanDirEx|scanDirEx]], this function returns a table of directories and files.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table translator:scanDir ( string dirPath, string wildcard, bool recursive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to the directory the scan shall take place or start in&lt;br /&gt;
*'''wildcard:''' glob-style wild-card for filename matching; every filename that matches the wild-card is returned&lt;br /&gt;
*'''recursive:''' a boolean that specifies whether the whole directory tree at dirPath should be included into the scan&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a table consisting of all directories and all matching file entries which were found during the scan. It returns '''false''' if '''dirPath''' is an invalid path specifier for the translator.&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;
This snippet outputs the count of directories and files in a specified directory relative to the resource instance root.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Attempt to get a handle to the FileSystem module namespace.&lt;br /&gt;
local fsys = createFilesystemInterface();&lt;br /&gt;
&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fsys.createTranslator( &amp;quot;mods/deathmatch/resources/&amp;quot; .. getResourceName(resource) .. &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Function that returns whether the given path is a directory path.&lt;br /&gt;
local function isDirectoryPath( path )&lt;br /&gt;
   local lastChar = string.sub( path, #path, #path );&lt;br /&gt;
&lt;br /&gt;
   return ( lastChar == &amp;quot;/&amp;quot; ) or ( lastChar == &amp;quot;\\&amp;quot; );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getFilesystemObjectCounts( path )&lt;br /&gt;
    local fileCount = 0;&lt;br /&gt;
    local dirCount = 0;&lt;br /&gt;
&lt;br /&gt;
    -- Get a list of all fs objects.&lt;br /&gt;
    local fsObjects =&lt;br /&gt;
        resRoot:scanDir(&lt;br /&gt;
            path, -- scan anywhere the script wants us to&lt;br /&gt;
            &amp;quot;*&amp;quot;, -- include all files&lt;br /&gt;
            false -- scan the specified directory only&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    -- Loop through all object names to set up the counts.&lt;br /&gt;
    -- An object can either be a directory or a file.&lt;br /&gt;
    for m,n in ipairs(fsObjects) do&lt;br /&gt;
        if ( isDirectoryPath( n ) ) then&lt;br /&gt;
            dirCount = dirCount + 1;&lt;br /&gt;
        else&lt;br /&gt;
            fileCount = fileCount + 1;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Return the counts.&lt;br /&gt;
    return fileCount, dirCount;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Output the filesystem object counts for the resource instance root.&lt;br /&gt;
local fileCount, dirCount = getFilesystemObjectCounts( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;found &amp;quot; .. fileCount .. &amp;quot; files and &amp;quot; .. dirCount .. &amp;quot; directories in the resource folder root.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=78519</id>
		<title>IsVehicleOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=78519"/>
		<updated>2023-11-02T21:28:34Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the vehicle is on fire.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleOnFire(vehicle theVehicle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''vehicle''': vehicle element.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&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;
function isVehicleOnFire(elementVehicle)&lt;br /&gt;
    if elementVehicle and getElementType(elementVehicle) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local vHealth = getElementHealth(elementVehicle)&lt;br /&gt;
        return vHealth &amp;lt; 250&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:IsPlayerACLAdmin&amp;diff=77163</id>
		<title>Talk:IsPlayerACLAdmin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:IsPlayerACLAdmin&amp;diff=77163"/>
		<updated>2023-07-11T18:47:03Z</updated>

		<summary type="html">&lt;p&gt;Danilo: Created page with &amp;quot;isPlayerInACL Is enough for ACL groups checks. Adding too specific functions is not what we want.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[isPlayerInACL]] Is enough for ACL groups checks. Adding too specific functions is not what we want.&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Famous_crash_offsets_and_their_meaning&amp;diff=76059</id>
		<title>Famous crash offsets and their meaning</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Famous_crash_offsets_and_their_meaning&amp;diff=76059"/>
		<updated>2023-01-28T01:28:33Z</updated>

		<summary type="html">&lt;p&gt;Danilo: /* Resolving crashes related to custom models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;This wiki page contains the reason for many well-known MTA crashes that you may experience. Use CTRL + F and search for your Crash Offset to find the relevant entry.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example crash dialog info:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
Version = 1.5.6-release-14664.0.000&lt;br /&gt;
Time = Mon Oct  8 12:20:00 2018&lt;br /&gt;
Module = C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gta_sa.exe&lt;br /&gt;
Code = 0xC0000005&lt;br /&gt;
Offset = 0x003C91CC&lt;br /&gt;
&lt;br /&gt;
EAX=0F77A3C8  EBX=0F77A3B8  ECX=0177FAA0  EDX=00139700  ESI=00000000&lt;br /&gt;
EDI=00000001  EBP=0177FC50  ESP=0177FA80  EIP=007C91CC  FLG=00210202&lt;br /&gt;
CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: always use the &amp;quot;Offset&amp;quot; value from the crash dialog to identify your crash and match it up with those listed on this wiki page)&lt;br /&gt;
&lt;br /&gt;
'''Most MTA crashes are caused by something that the user is able to resolve because it depends on their system, choice of server or game mods.'''&lt;br /&gt;
This page seeks to be helpful for the aforementioned reason; you'll know where to look for when you get a certain type of crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For further advice on resolving issues, scroll down to the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
==Module = gta_sa.exe or proxy_sa.exe==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Offset(s)&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00134134&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model or corrupted GTA3.img. Use unmodded GTA install to check, or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
Note for server owners and modellers: if you open the crash dump (.dmp) as text with notepad and search for keyword `CEntity_GetBoundRect - No collision for model` you can often identify the bad model ID.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00348CF4&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Caused by s0beit d3d9.dll&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003F0C37&lt;br /&gt;
0x003F0BF7&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad vehicle model. Use unmodded GTA install to check, or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003C91CC&lt;br /&gt;
0x003C920C&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of video memory. This can happen on servers with unoptimized mods and (faulty) scripts that abuse video memory, or even when you have a powerful graphics card in case the stuff on a server is extremely unoptimized so that it starts hitting GTA limits. If you have a powerful graphics card and more players suffer from this crash type, inform the server owner of this problem as it probably means their scripters &amp;amp; designers don't know what they are doing. More information is available at these forum links: [https://forum.mtasa.com/topic/85094-mta-crashing/ here] and [https://forum.mtasa.com/topic/127677-c-r-a-s-h-i-n-g/ here (example case)]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00357DEC&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of video memory (probably).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x003F5A3A&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Memory crash, usually happens on heavily unoptimized servers. It can be a result of either out of video memory or reaching technical limits of RAM usage, but more often a combination of both.. hence it's put as &amp;quot;heavily unoptimized servers&amp;quot;. Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x004A1ED4&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x011630F8&lt;br /&gt;
0x011630FE&lt;br /&gt;
0x01162FE3&lt;br /&gt;
0x011630F2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|This crash is a result of problems with collision models. It might be due to unoptimized collisions that your PC (or MTA's technical limits, due to bad server mods) cannot handle, or due to corrupt collision models. We still don't know a lot about all of the circumstances related to this crash. Our first advise would be to ensure that your GTA is unmodded, and otherwise to ask server owner to identify and resolve issues with bad/unoptimized collision models.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00137D6E&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of system memory (RAM). This co-incides with loading collisions; the risk to get this crash is high when joining a mod-heavy server with a weak PC and small amount of memory.&lt;br /&gt;
To resolve this crash, mind the servers you're playing on (optimization) or get a faster PC. Sub-type of &amp;quot;Running out of memory&amp;quot;: most often a direct result of running out of address space, so upgrading to 64-bit Windows installation might solve it&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x0014F406&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Possibly &amp;quot;Running out of memory&amp;quot;: a direct result of running out of address space, so upgrading to 64-bit Windows installation might solve it.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00171A10&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000C9F98&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Possibly bad skin model or texture (clothes mods for multi-clump skins such as CJ). &lt;br /&gt;
Use unmodded GTA install to check or incase of server mods, ask server owner to identify and disable mods on such skins, or any resource manipulating clothes or ped accesoires.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00349B7B&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad skin model. Use unmodded GTA install to check or incase of server mods, ask server owner to identify and replace the corrupt skin mod.&lt;br /&gt;
Information for modellers &amp;amp; server owners: corruption in the anim hierarchy in ped's skin DFF or bones configuration&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00165096&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model (containing a corrupt collision model). Use unmodded GTA install to check or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
Information for modellers &amp;amp; server owners: corruption in one or multiple col spheres (or their radius) within the DFF model.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x001D6E6A&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Either out of video memory, or bad model/texture.&lt;br /&gt;
Information for modellers &amp;amp; server owners: in case the culprit is a model, then corruption is in &amp;quot;prelit&amp;quot; (Night colors) structure of the model. Ask your modeller to recreate prelit data.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x000DFE92&lt;br /&gt;
0x000DFF90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad sound mods or faulty audio driver/device. Use unmodded GTA install to check, or update your audio drivers.&lt;br /&gt;
The problem is often known to be entirely missing or emptied/corrupted audio files (such as in \Rockstar Games\GTA San Andreas\audio &amp;gt; SFX or other subfolder), so you may alternatively be able to restore a targeted backup.&lt;br /&gt;
&lt;br /&gt;
Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000CFCD6&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Allocation failure as a result of (re-)connecting to servers after a lengthy playing session on a server with bad practise in their scripts (abusing RAM and anim functions).&lt;br /&gt;
This crash may be 'fixed' (averted) by MTA in future, we're working on it! It's related to anims in memory and clearing them.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x00771848&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash because of issue with GTA data files (MTA fails to open them which could mean they are corrupted/modded &amp;amp; incompatible or missing)&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x001B6B2F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash because of issue with DATA\DEFAULT.DAT or DATA\CARCOLS.DAT file in your GTA installation folder (may be missing or modded/corrupted).&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003EC9DA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash possibly because of issue with ANIM\PED.IFP file in your GTA installation folder (may be missing or modded/corrupted).&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003F18CF&lt;br /&gt;
0x003F190F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model. Use unmodded GTA install to check or in case of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
This crash has been averted (fixed by MTA), but due to technical limitations will still occur for Windows XP users.&amp;lt;br/&amp;gt;&lt;br /&gt;
Information for modellers &amp;amp; server owners: due to the nature of corruption, the model introduces a risk to crash, it could happen at any given moment while nearby.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x0019BD39&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model. Use unmodded GTA install to check or in case of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
This crash usually occurs when you fire a weapon while the corrupt model is streamed in (physically nearby).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x000C9691&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad or missing vehicle model. This usually happens when you deleted a model from your GTA3.img without restoring the original or putting another model in its place. Or when the DFF isn't a valid model file at all.&lt;br /&gt;
Restore GTA3.img or use unmodded GTA install to check, and if that doesn't work then ask server owner to identify and replace the corrupt mod, since it can also still be a bad model (or a dodgy script, that, tell them this: deals with vehicle types, variants, upgrades etc, in an improper way)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x0000F67C&lt;br /&gt;
0x0000F663&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Custom models which are not working with volumetric shadows. Fix models or disable volumetric shadows in Settings-&amp;gt;Video.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00423FD0&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad GTA mods or corrupted GTA3.img. Re-install GTA (with a clean and original version) to solve this crash. Note: known crash for common pirated copies &amp;amp; torrents of GTA, due to missing, bad or corrupted .dat, .col and .ipl files (pre-installed mods). MTA only supports the original, legally purchased version of GTA.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000A2CF3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Corrupted, missing or modded GTA San Andreas\models &amp;gt; '''effects.fxp''' file. If restoring that file to original doesn't fix the crash, use unmodded GTA as it can also be due to related GTA data files (ones that have to do with effects).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x001A49D4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad mod (custom player.img in GTA San Andreas\models). Restore player.img to original or use unmodded GTA.&lt;br /&gt;
Note: this crash can also be triggered when a player with CJ model (or CJ clothes) appears on your screen, on a server you're playing on. Your custom player.img cannot handle that and will cause a crash.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Resolving out-of-memory crashes==&lt;br /&gt;
If you're experiencing crashes that, according to the table of common crashes, are related to any sort of running out of memory, then we advise you to;&lt;br /&gt;
&lt;br /&gt;
- Mind the type of servers you're playing on, especially in combination with how powerful your PC is. There's lots of bloated, mod-heavy servers out there in MTA that demand the better of your PC and may also abuse memory through inefficient scripts besides custom mods (or even with the lack thereof).&lt;br /&gt;
 &lt;br /&gt;
We could write a book about the real cause (which is that such servers have bad scripters, or those that don't know what optimization is, and that they add everything, including bloated models and textures, without reviewing it) but we won't do that here.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or older generation PC, then we advise you to avoid certain &amp;quot;fancy&amp;quot; servers with huge resource downloads and such.&lt;br /&gt;
&lt;br /&gt;
- Install 64-bits version of Windows rather than x86 (32-bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you still want to play on servers that may easily get upper hand on your system, then;'''&lt;br /&gt;
&lt;br /&gt;
- Upgrade your PC's hardware for enhanced performance; consider replacing the videocard with one suitable for gaming, or adding additional system memory (RAM). Re-installing Windows can sometimes also help a bunch if your OS in general is slow and not well-maintained. Alternatively, perform some mainentance (consult someone with tech experience, or make a start by updating drivers and running various junk cleaners &amp;amp; renowned PC performance optimization tools)&lt;br /&gt;
&lt;br /&gt;
- Follow the instructions listed at [https://forum.mtasa.com/topic/78081-32-bit-windows-crashing/ https://forum.mtasa.com/topic/78081-32-bit-windows-crashing/]&lt;br /&gt;
&lt;br /&gt;
- Remove any mods to your GTA installation (preferably re-install) because mods may take up video memory and RAM, enough to cause your high memory usage and subsequent crashes.&lt;br /&gt;
Also you should definately try lowering streaming memory, by going into Settings-&amp;gt;Advanced-&amp;gt;Streaming memory-&amp;gt; and setting it to Min.&lt;br /&gt;
&lt;br /&gt;
Remember that GTA is an old game, and MTA places a lot of power in the hands of scripters (to mess up with a lack of optimization). Even if you have a high amount of RAM (for example 8gb, 16gb) you can't expect it to all be usable.. old games have technical limits and limited address space. Server scripters can do really cool and insanely realistic stuff while using far below 3.6GB RAM (the absolute technical limit in SA), but only as long they have scripters and modellers/designers that know about optimization. Strictly taken, no server, no matter how modded or beautiful.. should need to use above 2GB of RAM. Most decent servers use between 800MB - 1.6GB anyways. If you wish to learn more about this subject or are a server owner that wants to realize their mistakes, please join the MTA discord at https://discord.gg/mtasa and go to the #general channel, then open that channel's pinned post about optimization ecosystem problems (written by Dutchman101).&lt;br /&gt;
&lt;br /&gt;
Please note that in general, '''any crash''' with exception code '''0xE06D7363''' (on an MTA module, and not gta_sa.exe like this wiki page is focussed on) is also a memory-related issue, and comes back to the memory abuse by servers and mods described above.&lt;br /&gt;
&lt;br /&gt;
==Resolving crashes related to custom models==&lt;br /&gt;
If you're experiencing crashes that, according to the table of common crashes, are related to corrupt custom models, then we advise you to re-install GTA from the original game source (DVD or Steam, so no pre-modded repacks) or restore targeted file back-ups in case you understand which (type of) model may cause the crash. &lt;br /&gt;
&lt;br /&gt;
In case you're only experiencing the crashes while playing on a certain server, there's a high chance that server is loading custom server models, and then we recommend you to contact the server owner so they can investigate and potentially identify &amp;amp; replace the corrupted model to stop the crashes. Until they take successful action, on that server you can try to avoid physically facing the mod you believe results in a crash (like not spawning said vehicle or using said skin). &lt;br /&gt;
Let us remind you of the chance that the bad model is in your GTA3.img, but by coincidence you never physically come near that model on other servers, and the server you're crashing the most on happens to force usage of that model ID upon you (like as regularly used vehicle or skin); therefore it cannot be ruled out that it's possibly still your client mod, despite you only crashing on a single server, and it's worth at least re-installing your GTA to try it out.&lt;br /&gt;
&lt;br /&gt;
If you are a server owner and wouldn't prefer letting go of your beloved (corrupt) model, then you can ask an experienced modeller to try fix the corruption by modifying/revising it.&lt;br /&gt;
The alternative of crashing many players, potentially resulting in player loss for your server, isn't fine either way. For this reason, keeping a sharp eye on trends of players reporting (or shouting) that they crashed, and following up with them to get the crash details (to try match them up to model crashes from the table on this wiki page), may be a good idea.&lt;br /&gt;
&lt;br /&gt;
Adding upgradable components (named &amp;quot;ug_upgradename&amp;quot;) outside of chassis_dummy, will cause crashes once the vehicle has the respective upgrade component spawned.&lt;br /&gt;
&lt;br /&gt;
[[ru:Famous crash offsets and their meaning]]&lt;br /&gt;
[[pt-br:Crashs famosos e seu significado ]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Famous_crash_offsets_and_their_meaning&amp;diff=76058</id>
		<title>Famous crash offsets and their meaning</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Famous_crash_offsets_and_their_meaning&amp;diff=76058"/>
		<updated>2023-01-28T01:27:27Z</updated>

		<summary type="html">&lt;p&gt;Danilo: /* Module = gta_sa.exe or proxy_sa.exe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;This wiki page contains the reason for many well-known MTA crashes that you may experience. Use CTRL + F and search for your Crash Offset to find the relevant entry.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example crash dialog info:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
Version = 1.5.6-release-14664.0.000&lt;br /&gt;
Time = Mon Oct  8 12:20:00 2018&lt;br /&gt;
Module = C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gta_sa.exe&lt;br /&gt;
Code = 0xC0000005&lt;br /&gt;
Offset = 0x003C91CC&lt;br /&gt;
&lt;br /&gt;
EAX=0F77A3C8  EBX=0F77A3B8  ECX=0177FAA0  EDX=00139700  ESI=00000000&lt;br /&gt;
EDI=00000001  EBP=0177FC50  ESP=0177FA80  EIP=007C91CC  FLG=00210202&lt;br /&gt;
CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: always use the &amp;quot;Offset&amp;quot; value from the crash dialog to identify your crash and match it up with those listed on this wiki page)&lt;br /&gt;
&lt;br /&gt;
'''Most MTA crashes are caused by something that the user is able to resolve because it depends on their system, choice of server or game mods.'''&lt;br /&gt;
This page seeks to be helpful for the aforementioned reason; you'll know where to look for when you get a certain type of crash.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For further advice on resolving issues, scroll down to the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
==Module = gta_sa.exe or proxy_sa.exe==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Offset(s)&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00134134&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model or corrupted GTA3.img. Use unmodded GTA install to check, or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
Note for server owners and modellers: if you open the crash dump (.dmp) as text with notepad and search for keyword `CEntity_GetBoundRect - No collision for model` you can often identify the bad model ID.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00348CF4&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Caused by s0beit d3d9.dll&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003F0C37&lt;br /&gt;
0x003F0BF7&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad vehicle model. Use unmodded GTA install to check, or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003C91CC&lt;br /&gt;
0x003C920C&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of video memory. This can happen on servers with unoptimized mods and (faulty) scripts that abuse video memory, or even when you have a powerful graphics card in case the stuff on a server is extremely unoptimized so that it starts hitting GTA limits. If you have a powerful graphics card and more players suffer from this crash type, inform the server owner of this problem as it probably means their scripters &amp;amp; designers don't know what they are doing. More information is available at these forum links: [https://forum.mtasa.com/topic/85094-mta-crashing/ here] and [https://forum.mtasa.com/topic/127677-c-r-a-s-h-i-n-g/ here (example case)]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00357DEC&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of video memory (probably).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x003F5A3A&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Memory crash, usually happens on heavily unoptimized servers. It can be a result of either out of video memory or reaching technical limits of RAM usage, but more often a combination of both.. hence it's put as &amp;quot;heavily unoptimized servers&amp;quot;. Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x004A1ED4&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x011630F8&lt;br /&gt;
0x011630FE&lt;br /&gt;
0x01162FE3&lt;br /&gt;
0x011630F2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|This crash is a result of problems with collision models. It might be due to unoptimized collisions that your PC (or MTA's technical limits, due to bad server mods) cannot handle, or due to corrupt collision models. We still don't know a lot about all of the circumstances related to this crash. Our first advise would be to ensure that your GTA is unmodded, and otherwise to ask server owner to identify and resolve issues with bad/unoptimized collision models.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00137D6E&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Out of system memory (RAM). This co-incides with loading collisions; the risk to get this crash is high when joining a mod-heavy server with a weak PC and small amount of memory.&lt;br /&gt;
To resolve this crash, mind the servers you're playing on (optimization) or get a faster PC. Sub-type of &amp;quot;Running out of memory&amp;quot;: most often a direct result of running out of address space, so upgrading to 64-bit Windows installation might solve it&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x0014F406&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Possibly &amp;quot;Running out of memory&amp;quot;: a direct result of running out of address space, so upgrading to 64-bit Windows installation might solve it.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00171A10&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000C9F98&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Possibly bad skin model or texture (clothes mods for multi-clump skins such as CJ). &lt;br /&gt;
Use unmodded GTA install to check or incase of server mods, ask server owner to identify and disable mods on such skins, or any resource manipulating clothes or ped accesoires.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00349B7B&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad skin model. Use unmodded GTA install to check or incase of server mods, ask server owner to identify and replace the corrupt skin mod.&lt;br /&gt;
Information for modellers &amp;amp; server owners: corruption in the anim hierarchy in ped's skin DFF or bones configuration&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00165096&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model (containing a corrupt collision model). Use unmodded GTA install to check or incase of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
Information for modellers &amp;amp; server owners: corruption in one or multiple col spheres (or their radius) within the DFF model.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x001D6E6A&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Either out of video memory, or bad model/texture.&lt;br /&gt;
Information for modellers &amp;amp; server owners: in case the culprit is a model, then corruption is in &amp;quot;prelit&amp;quot; (Night colors) structure of the model. Ask your modeller to recreate prelit data.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x000DFE92&lt;br /&gt;
0x000DFF90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad sound mods or faulty audio driver/device. Use unmodded GTA install to check, or update your audio drivers.&lt;br /&gt;
The problem is often known to be entirely missing or emptied/corrupted audio files (such as in \Rockstar Games\GTA San Andreas\audio &amp;gt; SFX or other subfolder), so you may alternatively be able to restore a targeted backup.&lt;br /&gt;
&lt;br /&gt;
Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000CFCD6&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Allocation failure as a result of (re-)connecting to servers after a lengthy playing session on a server with bad practise in their scripts (abusing RAM and anim functions).&lt;br /&gt;
This crash may be 'fixed' (averted) by MTA in future, we're working on it! It's related to anims in memory and clearing them.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x00771848&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash because of issue with GTA data files (MTA fails to open them which could mean they are corrupted/modded &amp;amp; incompatible or missing)&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x001B6B2F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash because of issue with DATA\DEFAULT.DAT or DATA\CARCOLS.DAT file in your GTA installation folder (may be missing or modded/corrupted).&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003EC9DA&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Crash possibly because of issue with ANIM\PED.IFP file in your GTA installation folder (may be missing or modded/corrupted).&lt;br /&gt;
Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x003F18CF&lt;br /&gt;
0x003F190F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model. Use unmodded GTA install to check or in case of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
This crash has been averted (fixed by MTA), but due to technical limitations will still occur for Windows XP users.&amp;lt;br/&amp;gt;&lt;br /&gt;
Information for modellers &amp;amp; server owners: due to the nature of corruption, the model introduces a risk to crash, it could happen at any given moment while nearby.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x0019BD39&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad model. Use unmodded GTA install to check or in case of server mods, ask server owner to identify and replace the corrupt mod.&lt;br /&gt;
This crash usually occurs when you fire a weapon while the corrupt model is streamed in (physically nearby).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x000C9691&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad or missing vehicle model. This usually happens when you deleted a model from your GTA3.img without restoring the original or putting another model in its place. Or when the DFF isn't a valid model file at all.&lt;br /&gt;
Restore GTA3.img or use unmodded GTA install to check, and if that doesn't work then ask server owner to identify and replace the corrupt mod, since it can also still be a bad model (or a dodgy script, that, tell them this: deals with vehicle types, variants, upgrades etc, in an improper way)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x0000F67C&lt;br /&gt;
0x0000F663&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Custom models which are not working with volumetric shadows. Fix models or disable volumetric shadows in Settings-&amp;gt;Video.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x00423FD0&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad GTA mods or corrupted GTA3.img. Re-install GTA (with a clean and original version) to solve this crash. Note: known crash for common pirated copies &amp;amp; torrents of GTA, due to missing, bad or corrupted .dat, .col and .ipl files (pre-installed mods). MTA only supports the original, legally purchased version of GTA.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;0x000A2CF3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Corrupted, missing or modded GTA San Andreas\models &amp;gt; '''effects.fxp''' file. If restoring that file to original doesn't fix the crash, use unmodded GTA as it can also be due to related GTA data files (ones that have to do with effects).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
0x001A49D4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|Bad mod (custom player.img in GTA San Andreas\models). Restore player.img to original or use unmodded GTA.&lt;br /&gt;
Note: this crash can also be triggered when a player with CJ model (or CJ clothes) appears on your screen, on a server you're playing on. Your custom player.img cannot handle that and will cause a crash.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Resolving out-of-memory crashes==&lt;br /&gt;
If you're experiencing crashes that, according to the table of common crashes, are related to any sort of running out of memory, then we advise you to;&lt;br /&gt;
&lt;br /&gt;
- Mind the type of servers you're playing on, especially in combination with how powerful your PC is. There's lots of bloated, mod-heavy servers out there in MTA that demand the better of your PC and may also abuse memory through inefficient scripts besides custom mods (or even with the lack thereof).&lt;br /&gt;
 &lt;br /&gt;
We could write a book about the real cause (which is that such servers have bad scripters, or those that don't know what optimization is, and that they add everything, including bloated models and textures, without reviewing it) but we won't do that here.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or older generation PC, then we advise you to avoid certain &amp;quot;fancy&amp;quot; servers with huge resource downloads and such.&lt;br /&gt;
&lt;br /&gt;
- Install 64-bits version of Windows rather than x86 (32-bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you still want to play on servers that may easily get upper hand on your system, then;'''&lt;br /&gt;
&lt;br /&gt;
- Upgrade your PC's hardware for enhanced performance; consider replacing the videocard with one suitable for gaming, or adding additional system memory (RAM). Re-installing Windows can sometimes also help a bunch if your OS in general is slow and not well-maintained. Alternatively, perform some mainentance (consult someone with tech experience, or make a start by updating drivers and running various junk cleaners &amp;amp; renowned PC performance optimization tools)&lt;br /&gt;
&lt;br /&gt;
- Follow the instructions listed at [https://forum.mtasa.com/topic/78081-32-bit-windows-crashing/ https://forum.mtasa.com/topic/78081-32-bit-windows-crashing/]&lt;br /&gt;
&lt;br /&gt;
- Remove any mods to your GTA installation (preferably re-install) because mods may take up video memory and RAM, enough to cause your high memory usage and subsequent crashes.&lt;br /&gt;
Also you should definately try lowering streaming memory, by going into Settings-&amp;gt;Advanced-&amp;gt;Streaming memory-&amp;gt; and setting it to Min.&lt;br /&gt;
&lt;br /&gt;
Remember that GTA is an old game, and MTA places a lot of power in the hands of scripters (to mess up with a lack of optimization). Even if you have a high amount of RAM (for example 8gb, 16gb) you can't expect it to all be usable.. old games have technical limits and limited address space. Server scripters can do really cool and insanely realistic stuff while using far below 3.6GB RAM (the absolute technical limit in SA), but only as long they have scripters and modellers/designers that know about optimization. Strictly taken, no server, no matter how modded or beautiful.. should need to use above 2GB of RAM. Most decent servers use between 800MB - 1.6GB anyways. If you wish to learn more about this subject or are a server owner that wants to realize their mistakes, please join the MTA discord at https://discord.gg/mtasa and go to the #general channel, then open that channel's pinned post about optimization ecosystem problems (written by Dutchman101).&lt;br /&gt;
&lt;br /&gt;
Please note that in general, '''any crash''' with exception code '''0xE06D7363''' (on an MTA module, and not gta_sa.exe like this wiki page is focussed on) is also a memory-related issue, and comes back to the memory abuse by servers and mods described above.&lt;br /&gt;
&lt;br /&gt;
==Resolving crashes related to custom models==&lt;br /&gt;
If you're experiencing crashes that, according to the table of common crashes, are related to corrupt custom models, then we advise you to re-install GTA from the original game source (DVD or Steam, so no pre-modded repacks) or restore targetted file back-ups in case you understand which (type of) model may cause the crash. &lt;br /&gt;
&lt;br /&gt;
In case you're only experiencing the crashes while playing on a certain server, there's a high chance that server is loading custom server models, and then we recommend you to contact the server owner so they can investigate and potentially identify &amp;amp; replace the corrupted model to stop the crashes. Until they take successful action, on that server you can try to avoid physically facing the mod you believe results in a crash (like not spawning said vehicle or using said skin). &lt;br /&gt;
Let us remind you of the chance that the bad model is in your GTA3.img, but by coincidence you never physically come near that model on other servers, and the server you're crashing the most on happens to force usage of that model ID upon you (like as regularly used vehicle or skin); therefore it cannot be ruled out that it's possibly still your client mod, despite you only crashing on a single server, and it's worth at least re-installing your GTA to try it out.&lt;br /&gt;
&lt;br /&gt;
If you are a server owner and wouldn't prefer letting go of your beloved (corrupt) model, then you can ask an experienced modeller to try fix the corruption by modifying/revising it.&lt;br /&gt;
The alternative of crashing many players, potentially resulting in player loss for your server, isn't fine either way. For this reason, keeping a sharp eye on trends of players reporting (or shouting) that they crashed, and following up with them to get the crash details (to try match them up to model crashes from the table on this wiki page), may be a good idea.&lt;br /&gt;
&lt;br /&gt;
Adding upgradable components (named &amp;quot;ug_upgradename&amp;quot;) outside of chassis_dummy, will cause crashes once the vehicle has the respective upgrade component spawned.&lt;br /&gt;
&lt;br /&gt;
[[ru:Famous crash offsets and their meaning]]&lt;br /&gt;
[[pt-br:Crashs famosos e seu significado ]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:IsVehicleOnFire&amp;diff=75548</id>
		<title>Talk:IsVehicleOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:IsVehicleOnFire&amp;diff=75548"/>
		<updated>2022-10-03T02:21:58Z</updated>

		<summary type="html">&lt;p&gt;Danilo: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=75547</id>
		<title>IsVehicleOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=75547"/>
		<updated>2022-10-03T02:19:54Z</updated>

		<summary type="html">&lt;p&gt;Danilo: /* Author */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the vehicle is on fire.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleOnFire(vehicle theVehicle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''vehicle''': vehicle element.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&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;
function isVehicleOnFire(elementVehicle)&lt;br /&gt;
    if elementVehicle and getElementType(elementVehicle) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local vHealth = getElementHealth(elementVehicle)&lt;br /&gt;
        return vHealth &amp;lt; 250&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Author==&lt;br /&gt;
'''Hydra45 - (Discord: Gabriel45#6859)'''&lt;br /&gt;
&lt;br /&gt;
Changelog: [https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;amp;type=revision&amp;amp;diff=75546&amp;amp;oldid=75498 code later fixed/improved as it had issues]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=75546</id>
		<title>IsVehicleOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleOnFire&amp;diff=75546"/>
		<updated>2022-10-03T02:08:08Z</updated>

		<summary type="html">&lt;p&gt;Danilo: Improve function in order to work as meant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if the vehicle is on fire.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isVehicleOnFire(vehicle theVehicle)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''vehicle''': vehicle element.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&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;
function isVehicleOnFire(elementVehicle)&lt;br /&gt;
    if elementVehicle and getElementType(elementVehicle) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local vHealth = getElementHealth(elementVehicle)&lt;br /&gt;
        return vHealth &amp;lt; 250&lt;br /&gt;
    end&lt;br /&gt;
    return false&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;
==Author==&lt;br /&gt;
'''Hydra45 - (Discord: Gabriel45#6859)'''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:IsVehicleOnFire&amp;diff=75523</id>
		<title>Talk:IsVehicleOnFire</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:IsVehicleOnFire&amp;diff=75523"/>
		<updated>2022-09-27T01:58:09Z</updated>

		<summary type="html">&lt;p&gt;Danilo: Created page with &amp;quot;Things to fix in this code: 1 - Function's return can be improved; it will only return false/true if the code executes the if statements 2 - &amp;lt; 300 Is not the actual value the vehicle starts going on fire&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Things to fix in this code:&lt;br /&gt;
1 - Function's return can be improved; it will only return false/true if the code executes the if statements&lt;br /&gt;
2 - &amp;lt; 300 Is not the actual value the vehicle starts going on fire&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetRealTime&amp;diff=75377</id>
		<title>GetRealTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetRealTime&amp;diff=75377"/>
		<updated>2022-08-26T22:36:00Z</updated>

		<summary type="html">&lt;p&gt;Danilo: format the string to two digits with a proper programming standard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function gets the server or client (if used client sided it returns time as set on client's computer) real time and returns it in a table. If you want to get the in-game time (shown on GTA's clock) use [[getTime]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getRealTime( [ int seconds = current, bool localTime = true ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''seconds:''' A count in seconds from the year 1970.  Useful for storing points in time, or for retrieving time information for [[getBanTime]]. The valid range of this argument is 0 to 32,000,000,000&lt;br /&gt;
{{New feature/item|3.0141|1.4.1|6976|&lt;br /&gt;
*'''localTime:''' Set to ''true'' to adjust for the locally set timezone.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' of substrings with different time format or ''false'' if the '''seconds''' argument is out of range.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%;&amp;quot;&lt;br /&gt;
|'''Member'''&lt;br /&gt;
|'''Meaning'''&lt;br /&gt;
|'''Range'''&lt;br /&gt;
|-&lt;br /&gt;
|second&lt;br /&gt;
|seconds after the minute&lt;br /&gt;
|0-61*&lt;br /&gt;
|-&lt;br /&gt;
|minute&lt;br /&gt;
|minutes after the hour&lt;br /&gt;
|0-59&lt;br /&gt;
|-&lt;br /&gt;
|hour&lt;br /&gt;
|hours since midnight&lt;br /&gt;
|0-23&lt;br /&gt;
|-&lt;br /&gt;
|monthday&lt;br /&gt;
|day of the month&lt;br /&gt;
|1-31&lt;br /&gt;
|-&lt;br /&gt;
|month&lt;br /&gt;
|months since January&lt;br /&gt;
|0-11&lt;br /&gt;
|-&lt;br /&gt;
|year&lt;br /&gt;
|years since 1900&lt;br /&gt;
|-&lt;br /&gt;
|weekday&lt;br /&gt;
|days since Sunday&lt;br /&gt;
|0-6&lt;br /&gt;
|-&lt;br /&gt;
|yearday&lt;br /&gt;
|days since January 1&lt;br /&gt;
|0-365&lt;br /&gt;
|-&lt;br /&gt;
|isdst&lt;br /&gt;
|Daylight Saving Time flag&lt;br /&gt;
|-&lt;br /&gt;
|timestamp&lt;br /&gt;
|seconds since 1970 (Ignoring set timezone)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
''* second'' is generally 0-59. Extra range to accommodate for leap seconds in certain systems.&lt;br /&gt;
&lt;br /&gt;
==Remarks==&lt;br /&gt;
The '''seconds''' parameter can be left out entirely while still using the '''localTime''' parameter. To achieve that simply pass the boolean localTime parameter as first argument where you would otherwise pass the '''seconds''' parameter. This way you can retrieve a current timepoint that is not denoted in local time.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds 'showtime' like the default MTA 'time' command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showtime ()&lt;br /&gt;
    local time = getRealTime()&lt;br /&gt;
    local hours = time.hour&lt;br /&gt;
    local minutes = time.minute&lt;br /&gt;
    local seconds = time.second&lt;br /&gt;
&lt;br /&gt;
    -- use string.format to keep it 2 digits. eg 1 will be converted to 01&lt;br /&gt;
    outputChatBox ( string.format(&amp;quot;Local Time: %02d:%02d:%02d&amp;quot;,  hours, minutes, seconds) )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;showtime&amp;quot;, showtime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example with year, month, monthday using string.format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showtime ()&lt;br /&gt;
	local time = getRealTime()&lt;br /&gt;
	local hours = time.hour&lt;br /&gt;
	local minutes = time.minute&lt;br /&gt;
	local seconds = time.second&lt;br /&gt;
&lt;br /&gt;
        local monthday = time.monthday&lt;br /&gt;
	local month = time.month&lt;br /&gt;
	local year = time.year&lt;br /&gt;
&lt;br /&gt;
        local formattedTime = string.format(&amp;quot;%04d-%02d-%02d %02d:%02d:%02d&amp;quot;, year + 1900, month + 1, monthday, hours, minutes, seconds)&lt;br /&gt;
	outputChatBox ( &amp;quot;Local Time: &amp;quot;.. formattedTime )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;showtime&amp;quot;, showtime)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.4.0-9.06976|Added localTime argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;br /&gt;
[[ru:getRealTime]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPlayerInACL&amp;diff=75221</id>
		<title>IsPlayerInACL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPlayerInACL&amp;diff=75221"/>
		<updated>2022-07-03T21:11:08Z</updated>

		<summary type="html">&lt;p&gt;Danilo: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns true if the player is in the ACL group, false if otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPlayerInACL ( player thePlayer, string ACLGroup )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePlayer''': The player element that you want to check&lt;br /&gt;
* '''ACLGroup''': The name of the ACL group that you want to check&lt;br /&gt;
&lt;br /&gt;
'''Important Note''': This function will only work on the server-side.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the player's account is in the ACL, false if otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&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;
function isPlayerInACL(player, acl)&lt;br /&gt;
	if isElement(player) and getElementType(player) == &amp;quot;player&amp;quot; and aclGetGroup(acl or &amp;quot;&amp;quot;) then&lt;br /&gt;
		local account = getPlayerAccount(player)&lt;br /&gt;
		&lt;br /&gt;
		return isObjectInACLGroup( &amp;quot;user.&amp;quot;.. getAccountName(account), aclGetGroup(acl) )&lt;br /&gt;
	end&lt;br /&gt;
	return false&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;
==Example==&lt;br /&gt;
This is an example of the function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function checkAccess(thePlayer)&lt;br /&gt;
   if isPlayerInACL(thePlayer, &amp;quot;Console&amp;quot;) then&lt;br /&gt;
      outputChatBox(&amp;quot;Access Granted!&amp;quot;)&lt;br /&gt;
  else&lt;br /&gt;
      outputChatBox(&amp;quot;Access Denied!&amp;quot;)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;myaccess&amp;quot;, checkAccess)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
xXMADEXx &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;br /&gt;
&lt;br /&gt;
[[RU:IsPlayerInACL]]&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/open&amp;diff=73846</id>
		<title>Modules/FileSystem/translator/open</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/open&amp;diff=73846"/>
		<updated>2022-01-24T02:04:14Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function opens a link to a file instance on a given Eir FileSystem translator. Using a file link you can write and/or receive data from filesystems.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file, string translator:open ( string filePath, string fileMode )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''filePath:''' the path to the file that should be opened&lt;br /&gt;
*'''fileMode:''' an ANSI file mode descriptor (can be 'w', 'r' or 'a', with 'b' and/or '+' appended)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the '''FileSystem file''' class that can be used to retrieve or store data persistently. Returns '''false''' if the file failed to open and the '''reason of failure as string'''.&lt;br /&gt;
&lt;br /&gt;
===Failure reasons===&lt;br /&gt;
* unknown error&lt;br /&gt;
* path out of scope&lt;br /&gt;
* invalid parameters&lt;br /&gt;
* resources exhausted&lt;br /&gt;
* access denied&lt;br /&gt;
* not found&lt;br /&gt;
* already exists&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This snippet lists information about the registered MTA server modules. This information can be retrieved through a command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- The table that will contain all module information.&lt;br /&gt;
local moduleInfo = {};&lt;br /&gt;
&lt;br /&gt;
-- Attempt to get a handle to the FileSystem module namespace.&lt;br /&gt;
local fsys = createFilesystemInterface();&lt;br /&gt;
&lt;br /&gt;
-- Could fail if the server restrictions are set tight.&lt;br /&gt;
if not ( fsys ) then&lt;br /&gt;
    outputDebugString( &amp;quot;could not get a handle to the FileSystem module namespace&amp;quot; );&lt;br /&gt;
    return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function moduleFileIterator( filePath )&lt;br /&gt;
    -- Create an entry for this module.&lt;br /&gt;
    local moduleName = fsys.root:relPath( filePath );&lt;br /&gt;
    local moduleStats = fsys.root:stat( filePath );&lt;br /&gt;
&lt;br /&gt;
    local entry = {&lt;br /&gt;
        name = moduleName,&lt;br /&gt;
        stats = moduleStats&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    -- Add the entry into the registry.&lt;br /&gt;
    table.insert( moduleInfo, entry );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Loop through all server modules.&lt;br /&gt;
fsys.root:chdir( &amp;quot;mods/deathmatch/modules/&amp;quot; );&lt;br /&gt;
fsys.root:scanDirEx( &amp;quot;&amp;quot;, &amp;quot;*&amp;quot;, nil, moduleFileIterator, false );&lt;br /&gt;
&lt;br /&gt;
-- Function to get a module into by name.&lt;br /&gt;
local function getModuleByName( name )&lt;br /&gt;
    for m,n in ipairs( moduleInfo ) do&lt;br /&gt;
        if ( n.name == name ) then&lt;br /&gt;
            return n;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Command to request server module information.&lt;br /&gt;
addCommandHandler( &amp;quot;modules&amp;quot;,&lt;br /&gt;
    function(player, moduleName)&lt;br /&gt;
        -- Output module information to the player.&lt;br /&gt;
        local module = getModuleByName( moduleName );&lt;br /&gt;
&lt;br /&gt;
        if not ( module ) then&lt;br /&gt;
            outputChatBox( &amp;quot;could not find module named &amp;quot; .. tostring( moduleName ), player );&lt;br /&gt;
            return false;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        -- Output it.&lt;br /&gt;
        outputChatBox( &amp;quot;module-name: &amp;quot; .. module.name );&lt;br /&gt;
        outputChatBox( &amp;quot;module-size: &amp;quot; .. module.stats.size );&lt;br /&gt;
        &lt;br /&gt;
        -- todo: add more info about the module.&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;
{{:Modules/FileSystem/translator/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createTranslator&amp;diff=73845</id>
		<title>Modules/FileSystem/createTranslator</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createTranslator&amp;diff=73845"/>
		<updated>2022-01-24T02:01:00Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a FileSystem translator. A FileSystem translator represents a directory on a real or virtual filesystem. Through translators you get access to the files that reside in their directory trees. The translator returned by this function usually represents an OS filesystem directory.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
translator fsnamespace.createTranslator( string rootPath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''rootPath:''' the absolute path to the directory that you want access to.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the '''FileSystem translator''' that grants access to files in the requested directory.&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This snippet links all directories inside of your resource instance folder using translators and lists them in a dictionary under their name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dictionary that will contain all directory links of our resource.&lt;br /&gt;
local dirs = {};&lt;br /&gt;
&lt;br /&gt;
-- Get a handle to the FileSystem module namespace.&lt;br /&gt;
local fsys = createFilesystemInterface();&lt;br /&gt;
&lt;br /&gt;
-- Make sure we could obtain the module namespace.&lt;br /&gt;
if not ( fsys ) then&lt;br /&gt;
    outputDebugString( &amp;quot;could not obtain FileSystem module namespace&amp;quot; );&lt;br /&gt;
    return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Create a translator to the resource root.&lt;br /&gt;
local resRoot = fsys.createTranslator( &amp;quot;mods/deathmatch/resources/&amp;quot; .. getResourceName(resource) .. &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function dirIterator( dirPath )&lt;br /&gt;
    -- get the simple name of this directory.&lt;br /&gt;
    -- the simple name is the path relative to resRoot without the '/'&lt;br /&gt;
    local simpleName = resRoot.relPathRoot( dirPath );&lt;br /&gt;
    simpleName = string.sub( simpleName, 1, #simpleName - 1 );&lt;br /&gt;
&lt;br /&gt;
    -- link this directory and set it into our dirs dictionary.&lt;br /&gt;
    -- we should always pass the absolute directory to this function.&lt;br /&gt;
    local translator = fileCreateTranslator( dirPath );&lt;br /&gt;
&lt;br /&gt;
    dirs[simpleName] = translator;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function fileIterator( filePath )&lt;br /&gt;
    -- do nothing.&lt;br /&gt;
    return;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
resRoot.scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, dirIterator, fileIterator, false );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/getDoBufferAllRaw&amp;diff=73794</id>
		<title>Modules/FileSystem/getDoBufferAllRaw</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/getDoBufferAllRaw&amp;diff=73794"/>
		<updated>2022-01-23T04:03:17Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the value of the buffering-policy for newly created raw-file handles.&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 fsnamespace.getDoBufferAllRaw()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the buffering-policy is enabled, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/setDoBufferAllRaw&amp;diff=73793</id>
		<title>Modules/FileSystem/setDoBufferAllRaw</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/setDoBufferAllRaw&amp;diff=73793"/>
		<updated>2022-01-23T04:02:29Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function changes the raw-file buffering policy of newly created file streams. If the buffering-policy is enabled then each newly created file stream is wrapped inside of a custom FileSystem buffering handle. File stream modifications that are close to each other are batched together for optimizational purposes.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void fsnamespace.setDoBufferAllRaw( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''enabled''': new value for the buffering-policy&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function does return nil.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/type&amp;diff=73792</id>
		<title>Modules/FileSystem/type</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/type&amp;diff=73792"/>
		<updated>2022-01-23T04:02:02Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the type of the given Eir FileSystem object.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fsnamespace.type( userdata obj )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''obj''': the Eir FileSystem object to retrieve the type from&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the type string of the queried object, false if not successful. For destroyed objects the return value is always false.&lt;br /&gt;
&lt;br /&gt;
===Possible Return Values===&lt;br /&gt;
*file&lt;br /&gt;
*file-translator&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/topointer&amp;diff=73791</id>
		<title>Modules/FileSystem/topointer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/topointer&amp;diff=73791"/>
		<updated>2022-01-23T04:01:24Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the light-userdata representation of the object. This is the direct pointer into the Eir FileSystem module handle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
light-userdata fsnamespace.topointer( userdata obj )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''obj''': the userdata of the Eir FileSystem Lua environment&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the light-userdata value of the internal object, false if not successful.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/streamCompare&amp;diff=73790</id>
		<title>Modules/FileSystem/streamCompare</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/streamCompare&amp;diff=73790"/>
		<updated>2022-01-23T04:00:41Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function compares the bytes of two streams for equality. The comparison starts from the current file seek and finishes at the end of the respective file stream. If the read count of either stream does not match the other, then this function fails.&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 fsnamespace.streamCompare( file left, file right )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''left''': first file for equality comparison&lt;br /&gt;
*'''right''': second file for equality comparison&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the data stream was equal, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/pathToFilename&amp;diff=73789</id>
		<title>Modules/FileSystem/pathToFilename</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/pathToFilename&amp;diff=73789"/>
		<updated>2022-01-23T04:00:13Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the filename and the directory portions of a filepath, separated into two strings.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string, string fsnamespace.pathToFilename( string path, bool includeExtention )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path''': the file path to extract from&lt;br /&gt;
*'''includeExtention''': if true then the filename extention is included in the result&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the filename and directory of the provided file path.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyStreamCount&amp;diff=73788</id>
		<title>Modules/FileSystem/copyStreamCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyStreamCount&amp;diff=73788"/>
		<updated>2022-01-23T03:59:50Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies data starting from a source file stream into a specified destination stream. The copy of data is performed starting from the source file seek. The copy is only performed up to a specified count of bytes.&lt;br /&gt;
&lt;br /&gt;
Read operations on the file streams advance the seek pointers. Thus the seek pointers stay changed after the function has completed.&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 fsnamespace.copyStreamCount( file src, file dst, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''src''': source of the copy operation, starting from the seek pointer&lt;br /&gt;
*'''dst''': target of the copy operation, starting from the seek pointer&lt;br /&gt;
*'''count''': the amount of bytes to copy (has to be above 0)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the copy operation has completed successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyStream&amp;diff=73787</id>
		<title>Modules/FileSystem/copyStream</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyStream&amp;diff=73787"/>
		<updated>2022-01-23T03:58:50Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies data starting from a source file stream into a specified destination stream. The copy of data is performed starting from the source file seek.&lt;br /&gt;
&lt;br /&gt;
Read operations on the file streams advance the seek pointers. Thus the seek pointers stay changed after the function has completed.&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 fsnamespace.copyStream( file src, file dst )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''src''': source of the copy operation, starting from the seek pointer&lt;br /&gt;
*'''dst''': target of the copy operation, starting from the seek pointer&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the copy operation has completed successfully, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyFile&amp;diff=73786</id>
		<title>Modules/FileSystem/copyFile</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/copyFile&amp;diff=73786"/>
		<updated>2022-01-23T03:58:16Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies files between two translators.&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 fsnamespace.copyFile( translator srcTrans, string srcPath, translator dstTrans, string dstPath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''srcTrans:''' source translator for the file of origin&lt;br /&gt;
*'''srcPath:''' path into the source translator&lt;br /&gt;
*'''dstTrans:''' target translator&lt;br /&gt;
*'''dstPath:''' path into the target translator&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the copy has succeeded, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createFileIterative&amp;diff=73785</id>
		<title>Modules/FileSystem/createFileIterative</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createFileIterative&amp;diff=73785"/>
		<updated>2022-01-23T03:57:16Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function attempts to create a file with numeric iteration for filename collision avoidance. If a specific filename is taken then the algorithm will try to create the next file with increased numeric insert.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fsnamespace.createFileIterative( translator target, string prefix, string suffix, int maxIterations )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''target''': the file translator based on which to create the file&lt;br /&gt;
*'''prefix''': part of file path before the numeric insert&lt;br /&gt;
*'''suffix''': part of file path after the numeric insert (for example the file extention)&lt;br /&gt;
*'''maxIterations''': integral number of tries for the existing filename collisions (greater than 0)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a newly created file handle distinct from any other colliding one if successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createMemoryFile&amp;diff=73784</id>
		<title>Modules/FileSystem/createMemoryFile</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createMemoryFile&amp;diff=73784"/>
		<updated>2022-01-23T03:56:29Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a single file that is resident entirely in system memory.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fsnamespace.createMemoryFile( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a new file object if successful, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/file/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createRAMDisk&amp;diff=73783</id>
		<title>Modules/FileSystem/createRAMDisk</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createRAMDisk&amp;diff=73783"/>
		<updated>2022-01-23T03:54:08Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a FileSystem translator which is located entirely inside of MTA application memory, also known as RAM.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
translator fsnamespace.createRAMDisk( bool caseSensitive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''caseSensitive:''' if true then all namespaces are compared case sensitively in path operations, otherwise strict character equality comparison is performed&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a new '''FileSystem translator''' that can be used to store (temporary) files in. If the creation of the ramdisk has failed, then false is returned.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createTranslator&amp;diff=73782</id>
		<title>Modules/FileSystem/createTranslator</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/createTranslator&amp;diff=73782"/>
		<updated>2022-01-23T03:53:04Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#e36242&amp;quot; subcaption=&amp;quot;Namespace function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function creates a FileSystem translator. A FileSystem translator represents a directory on a real or virtual filesystem. Through translators you get access to the files that reside in their directory trees. The translator returned by this function usually represents an OS filesystem directory.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
translator fsnamespace.createTranslator( string rootPath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''rootPath:''' the absolute path to the directory that you want access to.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the '''FileSystem translator''' that grants access to files in the requested directory.&lt;br /&gt;
&lt;br /&gt;
==Example==&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;
This snippet links all directories inside of your resource instance folder using translators and lists them in a dictionary under their name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dictionary that will contain all directory links of our resource.&lt;br /&gt;
local dirs = {};&lt;br /&gt;
&lt;br /&gt;
-- Get a handle to the FileSystem module namespace.&lt;br /&gt;
local fsys = createFilesystemInterface();&lt;br /&gt;
&lt;br /&gt;
-- Make sure we could obtain the module namespace.&lt;br /&gt;
if not ( fsys ) then&lt;br /&gt;
    outputDebugString( &amp;quot;could not obtain FileSystem module namespace&amp;quot; );&lt;br /&gt;
    return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Create a translator to the resource root.&lt;br /&gt;
local resRoot = fsys.createTranslator( &amp;quot;mods/deathmatch/resources/&amp;quot; .. getResourceName(resource) .. &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function dirIterator( dirPath )&lt;br /&gt;
    -- get the simple name of this directory.&lt;br /&gt;
    -- the simple name is the path relative to resRoot without the '/'&lt;br /&gt;
    local simpleName = resRoot.relPathRoot( dirPath );&lt;br /&gt;
    simpleName = string.sub( simpleName, 1, #simpleName - 1 );&lt;br /&gt;
&lt;br /&gt;
    -- link this directory and set it into our dirs dictionary.&lt;br /&gt;
    -- we should always pass the absolute directory to this function.&lt;br /&gt;
    local translator = fileCreateTranslator( dirPath );&lt;br /&gt;
&lt;br /&gt;
    dirs[simpleName] = translator;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function fileIterator( filePath )&lt;br /&gt;
    -- do nothing.&lt;br /&gt;
    return;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
resRoot.scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, dirIterator, fileIterator, false );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;
This snippet links all directories inside of your resource instance folder using translators and lists them in a dictionary under their name.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Dictionary that will contain all directory links of our resource.&lt;br /&gt;
local dirs = {};&lt;br /&gt;
&lt;br /&gt;
-- Create a translator to the resource root.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function dirIterator( dirPath )&lt;br /&gt;
    -- get the simple name of this directory.&lt;br /&gt;
    -- the simple name is the path relative to resRoot without the '/'&lt;br /&gt;
    local simpleName = resRoot.relPathRoot( dirPath );&lt;br /&gt;
    simpleName = string.sub( simpleName, 1, #simpleName - 1 );&lt;br /&gt;
&lt;br /&gt;
    -- link this directory and set it into our dirs dictionary.&lt;br /&gt;
    -- we should always pass the absolute directory to this function.&lt;br /&gt;
    local translator = fileCreateTranslator( dirPath );&lt;br /&gt;
&lt;br /&gt;
    dirs[simpleName] = translator;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function fileIterator( filePath )&lt;br /&gt;
    -- do nothing.&lt;br /&gt;
    return;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
resRoot.scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, dirIterator, fileIterator, false );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/namespace/functions}}&lt;br /&gt;
&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getPathProcessingMode&amp;diff=73781</id>
		<title>Modules/FileSystem/translator/getPathProcessingMode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getPathProcessingMode&amp;diff=73781"/>
		<updated>2022-01-23T03:33:33Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the path-processing-mode for the given file translator.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string translator:getPathProcessingMode ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a string describing the current path-processing-mode of the translator.&lt;br /&gt;
&lt;br /&gt;
===Possible Return Values===&lt;br /&gt;
*distinguished&lt;br /&gt;
*ambivalent_file&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/setPathProcessingMode&amp;diff=73780</id>
		<title>Modules/FileSystem/translator/setPathProcessingMode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/setPathProcessingMode&amp;diff=73780"/>
		<updated>2022-01-23T03:33:07Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the path-processing-mode for the file translator. The path-processing-mode describes how paths are handled in detail during file-path consuming function calls.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void translator:setPathProcessingMode( string mode )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''mode:''' value for the translator path-processing-mode (either '''distinguished''' or '''ambivalent_file''')&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns nil.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getOutbreakEnabled&amp;diff=73779</id>
		<title>Modules/FileSystem/translator/getOutbreakEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getOutbreakEnabled&amp;diff=73779"/>
		<updated>2022-01-23T03:32:47Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets the outbreak-policy of a file translator. If outbreak is enabled then file path requests outside of the translator root are allowed. Otherwise the user can only access files that are accessible from inside the translator root directory.&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 translator:setOutbreakEnabled ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns true if the outbreak-policy is enabled for this translator, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/setOutbreakEnabled&amp;diff=73778</id>
		<title>Modules/FileSystem/translator/setOutbreakEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/setOutbreakEnabled&amp;diff=73778"/>
		<updated>2022-01-23T03:32:22Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the outbreak-policy of a file translator. If outbreak is enabled then file path requests outside of the translator root are allowed. Otherwise the user can only access files that are accessible from inside the translator root directory.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void translator:setOutbreakEnabled ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''enabled:''' value for the translator outbreak-policy&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns nil.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getFiles&amp;diff=73777</id>
		<title>Modules/FileSystem/translator/getFiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getFiles&amp;diff=73777"/>
		<updated>2022-01-23T03:31:15Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns a list of all files that are found under the wild-card and directory parameters. It is similar to [[MTA:Eir/FileSystem/translator/scanDir|scanDir]] but returns files only.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table translator:getFiles ( string dirPath, string wildcard, bool recursive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to the directory the scan shall take place or start in&lt;br /&gt;
*'''wildcard:''' glob-style wild-card for filename matching; every filename that matches the wild-card is returned&lt;br /&gt;
*'''recursive:''' a boolean that specifies whether the whole directory tree at dirPath should be included into the scan&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a table of all matching file entries for the performed scan. It returns '''false''' if '''dirPath''' is not a valid directory target for the translator.&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;
This snippet is yet another alternative to output the count of directories and files in a folder.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function getFilesystemObjectCounts( path )&lt;br /&gt;
    local fileCount = 0;&lt;br /&gt;
    local dirCount = 0;&lt;br /&gt;
&lt;br /&gt;
    -- Query the counts.&lt;br /&gt;
    fileCount = #resRoot:getFiles( path, &amp;quot;*&amp;quot;, false );&lt;br /&gt;
    dirCount = #resRoot:getDirs( path, false );&lt;br /&gt;
&lt;br /&gt;
    -- Return the counts.&lt;br /&gt;
    return fileCount, dirCount;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Output the filesystem object counts for the resource instance root.&lt;br /&gt;
local fileCount, dirCount = getFilesystemObjectCounts( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;found &amp;quot; .. fileCount .. &amp;quot; files and &amp;quot; .. dirCount .. &amp;quot; directories in the resource folder root.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getDirs&amp;diff=73776</id>
		<title>Modules/FileSystem/translator/getDirs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/getDirs&amp;diff=73776"/>
		<updated>2022-01-23T03:30:55Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns a list of all directories that are found under the directory path. It is similar to [[MTA:Eir/FileSystem/translator/scanDir|scanDir]] but returns directories only.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table translator:getDirs ( string dirPath, bool recursive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to the directory the scan shall take place or start in&lt;br /&gt;
*'''recursive:''' a boolean that specifies whether the whole directory tree at dirPath should be included into the scan&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a table of all matching directory entries for the performed scan. It returns '''false''' if '''dirPath''' is not a valid directory target for the translator.&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;
This snippet is yet another alternative to output the count of directories and files in a folder.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function getFilesystemObjectCounts( path )&lt;br /&gt;
    local fileCount = 0;&lt;br /&gt;
    local dirCount = 0;&lt;br /&gt;
&lt;br /&gt;
    -- Query the counts.&lt;br /&gt;
    fileCount = #resRoot:getFiles( path, &amp;quot;*&amp;quot;, false );&lt;br /&gt;
    dirCount = #resRoot:getDirs( path, false );&lt;br /&gt;
&lt;br /&gt;
    -- Return the counts.&lt;br /&gt;
    return fileCount, dirCount;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Output the filesystem object counts for the resource instance root.&lt;br /&gt;
local fileCount, dirCount = getFilesystemObjectCounts( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;found &amp;quot; .. fileCount .. &amp;quot; files and &amp;quot; .. dirCount .. &amp;quot; directories in the resource folder root.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDirEx&amp;diff=73775</id>
		<title>Modules/FileSystem/translator/scanDirEx</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDirEx&amp;diff=73775"/>
		<updated>2022-01-23T03:30:30Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function loops through all translator filesystem entries that are captured by the wildcard and the directory specifier. The wildcard is glob-style and supports '''*''' and '''?''' modifiers. The scan can be made recursive to enter every directory it finds, so that files and folders of a whole directory tree are captured. This function is used to process filesystem objects inside of directories without having to add the filenames into a configuration file. This greatly increases flexibility when processing files. This function is more flexible than [[MTA:Eir/FileSystem/translator/scanDir|scanDir]] as it triggers callbacks directly when either files or directories are found, making a distinction between files and directories very easy.&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 translator:scanDirEx ( string dirPath, string wildcard, function dirCallback, function fileCallback, bool recursive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to the directory the scan shall take place or start in&lt;br /&gt;
*'''wildcard:''' glob-style wild-card for filename matching; every filename that matches the wild-card is returned&lt;br /&gt;
*'''dirCallback:''' the function callback that should trigger for every directory found (can be nil); the absolute path of the directory is passed to it&lt;br /&gt;
*'''fileCallback:''' the directory callback that should trigger for every file found (can be nil); the absolute path of the file is passed to it&lt;br /&gt;
*'''recursive:''' a boolean that specifies whether the whole directory tree at dirPath should be included into the scan&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function performs a scan of all filesystem objects captured inside of the '''dirPath''' folder using the '''wild-card''' glob-style pattern. It returns '''false''' if '''dirPath''' is an invalid path specifier for the translator.&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;
This snippet outputs the count of directories and files in a specified directory relative to the resource instance root. This is an alternative to the '''scanDir''' way.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
local function getFilesystemObjectCounts( path )&lt;br /&gt;
    local fileCount = 0;&lt;br /&gt;
    local dirCount = 0;&lt;br /&gt;
&lt;br /&gt;
    -- Create iterator closures that are triggered for each file and directory&lt;br /&gt;
    local function fileIterator( filePath )&lt;br /&gt;
        -- filePath is always an absolute path.&lt;br /&gt;
        fileCount = fileCount + 1;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local function dirIterator( dirPath )&lt;br /&gt;
        -- filePath is always an absolute path.&lt;br /&gt;
        dirCount = dirCount + 1;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Get a list of all fs objects.&lt;br /&gt;
    local fsObjects =&lt;br /&gt;
        resRoot:scanDirEx(&lt;br /&gt;
            path, -- scan anywhere the script wants us to&lt;br /&gt;
            &amp;quot;*&amp;quot;, -- include all files&lt;br /&gt;
            dirIterator, -- pass the callbacks to the routine&lt;br /&gt;
            fileIterator,&lt;br /&gt;
            false -- scan the specified directory only&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    -- We do not need to loop anymore.&lt;br /&gt;
&lt;br /&gt;
    -- Return the counts.&lt;br /&gt;
    return fileCount, dirCount;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Output the filesystem object counts for the resource instance root.&lt;br /&gt;
local fileCount, dirCount = getFilesystemObjectCounts( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;found &amp;quot; .. fileCount .. &amp;quot; files and &amp;quot; .. dirCount .. &amp;quot; directories in the resource folder root.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDir&amp;diff=73774</id>
		<title>Modules/FileSystem/translator/scanDir</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/scanDir&amp;diff=73774"/>
		<updated>2022-01-23T03:30:05Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function loops through all translator filesystem entries that are captured by the wildcard and the directory specifier. The wildcard is glob-style and supports '''*''' and '''?''' modifiers. The scan can be made recursive to enter every directory it finds, so that files and folders of a whole directory tree are captured. This function is used to process filesystem objects inside of directories without having to add the filenames into a configuration file. This greatly increases flexibility when processing files. Other than [[MTA:Eir/FileSystem/translator/scanDirEx|scanDirEx]], this function returns a table of directories and files.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table translator:scanDir ( string dirPath, string wildcard, bool recursive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to the directory the scan shall take place or start in&lt;br /&gt;
*'''wildcard:''' glob-style wild-card for filename matching; every filename that matches the wild-card is returned&lt;br /&gt;
*'''recursive:''' a boolean that specifies whether the whole directory tree at dirPath should be included into the scan&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a table consisting of all directories and all matching file entries which were found during the scan. It returns '''false''' if '''dirPath''' is an invalid path specifier for the translator.&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;
This snippet outputs the count of directories and files in a specified directory relative to the resource instance root.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Function that returns whether the given path is a directory path.&lt;br /&gt;
local function isDirectoryPath( path )&lt;br /&gt;
   local lastChar = string.sub( path, #path, #path );&lt;br /&gt;
&lt;br /&gt;
   return ( lastChar == &amp;quot;/&amp;quot; ) or ( lastChar == &amp;quot;\\&amp;quot; );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getFilesystemObjectCounts( path )&lt;br /&gt;
    local fileCount = 0;&lt;br /&gt;
    local dirCount = 0;&lt;br /&gt;
&lt;br /&gt;
    -- Get a list of all fs objects.&lt;br /&gt;
    local fsObjects =&lt;br /&gt;
        resRoot:scanDir(&lt;br /&gt;
            path, -- scan anywhere the script wants us to&lt;br /&gt;
            &amp;quot;*&amp;quot;, -- include all files&lt;br /&gt;
            false -- scan the specified directory only&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    -- Loop through all object names to set up the counts.&lt;br /&gt;
    -- An object can either be a directory or a file.&lt;br /&gt;
    for m,n in ipairs(fsObjects) do&lt;br /&gt;
        if ( isDirectoryPath( n ) ) then&lt;br /&gt;
            dirCount = dirCount + 1;&lt;br /&gt;
        else&lt;br /&gt;
            fileCount = fileCount + 1;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Return the counts.&lt;br /&gt;
    return fileCount, dirCount;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Output the filesystem object counts for the resource instance root.&lt;br /&gt;
local fileCount, dirCount = getFilesystemObjectCounts( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;found &amp;quot; .. fileCount .. &amp;quot; files and &amp;quot; .. dirCount .. &amp;quot; directories in the resource folder root.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/absPathRoot&amp;diff=73773</id>
		<title>Modules/FileSystem/translator/absPathRoot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/absPathRoot&amp;diff=73773"/>
		<updated>2022-01-23T03:29:41Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function resolves a specified path into its absolute version. The path is resolved from the translator root. This function can be used to get a unique version of a path (without scripting symbols such as '..').&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string translator:absPathRoot ( string path )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path:''' the path that should be resolved into an absolute path; can be nil to return the absolute location of the translator (on host filesystems such as NTFS or ext3)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the absolute version of the path that is passed to it, '''false''' if the specified path is not accessible by the translator.&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;
This snippet checks whether the path given to it is valid for the resource.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get a handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Create our utility function.&lt;br /&gt;
local function isPathValidForResource( path )&lt;br /&gt;
    return not ( resRoot:absPathRoot( path ) == false );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Is the path inside of/valid for our resource? Should return false.&lt;br /&gt;
local myPathValidity = isPathValidForResource( &amp;quot;C:/Windows/System32/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;the windows system directory is &amp;quot; .. ( myPathValidity and &amp;quot;&amp;quot; or &amp;quot;not &amp;quot; ) .. &amp;quot;valid.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/absPath&amp;diff=73772</id>
		<title>Modules/FileSystem/translator/absPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/absPath&amp;diff=73772"/>
		<updated>2022-01-23T03:29:16Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function resolves a specified path into its absolute version. This function can be used to get a unique version of a path (without scripting symbols such as '..').&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string translator:absPath ( string path )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path:''' the path that should be resolved into an absolute path; can be nil to return the absolute location of the current directory.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the absolute version of the path that is passed to it, '''false''' if the specified path is not accessible by the translator.&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;
This snippet prints the absolute location of the shared client-side resource folder.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get the absolute path to our resource.&lt;br /&gt;
local absResourceLocation = fileCreateTranslator( &amp;quot;/&amp;quot; ):absPath();&lt;br /&gt;
&lt;br /&gt;
-- Print it out to the user.&lt;br /&gt;
outputChatBox( &amp;quot;running resource from: &amp;quot; .. absResourceLocation );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/relPathRoot&amp;diff=73771</id>
		<title>Modules/FileSystem/translator/relPathRoot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/relPathRoot&amp;diff=73771"/>
		<updated>2022-01-23T03:28:47Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function transform a path that is passed to it into a path that is relative to the translators root directory. The path must be accessible from the translator. The path can either be absolute or relative.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string translator:relPathRoot ( string path )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path:''' the path that should be transformed into a relative path; can be nil to return the '''null path'''&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the relative version of the path that is passed to it, '''false''' if the specified path is not accessible by the translator.&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;
This snippet returns the relative-to-root version of a translator relative path.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a generic file translator to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Change into another directory.&lt;br /&gt;
resRoot:createDir( &amp;quot;myDir/&amp;quot; );&lt;br /&gt;
resRoot:chdir( &amp;quot;myDir/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Output the path relative to the current directory and relative to the translator root directory.&lt;br /&gt;
local thePath = &amp;quot;someDir/../myFile.txt&amp;quot;;&lt;br /&gt;
local relativeToCurrent = resRoot:relPath( thePath );&lt;br /&gt;
local relativeToRoot = resRoot:relPathRoot( thePath );&lt;br /&gt;
&lt;br /&gt;
outputChatBox( &amp;quot;input-path: &amp;quot; .. thePath );&lt;br /&gt;
outputChatBox( &amp;quot;relative-to-current: &amp;quot; .. relativeToCurrent );&lt;br /&gt;
outputChatBox( &amp;quot;relative-to-root: &amp;quot; .. relativeToRoot );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/relPath&amp;diff=73770</id>
		<title>Modules/FileSystem/translator/relPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/relPath&amp;diff=73770"/>
		<updated>2022-01-23T03:28:13Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function transform a path that is passed to it into a path that is relative to the translators current directory. The path must be accessible from the translator. The path can either be absolute or relative.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string translator:relPath ( string path )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path:''' the path that should be transformed into a relative path; can be nil if the current directory should be returned&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the relative version of the path that is passed to it, '''false''' if the specified path is not accessible by the translator.&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;
This snippet converts the path relative from one translator to a relative path from another translator.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function getPathTranslatorRelative( srcTranslator, dstTranslator, srcPath )&lt;br /&gt;
    -- Get the absolute path from the srcTranslator perspective.&lt;br /&gt;
    local absPath = srcTranslator:absPath( srcPath );&lt;br /&gt;
&lt;br /&gt;
    -- Return the relative path from the dstTranslator. Will return false if conversion cannot happen.&lt;br /&gt;
    return dstTranslator:relPath( absPath );&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/stat&amp;diff=73769</id>
		<title>Modules/FileSystem/translator/stat</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/stat&amp;diff=73769"/>
		<updated>2022-01-23T03:27:48Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function queries common information about a filesystem object and returns it as a dictionary. Example of it's return value:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    accessTime = 1390997951, -- OS specific time information&lt;br /&gt;
    creationTime = 1381999749, -- OS specific time information&lt;br /&gt;
    modTime = 1381872826, -- OS specific time information&lt;br /&gt;
    size = 1441280, -- size of the filesystem object in bytes&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&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;
dictionary translator:stat ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''filePath:''' the path to the filesystem object that you want to get the statistics of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns a statistics structure of the filesystem object pointed at by '''filePath''', '''false''' if '''filePath''' is not a valid path in the translator or the filesystem object pointed at by it is not accessible.&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;
This snippet returns information about the currently running script. It can be used to know when the script has been updated by MTA.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Grab a generic translator of resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Get the information of this script file.&lt;br /&gt;
local scriptStats = resRoot:stat( &amp;quot;thisScript.lua&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- todo: use this information somehow.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/size&amp;diff=73768</id>
		<title>Modules/FileSystem/translator/size</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/size&amp;diff=73768"/>
		<updated>2022-01-23T03:27:28Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function queries the size of a filesystem object. The size of a filesystem object is the count of bytes that it logically fills on the storage media.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int translator:size ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''filePath:''' the path to the filesystem object that you want to get the size of&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns the count of bytes that the filesystem object is logically taking on the storage medium, '''false''' if '''filePath''' is not a valid path in the translator or the filesystem object pointed at by it is not accessible.&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;
This snippet calculates the size of a resource and prints it to the debug console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Get the handle to the resource instance directory.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Calculate the size of every file in it.&lt;br /&gt;
local fileSizeCount = 0;&lt;br /&gt;
&lt;br /&gt;
local function fileIteratorSum( filePath )&lt;br /&gt;
    fileSizeCount = fileSizeCount + resRoot:size( filePath );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Iterate through the entire directory tree, including the sub-directories.&lt;br /&gt;
resRoot:scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, nil, fileIteratorSum, true );&lt;br /&gt;
&lt;br /&gt;
-- Output the size to the console.&lt;br /&gt;
outputDebugString( &amp;quot;resource size: &amp;quot; .. fileSizeCount );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/rename&amp;diff=73767</id>
		<title>Modules/FileSystem/translator/rename</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/rename&amp;diff=73767"/>
		<updated>2022-01-23T03:27:03Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function moves a file from a source location to a destination location inside of a filesystem. This function is the fastest way to move data from one location to another.&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 translator:rename ( string srcPath, string dstPath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''srcPath:''' a path to the source file&lt;br /&gt;
*'''dstPath:''' the path to the destination location where the source file should be moved to&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns '''true''' if the file pointed at by '''srcPath''' could be successfully moved to the new '''dstPath''' location, '''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;
This snippet moves a script file to another location.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a generic translator.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Move this script file into a directory called &amp;quot;collection&amp;quot;&lt;br /&gt;
resRoot:rename( &amp;quot;thisScript.lua&amp;quot;, &amp;quot;trash/thisScript.lua&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/copy&amp;diff=73766</id>
		<title>Modules/FileSystem/translator/copy</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/copy&amp;diff=73766"/>
		<updated>2022-01-23T03:26:41Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies a file from a source location to a file at the destination. The contents of the source file are copied, so that source and destination have the same content. Since the transactions happen through kernel-calls, this function is faster than performing the copying yourself through Lua strings.&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 translator:copy ( string srcPath, string dstPath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''srcPath:''' a path to the source file&lt;br /&gt;
*'''dstPath:''' the path to the new file that should be copied into&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns '''true''' if the file pointed at by '''srcPath''' is an accessible file that can be read from and the requested file a '''dstPath''' could be created and written to, '''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;
This snippet backups a copy of client-side configuration for safety purposes.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a generic translator.&lt;br /&gt;
local resRoot = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
resRoot:copy( &amp;quot;config.xml&amp;quot;, &amp;quot;backup/config.xml&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/delete&amp;diff=73765</id>
		<title>Modules/FileSystem/translator/delete</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/delete&amp;diff=73765"/>
		<updated>2022-01-23T03:26:21Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function deletes an entry on the translator filesystem. If the path points at a directory, the whole content of it is recursively deleted. A typical reason when deletion may fail is when the file is opened in another OS handle. Proper clean-up of file classes can prevent this issue.&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 translator:delete ( string path )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''path:''' a path to a filesystem object that should be wiped out&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns '''true''' if the specified filesystem object could be completely deleted, '''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;
This snippet nukes the contents of your client-side resource. It can be used as protective measure when client-side files should not be leaked to curious users.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Nuke ourselves.&lt;br /&gt;
fileCreateTranslator( &amp;quot;/&amp;quot; ):delete( &amp;quot;/&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73764</id>
		<title>Modules/FileSystem/translator/chdir</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/FileSystem/translator/chdir&amp;diff=73764"/>
		<updated>2022-01-23T03:25:53Z</updated>

		<summary type="html">&lt;p&gt;Danilo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#3c82c8&amp;quot; subcaption=&amp;quot;Translator function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function changes the current directory pointer of the translator. All operations on the FileSystem translator are executed relative to the current directory. The translator, if possible, is asked to prevent deletion of the current directory.&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 translator:chdir ( string dirPath ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
*'''dirPath:''' a path to a directory that should be made current directory&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
This function returns '''true''' if the directory pointed at by dirPath is an existing directory and can be accessed by the translator, '''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;
This snippet creates a simple command-based filesystem explorer.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a generic FileSystem translator.&lt;br /&gt;
local cmdTranslator = fileCreateTranslator( &amp;quot;/&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
-- Set up some commands.&lt;br /&gt;
addCommandHandler( &amp;quot;chdir&amp;quot;,&lt;br /&gt;
    function(...)&lt;br /&gt;
        local myPath = table.concat( { ... }, &amp;quot; &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
        cmdTranslator:chdir( myPath );&lt;br /&gt;
    end&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( &amp;quot;dir&amp;quot;,&lt;br /&gt;
    function()&lt;br /&gt;
        -- todo: resolve a path given as arguments.&lt;br /&gt;
&lt;br /&gt;
        local myEntries = {};&lt;br /&gt;
&lt;br /&gt;
        local function itemIterator( path )&lt;br /&gt;
            table.insert( myEntries, cmdTranslator:relPath( path ) );&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        cmdTranslator:scanDirEx( &amp;quot;/&amp;quot;, &amp;quot;*&amp;quot;, itemIterator, itemIterator, false );&lt;br /&gt;
&lt;br /&gt;
        -- Output the filesystem entries to the chatbox.&lt;br /&gt;
        for m,n in ipairs( myEntries ) do&lt;br /&gt;
            outputChatBox( n );&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        -- todo: print statistics (file size, number of files, number of directories, ...)&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;
{{:Modules/FileSystem/translator/functions}}&lt;/div&gt;</summary>
		<author><name>Danilo</name></author>
	</entry>
</feed>