<?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=IManGaaX</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=IManGaaX"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/IManGaaX"/>
	<updated>2026-05-20T00:09:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82725</id>
		<title>GTA Crash Codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82725"/>
		<updated>2026-01-31T12:17:01Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add new offset 0x003F3A17&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Code: 0xC0000005 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0000F64C&amp;amp;NewLine;0x0000F663&amp;amp;NewLine;0x0000F67C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCollisionData::GetShadTrianglePoint(CVector&amp;amp;, int) const|c++}}&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;
| {{#tag:syntaxhighlight|0x00016135|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|L10n_CreateLocalization(SString strLocale)|c++}}&lt;br /&gt;
| Crash triggered when executing the console command 'showmemstat' immediately after joining the game.&lt;br /&gt;
This happens during early GUI / localization initialization, where memory statistics are requested before required pointers or localization data are fully initialized, resulting in a null pointer access.&lt;br /&gt;
Avoid using 'showmemstat' directly after game start; wait until the GUI is fully loaded. This is a client-side MTA issue related to localization and debug GUI initialization, not caused by GTA mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000193E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0006A1E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|GetLibMtaVersion(char* pBuffer, uint uiMaxSize)|c++}}&lt;br /&gt;
| Crash typically occurs during resource cleanup or GUI/localization shutdown sequence, or when a resource is stopping, or on server disconnect.&lt;br /&gt;
It may involve invalid memory access due to unhandled resources or corrupted data. Possibly caused by faulty or incompatible server-side scripts or mods.&lt;br /&gt;
&lt;br /&gt;
Recommended actions:&lt;br /&gt;
&lt;br /&gt;
Report the crash to the server owner for investigation of server scripts/mods.&lt;br /&gt;
&lt;br /&gt;
Ensure your client files are intact and updated.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000A2CF3|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|FxEmitterBP_c::Render(FxEmitterBP_c*, RwCamera*, int, float, char)|c++}}&lt;br /&gt;
| Corrupted, missing or modded GTA San Andreas\models &amp;gt; effects.fxp file.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x000C9691|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::CreateInstance()|c++}}&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;
| {{#tag:syntaxhighlight|0x000C9F98|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rwD3D9RasterLock(char**, _DWORD, signed int)|c++}}&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;
| {{#tag:syntaxhighlight|0x000CFCD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAnimBlendNode::GetCurrentTranslation(CAnimBlendNode*, CVector*, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x000D68BA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpAnimBlendClumpGetAssociation(RpClump*, int)|c++}}&lt;br /&gt;
| [https://github.com/multitheftauto/mtasa-blue/issues/447 See github issue]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000D7BD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEAudioChannel::UpdateStatus()|c++}}&lt;br /&gt;
| Possibly bad audio files&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000DFE92&amp;amp;NewLine;0x000DFF90|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEMP3BankLoader::Service(CAEMP3BankLoader*)|c++}}&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. Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000E7ED0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000F0EBA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEStaticChannel::SetAudioBuffer(OALBuffer*, ushort, short, short, ushort)|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0013388E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CreateEffects()|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00134134|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::GetBoundRect()|c++}}&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;
| {{#tag:syntaxhighlight|0x00137D6E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CFileLoader::LoadCollisionModelVer3(void*, int, CColModel*, char*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0014F3B6&amp;amp;NewLine;0x0014F406|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPlaceable::RemoveMatrix(_CPlaceable*)|c++}}&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;
| {{#tag:syntaxhighlight|0x001CD9AA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|cef_zip_reader_create(const cef_stream_reader_t* stream)|c++}}&lt;br /&gt;
| Client-side crash inside Chromium Embedded Framework (libcef.dll).&lt;br /&gt;
Occurs when entering a specific area or interacting with an element that triggers a CEF-based GUI.&lt;br /&gt;
The crash happens while creating a ZIP reader for HTML/GUI resources, due to corrupted, empty, or improperly referenced ZIP files, resulting in invalid memory access.&lt;br /&gt;
This is a server-side resource issue (faulty CEF files or paths), not caused by GTA mods.&lt;br /&gt;
Avoid the affected area or resource; server owners should verify and repackage CEF resources.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00165096|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CWorld::FindObjectsKindaCollidingSectorList(CPtrList*, RwV3d*, float, char, int*, __int16, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00171A10|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CleanUpOldReference(CEntity*, CEntity**)|c++}}&lt;br /&gt;
| Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0019BD39|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMatrix::Attach(CMatrix*, RwMatrix*m, char)|c++}}&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;
| {{#tag:syntaxhighlight|0x001A49D4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CClothesBuilder::BlendGeometry(RpClump*, char*, char*, char*, float, float, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x001B6B2F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::LoadVehicleColours()|c++}}&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). Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x001D6E6A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomBuildingDNPipeline::pluginExtraVertColourStreamReadCB(RwStream*, int, void*, int, int)|c++}}&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;
| {{#tag:syntaxhighlight|0x001E26EE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPed::ProcessEntityCollision(CPed*, CObject*, CColPoint*)|c++}}&lt;br /&gt;
| Handles collision between a ped and an object. Crash occurs if collision data is corrupt or object/ped references are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FE144|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomRoadsignMgr::Initialise()|c++}}&lt;br /&gt;
| Initializes road sign manager. Crash can happen if resources for road signs are missing, corrupted, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FEC20|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char RoadsignGenerateTextRaster(int, int, RwRaster*, int, RwRaster*)|c++}}&lt;br /&gt;
| Generates a texture (raster) for road sign text. Crash occurs if input raster is invalid, dimensions are too large, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0032F4DE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMemoryMgr::MallocAlign(int, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00330D1F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9InstanceVertexUpload(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00332B2A |c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVisibilityPlugins::GetClumpAlpha(RpClump*)|c++}}&lt;br /&gt;
| [[onClientPedDamage]] [https://github.com/multitheftauto/mtasa-blue/issues/472 bug]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00349B7B|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpClumpForAllAtomics(RpClump*, void*, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0034E85A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpMaterialListStreamRead()|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003507FB|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_WorldAtomicSync(RpAtomic*)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00354B1C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rpD3D9VertexDeclarationInstColor(char*, char*, int, int)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00357DEC|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9AtomicDefaultInstanceCallback(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003C91CC&amp;amp;NewLine;0x003C920C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpD3D9SkinGeometryReinstance(int, char*, RpHAnimHierarchy*, int)|c++}}&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.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x003EC9DA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwStreamRead(RwStreamMemory*, void*, unsigned int)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F0BF7&amp;amp;NewLine;0x003F0C37|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwFrameAddChild(RwFrame*, RwFrame*)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F18CF&amp;amp;NewLine;0x003F190F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwMatrixMultiply(RwMatrixTag*, RwMatrixTag*, RwMatrixTag*)|c++}}&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.&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;
| {{#tag:syntaxhighlight|0x003F3A17|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|GetLibMtaVersion(char* pBuffer, uint uiMaxSize)|c++}}&lt;br /&gt;
| Crash occurs during CEF-based GUI rendering while parsing SVG content (lunasvg / plutovg).&lt;br /&gt;
It is usually triggered by corrupted or malformed SVG files, improperly packaged CEF resources, or unsafe initialization/shutdown of CEF-based GUI elements.&lt;br /&gt;
This is a client-side MTA crash caused by faulty server-side CEF resources, not by GTA mods.&lt;br /&gt;
&lt;br /&gt;
Recommended actions:&lt;br /&gt;
Verify and re-export all SVG files used in CEF GUIs.&lt;br /&gt;
&lt;br /&gt;
Note: Same function as offset 0x0006A1E6, but triggered in a different context (CEF / SVG rendering).&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003F5A3A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwD3D9DynamicVertexBufferCreate()|c++}}&lt;br /&gt;
| Memory crash, usually happens on heavily unoptimized servers.&lt;br /&gt;
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;.&lt;br /&gt;
Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00423FD0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_lock_file(FILE*)|c++}}&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;
| {{#tag:syntaxhighlight|0x004A1ED4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|std::bad_alloc()|c++}}&lt;br /&gt;
| Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00771848|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char CFileLoader::ms_line[512]|c++}}&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;
| {{#tag:syntaxhighlight|0x00BFFFFF&amp;amp;NewLine;0x01162FE3&amp;amp;NewLine;0x011630F2&amp;amp;NewLine;0x011630F8&amp;amp;NewLine;0x011630FE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&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;
&lt;br /&gt;
&lt;br /&gt;
GTA:SA offset database: https://paste.ee/d/mJxro&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82724</id>
		<title>GTA Crash Codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82724"/>
		<updated>2026-01-31T05:03:16Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add argument to 0x00016135&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Code: 0xC0000005 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0000F64C&amp;amp;NewLine;0x0000F663&amp;amp;NewLine;0x0000F67C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCollisionData::GetShadTrianglePoint(CVector&amp;amp;, int) const|c++}}&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;
| {{#tag:syntaxhighlight|0x00016135|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|L10n_CreateLocalization(SString strLocale)|c++}}&lt;br /&gt;
| Crash triggered when executing the console command 'showmemstat' immediately after joining the game.&lt;br /&gt;
This happens during early GUI / localization initialization, where memory statistics are requested before required pointers or localization data are fully initialized, resulting in a null pointer access.&lt;br /&gt;
Avoid using 'showmemstat' directly after game start; wait until the GUI is fully loaded. This is a client-side MTA issue related to localization and debug GUI initialization, not caused by GTA mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000193E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0006A1E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|GetLibMtaVersion(char* pBuffer, uint uiMaxSize)|c++}}&lt;br /&gt;
| Crash typically occurs during resource cleanup or GUI/localization shutdown sequence, or when a resource is stopping, or on server disconnect.&lt;br /&gt;
It may involve invalid memory access due to unhandled resources or corrupted data. Possibly caused by faulty or incompatible server-side scripts or mods.&lt;br /&gt;
&lt;br /&gt;
Recommended actions:&lt;br /&gt;
&lt;br /&gt;
Report the crash to the server owner for investigation of server scripts/mods.&lt;br /&gt;
&lt;br /&gt;
Ensure your client files are intact and updated.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000A2CF3|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|FxEmitterBP_c::Render(FxEmitterBP_c*, RwCamera*, int, float, char)|c++}}&lt;br /&gt;
| Corrupted, missing or modded GTA San Andreas\models &amp;gt; effects.fxp file.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x000C9691|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::CreateInstance()|c++}}&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;
| {{#tag:syntaxhighlight|0x000C9F98|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rwD3D9RasterLock(char**, _DWORD, signed int)|c++}}&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;
| {{#tag:syntaxhighlight|0x000CFCD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAnimBlendNode::GetCurrentTranslation(CAnimBlendNode*, CVector*, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x000D68BA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpAnimBlendClumpGetAssociation(RpClump*, int)|c++}}&lt;br /&gt;
| [https://github.com/multitheftauto/mtasa-blue/issues/447 See github issue]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000D7BD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEAudioChannel::UpdateStatus()|c++}}&lt;br /&gt;
| Possibly bad audio files&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000DFE92&amp;amp;NewLine;0x000DFF90|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEMP3BankLoader::Service(CAEMP3BankLoader*)|c++}}&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. Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000E7ED0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000F0EBA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEStaticChannel::SetAudioBuffer(OALBuffer*, ushort, short, short, ushort)|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0013388E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CreateEffects()|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00134134|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::GetBoundRect()|c++}}&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;
| {{#tag:syntaxhighlight|0x00137D6E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CFileLoader::LoadCollisionModelVer3(void*, int, CColModel*, char*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0014F3B6&amp;amp;NewLine;0x0014F406|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPlaceable::RemoveMatrix(_CPlaceable*)|c++}}&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;
| {{#tag:syntaxhighlight|0x001CD9AA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|cef_zip_reader_create(const cef_stream_reader_t* stream)|c++}}&lt;br /&gt;
| Client-side crash inside Chromium Embedded Framework (libcef.dll).&lt;br /&gt;
Occurs when entering a specific area or interacting with an element that triggers a CEF-based GUI.&lt;br /&gt;
The crash happens while creating a ZIP reader for HTML/GUI resources, due to corrupted, empty, or improperly referenced ZIP files, resulting in invalid memory access.&lt;br /&gt;
This is a server-side resource issue (faulty CEF files or paths), not caused by GTA mods.&lt;br /&gt;
Avoid the affected area or resource; server owners should verify and repackage CEF resources.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00165096|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CWorld::FindObjectsKindaCollidingSectorList(CPtrList*, RwV3d*, float, char, int*, __int16, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00171A10|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CleanUpOldReference(CEntity*, CEntity**)|c++}}&lt;br /&gt;
| Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0019BD39|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMatrix::Attach(CMatrix*, RwMatrix*m, char)|c++}}&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;
| {{#tag:syntaxhighlight|0x001A49D4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CClothesBuilder::BlendGeometry(RpClump*, char*, char*, char*, float, float, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x001B6B2F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::LoadVehicleColours()|c++}}&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). Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x001D6E6A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomBuildingDNPipeline::pluginExtraVertColourStreamReadCB(RwStream*, int, void*, int, int)|c++}}&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;
| {{#tag:syntaxhighlight|0x001E26EE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPed::ProcessEntityCollision(CPed*, CObject*, CColPoint*)|c++}}&lt;br /&gt;
| Handles collision between a ped and an object. Crash occurs if collision data is corrupt or object/ped references are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FE144|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomRoadsignMgr::Initialise()|c++}}&lt;br /&gt;
| Initializes road sign manager. Crash can happen if resources for road signs are missing, corrupted, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FEC20|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char RoadsignGenerateTextRaster(int, int, RwRaster*, int, RwRaster*)|c++}}&lt;br /&gt;
| Generates a texture (raster) for road sign text. Crash occurs if input raster is invalid, dimensions are too large, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0032F4DE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMemoryMgr::MallocAlign(int, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00330D1F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9InstanceVertexUpload(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00332B2A |c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVisibilityPlugins::GetClumpAlpha(RpClump*)|c++}}&lt;br /&gt;
| [[onClientPedDamage]] [https://github.com/multitheftauto/mtasa-blue/issues/472 bug]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00349B7B|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpClumpForAllAtomics(RpClump*, void*, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0034E85A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpMaterialListStreamRead()|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003507FB|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_WorldAtomicSync(RpAtomic*)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00354B1C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rpD3D9VertexDeclarationInstColor(char*, char*, int, int)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00357DEC|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9AtomicDefaultInstanceCallback(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003C91CC&amp;amp;NewLine;0x003C920C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpD3D9SkinGeometryReinstance(int, char*, RpHAnimHierarchy*, int)|c++}}&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.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x003EC9DA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwStreamRead(RwStreamMemory*, void*, unsigned int)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F0BF7&amp;amp;NewLine;0x003F0C37|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwFrameAddChild(RwFrame*, RwFrame*)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F18CF&amp;amp;NewLine;0x003F190F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwMatrixMultiply(RwMatrixTag*, RwMatrixTag*, RwMatrixTag*)|c++}}&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.&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;
| {{#tag:syntaxhighlight|0x003F5A3A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwD3D9DynamicVertexBufferCreate()|c++}}&lt;br /&gt;
| Memory crash, usually happens on heavily unoptimized servers.&lt;br /&gt;
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;.&lt;br /&gt;
Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00423FD0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_lock_file(FILE*)|c++}}&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;
| {{#tag:syntaxhighlight|0x004A1ED4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|std::bad_alloc()|c++}}&lt;br /&gt;
| Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00771848|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char CFileLoader::ms_line[512]|c++}}&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;
| {{#tag:syntaxhighlight|0x00BFFFFF&amp;amp;NewLine;0x01162FE3&amp;amp;NewLine;0x011630F2&amp;amp;NewLine;0x011630F8&amp;amp;NewLine;0x011630FE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&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;
&lt;br /&gt;
&lt;br /&gt;
GTA:SA offset database: https://paste.ee/d/mJxro&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82723</id>
		<title>GTA Crash Codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82723"/>
		<updated>2026-01-31T04:55:41Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add new offset 0x0006A1E6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Code: 0xC0000005 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0000F64C&amp;amp;NewLine;0x0000F663&amp;amp;NewLine;0x0000F67C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCollisionData::GetShadTrianglePoint(CVector&amp;amp;, int) const|c++}}&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;
| {{#tag:syntaxhighlight|0x00016135|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|L10n_CreateLocalization()|c++}}&lt;br /&gt;
| Crash triggered when executing the console command 'showmemstat' immediately after joining the game.&lt;br /&gt;
This happens during early GUI / localization initialization, where memory statistics are requested before required pointers or localization data are fully initialized, resulting in a null pointer access.&lt;br /&gt;
Avoid using 'showmemstat' directly after game start; wait until the GUI is fully loaded. This is a client-side MTA issue related to localization and debug GUI initialization, not caused by GTA mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000193E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0006A1E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|GetLibMtaVersion(char* pBuffer, uint uiMaxSize)|c++}}&lt;br /&gt;
| Crash typically occurs during resource cleanup or GUI/localization shutdown sequence, or when a resource is stopping, or on server disconnect.&lt;br /&gt;
It may involve invalid memory access due to unhandled resources or corrupted data. Possibly caused by faulty or incompatible server-side scripts or mods.&lt;br /&gt;
&lt;br /&gt;
Recommended actions:&lt;br /&gt;
&lt;br /&gt;
Report the crash to the server owner for investigation of server scripts/mods.&lt;br /&gt;
&lt;br /&gt;
Ensure your client files are intact and updated.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000A2CF3|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|FxEmitterBP_c::Render(FxEmitterBP_c*, RwCamera*, int, float, char)|c++}}&lt;br /&gt;
| Corrupted, missing or modded GTA San Andreas\models &amp;gt; effects.fxp file.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x000C9691|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::CreateInstance()|c++}}&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;
| {{#tag:syntaxhighlight|0x000C9F98|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rwD3D9RasterLock(char**, _DWORD, signed int)|c++}}&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;
| {{#tag:syntaxhighlight|0x000CFCD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAnimBlendNode::GetCurrentTranslation(CAnimBlendNode*, CVector*, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x000D68BA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpAnimBlendClumpGetAssociation(RpClump*, int)|c++}}&lt;br /&gt;
| [https://github.com/multitheftauto/mtasa-blue/issues/447 See github issue]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000D7BD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEAudioChannel::UpdateStatus()|c++}}&lt;br /&gt;
| Possibly bad audio files&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000DFE92&amp;amp;NewLine;0x000DFF90|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEMP3BankLoader::Service(CAEMP3BankLoader*)|c++}}&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. Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000E7ED0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000F0EBA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEStaticChannel::SetAudioBuffer(OALBuffer*, ushort, short, short, ushort)|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0013388E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CreateEffects()|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00134134|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::GetBoundRect()|c++}}&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;
| {{#tag:syntaxhighlight|0x00137D6E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CFileLoader::LoadCollisionModelVer3(void*, int, CColModel*, char*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0014F3B6&amp;amp;NewLine;0x0014F406|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPlaceable::RemoveMatrix(_CPlaceable*)|c++}}&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;
| {{#tag:syntaxhighlight|0x001CD9AA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|cef_zip_reader_create(const cef_stream_reader_t* stream)|c++}}&lt;br /&gt;
| Client-side crash inside Chromium Embedded Framework (libcef.dll).&lt;br /&gt;
Occurs when entering a specific area or interacting with an element that triggers a CEF-based GUI.&lt;br /&gt;
The crash happens while creating a ZIP reader for HTML/GUI resources, due to corrupted, empty, or improperly referenced ZIP files, resulting in invalid memory access.&lt;br /&gt;
This is a server-side resource issue (faulty CEF files or paths), not caused by GTA mods.&lt;br /&gt;
Avoid the affected area or resource; server owners should verify and repackage CEF resources.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00165096|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CWorld::FindObjectsKindaCollidingSectorList(CPtrList*, RwV3d*, float, char, int*, __int16, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00171A10|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CleanUpOldReference(CEntity*, CEntity**)|c++}}&lt;br /&gt;
| Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0019BD39|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMatrix::Attach(CMatrix*, RwMatrix*m, char)|c++}}&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;
| {{#tag:syntaxhighlight|0x001A49D4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CClothesBuilder::BlendGeometry(RpClump*, char*, char*, char*, float, float, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x001B6B2F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::LoadVehicleColours()|c++}}&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). Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x001D6E6A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomBuildingDNPipeline::pluginExtraVertColourStreamReadCB(RwStream*, int, void*, int, int)|c++}}&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;
| {{#tag:syntaxhighlight|0x001E26EE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPed::ProcessEntityCollision(CPed*, CObject*, CColPoint*)|c++}}&lt;br /&gt;
| Handles collision between a ped and an object. Crash occurs if collision data is corrupt or object/ped references are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FE144|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomRoadsignMgr::Initialise()|c++}}&lt;br /&gt;
| Initializes road sign manager. Crash can happen if resources for road signs are missing, corrupted, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FEC20|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char RoadsignGenerateTextRaster(int, int, RwRaster*, int, RwRaster*)|c++}}&lt;br /&gt;
| Generates a texture (raster) for road sign text. Crash occurs if input raster is invalid, dimensions are too large, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0032F4DE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMemoryMgr::MallocAlign(int, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00330D1F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9InstanceVertexUpload(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00332B2A |c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVisibilityPlugins::GetClumpAlpha(RpClump*)|c++}}&lt;br /&gt;
| [[onClientPedDamage]] [https://github.com/multitheftauto/mtasa-blue/issues/472 bug]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00349B7B|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpClumpForAllAtomics(RpClump*, void*, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0034E85A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpMaterialListStreamRead()|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003507FB|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_WorldAtomicSync(RpAtomic*)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00354B1C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rpD3D9VertexDeclarationInstColor(char*, char*, int, int)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00357DEC|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9AtomicDefaultInstanceCallback(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003C91CC&amp;amp;NewLine;0x003C920C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpD3D9SkinGeometryReinstance(int, char*, RpHAnimHierarchy*, int)|c++}}&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.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x003EC9DA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwStreamRead(RwStreamMemory*, void*, unsigned int)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F0BF7&amp;amp;NewLine;0x003F0C37|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwFrameAddChild(RwFrame*, RwFrame*)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F18CF&amp;amp;NewLine;0x003F190F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwMatrixMultiply(RwMatrixTag*, RwMatrixTag*, RwMatrixTag*)|c++}}&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.&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;
| {{#tag:syntaxhighlight|0x003F5A3A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwD3D9DynamicVertexBufferCreate()|c++}}&lt;br /&gt;
| Memory crash, usually happens on heavily unoptimized servers.&lt;br /&gt;
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;.&lt;br /&gt;
Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00423FD0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_lock_file(FILE*)|c++}}&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;
| {{#tag:syntaxhighlight|0x004A1ED4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|std::bad_alloc()|c++}}&lt;br /&gt;
| Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00771848|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char CFileLoader::ms_line[512]|c++}}&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;
| {{#tag:syntaxhighlight|0x00BFFFFF&amp;amp;NewLine;0x01162FE3&amp;amp;NewLine;0x011630F2&amp;amp;NewLine;0x011630F8&amp;amp;NewLine;0x011630FE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&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;
&lt;br /&gt;
&lt;br /&gt;
GTA:SA offset database: https://paste.ee/d/mJxro&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82722</id>
		<title>GTA Crash Codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82722"/>
		<updated>2026-01-30T21:08:32Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add new offset 0x001CD9AA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Code: 0xC0000005 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0000F64C&amp;amp;NewLine;0x0000F663&amp;amp;NewLine;0x0000F67C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCollisionData::GetShadTrianglePoint(CVector&amp;amp;, int) const|c++}}&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;
| {{#tag:syntaxhighlight|0x00016135|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|L10n_CreateLocalization()|c++}}&lt;br /&gt;
| Crash triggered when executing the console command 'showmemstat' immediately after joining the game.&lt;br /&gt;
This happens during early GUI / localization initialization, where memory statistics are requested before required pointers or localization data are fully initialized, resulting in a null pointer access.&lt;br /&gt;
Avoid using 'showmemstat' directly after game start; wait until the GUI is fully loaded. This is a client-side MTA issue related to localization and debug GUI initialization, not caused by GTA mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000193E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000A2CF3|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|FxEmitterBP_c::Render(FxEmitterBP_c*, RwCamera*, int, float, char)|c++}}&lt;br /&gt;
| Corrupted, missing or modded GTA San Andreas\models &amp;gt; effects.fxp file.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x000C9691|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::CreateInstance()|c++}}&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;
| {{#tag:syntaxhighlight|0x000C9F98|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rwD3D9RasterLock(char**, _DWORD, signed int)|c++}}&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;
| {{#tag:syntaxhighlight|0x000CFCD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAnimBlendNode::GetCurrentTranslation(CAnimBlendNode*, CVector*, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x000D68BA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpAnimBlendClumpGetAssociation(RpClump*, int)|c++}}&lt;br /&gt;
| [https://github.com/multitheftauto/mtasa-blue/issues/447 See github issue]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000D7BD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEAudioChannel::UpdateStatus()|c++}}&lt;br /&gt;
| Possibly bad audio files&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000DFE92&amp;amp;NewLine;0x000DFF90|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEMP3BankLoader::Service(CAEMP3BankLoader*)|c++}}&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. Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000E7ED0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000F0EBA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEStaticChannel::SetAudioBuffer(OALBuffer*, ushort, short, short, ushort)|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0013388E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CreateEffects()|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00134134|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::GetBoundRect()|c++}}&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;
| {{#tag:syntaxhighlight|0x00137D6E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CFileLoader::LoadCollisionModelVer3(void*, int, CColModel*, char*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0014F3B6&amp;amp;NewLine;0x0014F406|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPlaceable::RemoveMatrix(_CPlaceable*)|c++}}&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;
| {{#tag:syntaxhighlight|0x001CD9AA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|cef_zip_reader_create(const cef_stream_reader_t* stream)|c++}}&lt;br /&gt;
| Client-side crash inside Chromium Embedded Framework (libcef.dll).&lt;br /&gt;
Occurs when entering a specific area or interacting with an element that triggers a CEF-based GUI.&lt;br /&gt;
The crash happens while creating a ZIP reader for HTML/GUI resources, due to corrupted, empty, or improperly referenced ZIP files, resulting in invalid memory access.&lt;br /&gt;
This is a server-side resource issue (faulty CEF files or paths), not caused by GTA mods.&lt;br /&gt;
Avoid the affected area or resource; server owners should verify and repackage CEF resources.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00165096|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CWorld::FindObjectsKindaCollidingSectorList(CPtrList*, RwV3d*, float, char, int*, __int16, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00171A10|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CleanUpOldReference(CEntity*, CEntity**)|c++}}&lt;br /&gt;
| Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0019BD39|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMatrix::Attach(CMatrix*, RwMatrix*m, char)|c++}}&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;
| {{#tag:syntaxhighlight|0x001A49D4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CClothesBuilder::BlendGeometry(RpClump*, char*, char*, char*, float, float, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x001B6B2F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::LoadVehicleColours()|c++}}&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). Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x001D6E6A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomBuildingDNPipeline::pluginExtraVertColourStreamReadCB(RwStream*, int, void*, int, int)|c++}}&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;
| {{#tag:syntaxhighlight|0x001E26EE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPed::ProcessEntityCollision(CPed*, CObject*, CColPoint*)|c++}}&lt;br /&gt;
| Handles collision between a ped and an object. Crash occurs if collision data is corrupt or object/ped references are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FE144|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomRoadsignMgr::Initialise()|c++}}&lt;br /&gt;
| Initializes road sign manager. Crash can happen if resources for road signs are missing, corrupted, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FEC20|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char RoadsignGenerateTextRaster(int, int, RwRaster*, int, RwRaster*)|c++}}&lt;br /&gt;
| Generates a texture (raster) for road sign text. Crash occurs if input raster is invalid, dimensions are too large, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0032F4DE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMemoryMgr::MallocAlign(int, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00330D1F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9InstanceVertexUpload(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00332B2A |c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVisibilityPlugins::GetClumpAlpha(RpClump*)|c++}}&lt;br /&gt;
| [[onClientPedDamage]] [https://github.com/multitheftauto/mtasa-blue/issues/472 bug]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00349B7B|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpClumpForAllAtomics(RpClump*, void*, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0034E85A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpMaterialListStreamRead()|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003507FB|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_WorldAtomicSync(RpAtomic*)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00354B1C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rpD3D9VertexDeclarationInstColor(char*, char*, int, int)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00357DEC|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9AtomicDefaultInstanceCallback(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003C91CC&amp;amp;NewLine;0x003C920C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpD3D9SkinGeometryReinstance(int, char*, RpHAnimHierarchy*, int)|c++}}&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.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x003EC9DA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwStreamRead(RwStreamMemory*, void*, unsigned int)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F0BF7&amp;amp;NewLine;0x003F0C37|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwFrameAddChild(RwFrame*, RwFrame*)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F18CF&amp;amp;NewLine;0x003F190F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwMatrixMultiply(RwMatrixTag*, RwMatrixTag*, RwMatrixTag*)|c++}}&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.&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;
| {{#tag:syntaxhighlight|0x003F5A3A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwD3D9DynamicVertexBufferCreate()|c++}}&lt;br /&gt;
| Memory crash, usually happens on heavily unoptimized servers.&lt;br /&gt;
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;.&lt;br /&gt;
Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00423FD0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_lock_file(FILE*)|c++}}&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;
| {{#tag:syntaxhighlight|0x004A1ED4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|std::bad_alloc()|c++}}&lt;br /&gt;
| Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00771848|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char CFileLoader::ms_line[512]|c++}}&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;
| {{#tag:syntaxhighlight|0x00BFFFFF&amp;amp;NewLine;0x01162FE3&amp;amp;NewLine;0x011630F2&amp;amp;NewLine;0x011630F8&amp;amp;NewLine;0x011630FE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&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;
&lt;br /&gt;
&lt;br /&gt;
GTA:SA offset database: https://paste.ee/d/mJxro&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82721</id>
		<title>GTA Crash Codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GTA_Crash_Codes&amp;diff=82721"/>
		<updated>2026-01-30T04:27:18Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add new offset&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Code: 0xC0000005 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0000F64C&amp;amp;NewLine;0x0000F663&amp;amp;NewLine;0x0000F67C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCollisionData::GetShadTrianglePoint(CVector&amp;amp;, int) const|c++}}&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;
| {{#tag:syntaxhighlight|0x00016135|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|L10n_CreateLocalization()|c++}}&lt;br /&gt;
| Crash triggered when executing the console command 'showmemstat' immediately after joining the game.&lt;br /&gt;
This happens during early GUI / localization initialization, where memory statistics are requested before required pointers or localization data are fully initialized, resulting in a null pointer access.&lt;br /&gt;
Avoid using 'showmemstat' directly after game start; wait until the GUI is fully loaded. This is a client-side MTA issue related to localization and debug GUI initialization, not caused by GTA mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000193E6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000A2CF3|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|FxEmitterBP_c::Render(FxEmitterBP_c*, RwCamera*, int, float, char)|c++}}&lt;br /&gt;
| Corrupted, missing or modded GTA San Andreas\models &amp;gt; effects.fxp file.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x000C9691|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::CreateInstance()|c++}}&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;
| {{#tag:syntaxhighlight|0x000C9F98|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rwD3D9RasterLock(char**, _DWORD, signed int)|c++}}&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;
| {{#tag:syntaxhighlight|0x000CFCD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAnimBlendNode::GetCurrentTranslation(CAnimBlendNode*, CVector*, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x000D68BA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpAnimBlendClumpGetAssociation(RpClump*, int)|c++}}&lt;br /&gt;
| [https://github.com/multitheftauto/mtasa-blue/issues/447 See github issue]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000D7BD6|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEAudioChannel::UpdateStatus()|c++}}&lt;br /&gt;
| Possibly bad audio files&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000DFE92&amp;amp;NewLine;0x000DFF90|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEMP3BankLoader::Service(CAEMP3BankLoader*)|c++}}&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. Do not use 'compressed' GTA re-packs for this reason of cut-out audio files.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000E7ED0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x000F0EBA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CAEStaticChannel::SetAudioBuffer(OALBuffer*, ushort, short, short, ushort)|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0013388E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CreateEffects()|c++}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00134134|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::GetBoundRect()|c++}}&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;
| {{#tag:syntaxhighlight|0x00137D6E|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CFileLoader::LoadCollisionModelVer3(void*, int, CColModel*, char*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0014F3B6&amp;amp;NewLine;0x0014F406|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPlaceable::RemoveMatrix(_CPlaceable*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00165096|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CWorld::FindObjectsKindaCollidingSectorList(CPtrList*, RwV3d*, float, char, int*, __int16, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x00171A10|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CEntity::CleanUpOldReference(CEntity*, CEntity**)|c++}}&lt;br /&gt;
| Sometimes when joining a server, maybe related to bad server mods.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0019BD39|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMatrix::Attach(CMatrix*, RwMatrix*m, char)|c++}}&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;
| {{#tag:syntaxhighlight|0x001A49D4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CClothesBuilder::BlendGeometry(RpClump*, char*, char*, char*, float, float, float)|c++}}&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;
| {{#tag:syntaxhighlight|0x001B6B2F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVehicleModelInfo::LoadVehicleColours()|c++}}&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). Use unmodded GTA install to check&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x001D6E6A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomBuildingDNPipeline::pluginExtraVertColourStreamReadCB(RwStream*, int, void*, int, int)|c++}}&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;
| {{#tag:syntaxhighlight|0x001E26EE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CPed::ProcessEntityCollision(CPed*, CObject*, CColPoint*)|c++}}&lt;br /&gt;
| Handles collision between a ped and an object. Crash occurs if collision data is corrupt or object/ped references are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FE144|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CCustomRoadsignMgr::Initialise()|c++}}&lt;br /&gt;
| Initializes road sign manager. Crash can happen if resources for road signs are missing, corrupted, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x002FEC20|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char RoadsignGenerateTextRaster(int, int, RwRaster*, int, RwRaster*)|c++}}&lt;br /&gt;
| Generates a texture (raster) for road sign text. Crash occurs if input raster is invalid, dimensions are too large, or memory allocation fails.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x0032F4DE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CMemoryMgr::MallocAlign(int, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00330D1F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9InstanceVertexUpload(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00332B2A |c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|CVisibilityPlugins::GetClumpAlpha(RpClump*)|c++}}&lt;br /&gt;
| [[onClientPedDamage]] [https://github.com/multitheftauto/mtasa-blue/issues/472 bug]&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00349B7B|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RpClumpForAllAtomics(RpClump*, void*, void*)|c++}}&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;
| {{#tag:syntaxhighlight|0x0034E85A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpMaterialListStreamRead()|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003507FB|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_WorldAtomicSync(RpAtomic*)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00354B1C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_rpD3D9VertexDeclarationInstColor(char*, char*, int, int)|c++}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00357DEC|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_D3D9AtomicDefaultInstanceCallback(RpAtomic*, RxD3D9ResEntryHeaderWithMeshes*, int)|c++}}&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x003C91CC&amp;amp;NewLine;0x003C920C|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|__rpD3D9SkinGeometryReinstance(int, char*, RpHAnimHierarchy*, int)|c++}}&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.&lt;br /&gt;
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;
| {{#tag:syntaxhighlight|0x003EC9DA|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwStreamRead(RwStreamMemory*, void*, unsigned int)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F0BF7&amp;amp;NewLine;0x003F0C37|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwFrameAddChild(RwFrame*, RwFrame*)|c++}}&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;
| {{#tag:syntaxhighlight|0x003F18CF&amp;amp;NewLine;0x003F190F|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|RwMatrixMultiply(RwMatrixTag*, RwMatrixTag*, RwMatrixTag*)|c++}}&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.&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;
| {{#tag:syntaxhighlight|0x003F5A3A|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_RwD3D9DynamicVertexBufferCreate()|c++}}&lt;br /&gt;
| Memory crash, usually happens on heavily unoptimized servers.&lt;br /&gt;
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;.&lt;br /&gt;
Contact the server owner and ask for optimization, or find other servers to play on.&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00423FD0|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|_lock_file(FILE*)|c++}}&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;
| {{#tag:syntaxhighlight|0x004A1ED4|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|std::bad_alloc()|c++}}&lt;br /&gt;
| Out of system memory (RAM)&lt;br /&gt;
|-&lt;br /&gt;
| {{#tag:syntaxhighlight|0x00771848|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|char CFileLoader::ms_line[512]|c++}}&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;
| {{#tag:syntaxhighlight|0x00BFFFFF&amp;amp;NewLine;0x01162FE3&amp;amp;NewLine;0x011630F2&amp;amp;NewLine;0x011630F8&amp;amp;NewLine;0x011630FE|c++}}&lt;br /&gt;
| {{#tag:syntaxhighlight|???|c++}}&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;
&lt;br /&gt;
&lt;br /&gt;
GTA:SA offset database: https://paste.ee/d/mJxro&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetResourceRootElement&amp;diff=82712</id>
		<title>GetResourceRootElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetResourceRootElement&amp;diff=82712"/>
		<updated>2026-01-26T09:33:28Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- i believe this function is unnecessary because there is a constant variable called resourceRoot / iManGaaX / @MTA_DEV --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function retrieves a resource's root element. The resource's root element is the element in the element tree which is the parent of all elements that belong to a particular resource (except for elements specifically created elsewhere). You can attach event handlers to this element to easily capture events that originate from your resource (and global events that originate from the root element).&lt;br /&gt;
&lt;br /&gt;
Note: every resource has a [[Predefined_variables_list|predefined global variable]] called ''resourceRoot'' whose value is the root element of that resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getResourceRootElement ( [resource theResource=getThisResource()] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[resource]]:getRootElement|rootElement}}&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''theResource:''' the resource whose root element we are getting. If not specified, assumes the current resource. (the resource returned from [[getThisResource]])&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''element'' representing the resource's root, ''false'' if the specified resource doesn't exist.&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 example retrieves the current resource's root element and attaches it to an onResourceStart event handler. This causes the event handler to get called only when the ''current'' resource is started rather than when ''any'' resource is started, thereby reducing unnecessary overhead.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- get the root element of this resource (the resource that the script is a part of)&lt;br /&gt;
resourceRoot = getResourceRootElement()&lt;br /&gt;
&lt;br /&gt;
-- create a function to handle the onResourceStart event&lt;br /&gt;
function onCurrentResourceStart(theResource)&lt;br /&gt;
    local resourceName = getResourceName(theResource)&lt;br /&gt;
    outputChatBox(&amp;quot;Hello and welcome to &amp;quot; .. resourceName .. &amp;quot;!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add the event handler&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, onCurrentResourceStart)&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;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxDrawProgressBar&amp;diff=82692</id>
		<title>DxDrawProgressBar</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxDrawProgressBar&amp;diff=82692"/>
		<updated>2026-01-07T13:26:24Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function simulates a progress bar drawed using DirectDraw. (Note this will only work client-side and you need to call it on each frame)&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;dxDrawProgressBar(float startX, float startY, float width, float height, float progress, int color, int backColor)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* '''startX''': An float representing the absolute origin X position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''startY''': An float representing the absolute origin Y position of the rectangle, represented by pixels on the screen.&lt;br /&gt;
* '''width''': An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.&lt;br /&gt;
* '''height''': An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.&lt;br /&gt;
* '''progress''': a float ranging from 0 to 100&lt;br /&gt;
* '''color''':  the hex color of the progress bar, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue)&lt;br /&gt;
* '''backColor''':  the hex color of the background, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue)&lt;br /&gt;
&lt;br /&gt;
===Return===&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local unlerp = function(from,to,lerp) return (lerp-from)/(to-from) end&lt;br /&gt;
 &lt;br /&gt;
function dxDrawProgressBar( startX, startY, width, height, progress, color, backColor )&lt;br /&gt;
    local progress = math.max( 0, (math.min( 100, progress) ) )&lt;br /&gt;
    local wBar = width*.18&lt;br /&gt;
    for i = 0, 4 do&lt;br /&gt;
        --back&lt;br /&gt;
        local startPos = (wBar*i + (width*.025)*i) + startX&lt;br /&gt;
        dxDrawRectangle( startPos, startY, wBar, height, backColor )&lt;br /&gt;
        --progress&lt;br /&gt;
        local eInterval = (i*20)&lt;br /&gt;
        local localProgress = math.min( 1, unlerp( eInterval, eInterval + 20, progress ) )&lt;br /&gt;
        if localProgress &amp;gt; 0 then&lt;br /&gt;
            dxDrawRectangle( startPos, startY, wBar*localProgress, height, color )&lt;br /&gt;
        end&lt;br /&gt;
    end&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;
&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 example draws a progress bar in the top-left corner of the screen, with a random progress that changes every frame.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function draw()&lt;br /&gt;
    dxDrawProgressBar(10, 10, 200, 200, math.random(0, 100), tocolor(250, 50, 50, 255), tocolor( 255, 255, 255, 255))&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, draw)  -- Keep everything visible with onClientRender.&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>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82688</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82688"/>
		<updated>2026-01-03T21:42:31Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|320px|right|[[Image:SetVehicleDirtEnabled-true.png|320px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function isVehicleDirtEnabled(theVehicle)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'isVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&lt;br /&gt;
&lt;br /&gt;
--// Also u can use 'isVehicleDirtEnabled' to check.&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementInWater&amp;diff=82684</id>
		<title>IsElementInWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementInWater&amp;diff=82684"/>
		<updated>2026-01-02T15:30:33Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks whether an [[element]] is submerged in water.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isElementInWater ( element theElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:isInWater|inWater}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the passed element is in water, ''false'' if it isn't, or if the element is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Creates a command that checks if the player is in water or not.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function waterCheck(thePlayer)&lt;br /&gt;
    if isElementInWater(thePlayer) then&lt;br /&gt;
        outputChatBox(&amp;quot;Wet.&amp;quot;, thePlayer)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Dry.&amp;quot;, thePlayer)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;check&amp;quot;, waterCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function which checks if player is in water, which is triggered when player dies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function diedInWater()&lt;br /&gt;
   if isElementInWater(source) then&lt;br /&gt;
       local name = source == localPlayer and &amp;quot;You are&amp;quot; or getPlayerName(source)..&amp;quot; is&amp;quot;&lt;br /&gt;
       outputChatBox(name..&amp;quot; sleeping with the fishies!&amp;quot;)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, root, diedInWater)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function which checks if player is in water and then kills the player after 3 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
    setTimer(function()&lt;br /&gt;
        if isElementInWater(localPlayer) then&lt;br /&gt;
            setElementHealth(localPlayer, 0)&lt;br /&gt;
        end&lt;br /&gt;
    end, 3000, 0)&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementInWater&amp;diff=82683</id>
		<title>IsElementInWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementInWater&amp;diff=82683"/>
		<updated>2026-01-02T15:30:08Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks whether an [[element]] is submerged in water.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isElementInWater ( element theElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:isInWater|inWater}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the passed element is in water, ''false'' if it isn't, or if the element is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Creates a command that checks if the player is in water or not.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function waterCheck(thePlayer)&lt;br /&gt;
    if isElementInWater(thePlayer) then&lt;br /&gt;
        outputChatBox(&amp;quot;Wet.&amp;quot;, thePlayer)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;Dry.&amp;quot;, thePlayer)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;check&amp;quot;, waterCheck)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function which checks if player is in water, which is triggered when player dies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function diedInWater()&lt;br /&gt;
   if isElementInWater(source) then&lt;br /&gt;
       local name = source == localPlayer and &amp;quot;You are&amp;quot; or getPlayerName(source)..&amp;quot; is&amp;quot;&lt;br /&gt;
       outputChatBox(name..&amp;quot; sleeping with the fishies!&amp;quot;)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, root, diedInWater)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function which checks if player is in water and then kills the player after 3 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler (&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
    setTimer(function()&lt;br /&gt;
        if isElementInWater(localPlayer) then&lt;br /&gt;
            setElementHealth(localPlayer, 0)&lt;br /&gt;
        end&lt;br /&gt;
    end, 3000, 0)&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=82681</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=82681"/>
		<updated>2026-01-02T15:29:04Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server_client_function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve a list of all elements of the specified type. This can be useful, as it disregards ''where'' in the element tree it is. It can be used with either the built in types (listed below) or with any custom type used in a .map file. For example, if there is an element of type &amp;quot;flag&amp;quot; (e.g. &amp;lt;flag /&amp;gt;) in the .map file, the using &amp;quot;flag&amp;quot; as the type argument would find it.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string theType, [ element startat=getRootElement() ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string theType, [ element startat=getRootElement(), bool streamedIn=false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP|This function is a static function underneath the Element class.|[[Element]].getAllByType||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of element you want a list of. This is the same as the tag name in the .map file, so this can be used with a custom element type if desired. Built in types can be found here: [[Element]]&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;ped&amp;quot;:''' A ped&lt;br /&gt;
**'''&amp;quot;water&amp;quot;:''' A water polygon&lt;br /&gt;
**'''&amp;quot;sound&amp;quot;:''' A playing sound&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''' A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;colshape&amp;quot;:''' A collision shape&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;radararea&amp;quot;:''' A radar area&lt;br /&gt;
**'''&amp;quot;team&amp;quot;:''' A team&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
**'''&amp;quot;projectile&amp;quot;:''' A clientside projectile&lt;br /&gt;
**'''&amp;quot;effect&amp;quot;:''' A clientside effect&lt;br /&gt;
**'''&amp;quot;light&amp;quot;:''' A clientside light&lt;br /&gt;
**'''&amp;quot;searchlight&amp;quot;:''' A clientside searchlight&lt;br /&gt;
**'''&amp;quot;shader&amp;quot;:''' A shader&lt;br /&gt;
**'''&amp;quot;texture&amp;quot;:''' A texture&lt;br /&gt;
**'''&amp;quot;gui-window&amp;quot;:''' A GUI window (there's others like this for other GUI types)&lt;br /&gt;
**'''&amp;quot;building&amp;quot;:''' A building (client side only)&lt;br /&gt;
**'''&amp;quot;resource&amp;quot;:''' All the loaded resources&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''startat:''' The [[element]] the search should start at. Children of this element are searched, siblings or parents will not be found. By default, this is the root element which should suit most uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
*'''streamedIn:''' If true, function will only return elements that are streamed in.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example retrieves a table of the players in the server, and checks whether or not each one is in a vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local players = getElementsByType ( &amp;quot;player&amp;quot; ) -- get a table of all the players in the server&lt;br /&gt;
for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player&lt;br /&gt;
   if ( isPlayerInVehicle ( thePlayer ) ) then -- if the player is in a vehicle, announce it&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is in a vehicle&amp;quot; )&lt;br /&gt;
   else -- if the player isn't in a vehicle, announce that he/she is on foot&lt;br /&gt;
      outputChatBox ( getPlayerName ( thePlayer ) .. &amp;quot; is on foot&amp;quot; )&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example retrieves a table of the teams in the server, and display them in chat:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local teams = getElementsByType(&amp;quot;team&amp;quot;)&lt;br /&gt;
for i,team in ipairs(teams) do&lt;br /&gt;
   local teamName = getTeamName(team) -- get the team name&lt;br /&gt;
   outputChatBox(teamName) -- display the team name in chat&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This shows how you could create a new element to describe a gas station:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createGasStations(below)&lt;br /&gt;
    local gasstations = getElementsByType ( &amp;quot;gasstation&amp;quot;, below ) -- get a table of all the gas station elements in the element tree&lt;br /&gt;
    for theKey,theGasStation in ipairs(gasstations) do &lt;br /&gt;
        local x = getElementData(theGasStation, &amp;quot;posX&amp;quot;) -- get the position of the element&lt;br /&gt;
        local y = getElementData(theGasStation, &amp;quot;posY&amp;quot;)&lt;br /&gt;
        local z = getElementData(theGasStation, &amp;quot;posZ&amp;quot;)&lt;br /&gt;
        setElementParent(createColSphere(x, y, z, 10), theGasStation) -- create a colshape for the gas station at the gas station's position&lt;br /&gt;
        addEventHandler(&amp;quot;onColShapeHit&amp;quot;, theGasStation, giveGas) -- when the player hits&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mapLoad()&lt;br /&gt;
    createGasStations(source) -- create gas stations for the map that's just loaded&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, mapLoad)&lt;br /&gt;
&lt;br /&gt;
function giveGas(hittingElement)&lt;br /&gt;
    local theGasStation = source&lt;br /&gt;
    if getElementType(hittingElement) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        local gas_left = getElementData(theGasStation, &amp;quot;amount&amp;quot;)&lt;br /&gt;
        local gas_speed = getElementData(theGasStation, &amp;quot;speed&amp;quot;)&lt;br /&gt;
        if gas_left &amp;gt; 0 then&lt;br /&gt;
&lt;br /&gt;
            local gas_to_remove = gas_speed &lt;br /&gt;
            if gas_left &amp;lt; gas_speed then&lt;br /&gt;
                gas_to_remove = gas_left&lt;br /&gt;
&lt;br /&gt;
            local current_vehicle_gas = getElementData(hittingElement, &amp;quot;gas&amp;quot;)&lt;br /&gt;
            current_vehicle_gas = current_vehicle_gas + gas_to_remove&lt;br /&gt;
            gas_left = gas_left - gas_to_remove&lt;br /&gt;
&lt;br /&gt;
            setElementData(hittingElement, &amp;quot;gas&amp;quot;, current_vehicle_gas)&lt;br /&gt;
            setElementData(theGasStation, &amp;quot;amount&amp;quot;, gas_left)&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox(&amp;quot;Pump is out of gas!&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 4:''' This example loops trough all connected players and redirects them to another server host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local serverIP = &amp;quot;99.88.77.66&amp;quot; -- Change to your server IP to redirect everyone&lt;br /&gt;
local serverPort = 22005 -- The destination server's port&lt;br /&gt;
&lt;br /&gt;
function redirectAllPlayers()&lt;br /&gt;
    for _, p in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do&lt;br /&gt;
        if isElement(p) then&lt;br /&gt;
            redirectPlayer(p, serverIP, serverPort)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, redirectAllPlayers)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementAlpha&amp;diff=82680</id>
		<title>SetElementAlpha</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementAlpha&amp;diff=82680"/>
		<updated>2026-01-02T15:26:48Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
[[file:SetElementAlpha.png|400px|thumb|right|Player ped alpha demonstration. Shown alpha levels are 255, 100 and 0 (left to right).]]&lt;br /&gt;
This function sets the alpha (transparency) value for the specified [[element]]. This can be a [[player]], [[ped]], [[object]], [[vehicle]] or [[Element/Weapon|weapon]].&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 setElementAlpha ( element theElement, int alpha )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setAlpha|alpha|getElementAlpha}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The [[element]] whose alpha you want to set.&lt;br /&gt;
*'''alpha:'''  The alpha value to set. Values are 0-255, where 255 is fully opaque and 0 is fully transparent.&lt;br /&gt;
** '''Note:''' [[Object]]s are fully transparent at 140. &lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' or ''false'' if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example makes the player invisible.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function invisible()&lt;br /&gt;
    setElementAlpha(localPlayer, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;invisible&amp;quot;, invisible)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example lets you toggle invisibility when you write /invis.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleInvis ( thePlayer )  -- thePlayer is whoever executed the command&lt;br /&gt;
   if getElementAlpha( thePlayer ) == 0 then -- if the player is invisible&lt;br /&gt;
       setElementAlpha ( thePlayer, 255 ) -- set the player alpha to 255.&lt;br /&gt;
   else	-- else, if the player is visible&lt;br /&gt;
       setElementAlpha ( thePlayer, 0 )	-- set the players alpha to 0.&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;invis&amp;quot;, toggleInvis ) -- When /invis is typed, the function 'toggleInvis' will start.&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;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=82679</id>
		<title>GetEventHandlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetEventHandlers&amp;diff=82679"/>
		<updated>2026-01-02T15:22:09Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add important note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0140|1.4|4973|&lt;br /&gt;
This function gets the attached functions from the event and attached element from current lua script.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Important Note|This function only checks the current script.}}&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 getEventHandlers ( string eventName, element attachedTo )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''eventName:''' The name of the event. For example ( &amp;quot;onPlayerWasted&amp;quot; ).&lt;br /&gt;
*'''attachedTo:''' The [[element]] attached to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns table with attached functions, empty table otherwise.&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )&lt;br /&gt;
	if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then&lt;br /&gt;
	    local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )&lt;br /&gt;
		if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions &amp;gt; 0 then&lt;br /&gt;
			for i, v in ipairs( aAttachedFunctions ) do&lt;br /&gt;
				if v == func then&lt;br /&gt;
					return true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onPlayerWasted()&lt;br /&gt;
	outputChatBox( getPlayerName( source ) .. ' died.' )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
&lt;br /&gt;
addCommandHandler( 'removeOnPlayerWastedEvent', function()&lt;br /&gt;
    if isEventHandlerAdded( 'onPlayerWasted', root, onPlayerWasted ) then&lt;br /&gt;
        outputChatBox( 'onPlayerWasted succesfully removed!' )&lt;br /&gt;
        removeEventHandler( 'onPlayerWasted', root, onPlayerWasted )&lt;br /&gt;
    end&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;
&amp;lt;section name=&amp;quot;Clientside example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example removes all onClientMarkerHit event in current script.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local events = getEventHandlers ( &amp;quot;onClientMarkerHit&amp;quot;, resourceRoot )&lt;br /&gt;
for i,v in ipairs(events) do &lt;br /&gt;
    removeEventHandler ( &amp;quot;onClientMarkerHit&amp;quot;, resourceRoot, v) &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;
{{Event functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=82678</id>
		<title>SetSoundVolume</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundVolume&amp;diff=82678"/>
		<updated>2026-01-02T15:17:13Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the volume level of the specified [[sound]] [[element]].&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundVolume ( element theSound/thePlayer, float volume )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:setVolume|volume|getSoundVolume}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] [[element]] which volume you want to modify or a [[player]] element which voice volume you want to modify.&lt;br /&gt;
*'''volume:''' A [[float]]ing point number representing the desired volume level. Range is from '''0.0''' to '''1.0'''. This can go above '''1.0''' for amplification.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] [[element]] volume was successfully changed, ''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;
function wasted (killer, weapon, bodypart)&lt;br /&gt;
    local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
    if isElement(sound) then&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, localPlayer, wasted) --add the event handler &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[hu:setSoundVolume]]&lt;br /&gt;
[[AR:setSoundVolume]]&lt;br /&gt;
[[RO:setSoundVolume]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSound&amp;diff=82677</id>
		<title>StopSound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSound&amp;diff=82677"/>
		<updated>2026-01-02T15:16:28Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Stops the sound playback for specified [[sound]] [[element]]. The sound element is also destroyed.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool stopSound ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:stop}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' the [[sound]] [[element]] you want to stop playing.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''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;
local sound&lt;br /&gt;
&lt;br /&gt;
function startMySound()&lt;br /&gt;
    sound = playSound(&amp;quot;sound.mp3&amp;quot;, true)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, startMySound)&lt;br /&gt;
&lt;br /&gt;
function stopMySound()&lt;br /&gt;
    if isElement(sound) then&lt;br /&gt;
        stopSound(sound)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;stopsound&amp;quot;, stopMySound) --using the command 'stopsound' will stop the sound&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[HU:stopSound]]&lt;br /&gt;
[[AR:stopSound]]&lt;br /&gt;
[[RO:stopSound]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=82676</id>
		<title>PlaySound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=82676"/>
		<updated>2026-01-02T15:14:59Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] in the GTA world and plays it immediately after creation for the local player. [[setElementPosition]] can be used to move the [[sound]] element around after it has been created. Remember to use [[setElementDimension]] after creating the sound to play it outside of dimension 0.&lt;br /&gt;
{{Added feature/item|1.6.0|1.5.9|21034|Added the feature of playing WebM files.}}&lt;br /&gt;
{{Note|&lt;br /&gt;
*The only supported audio formats are MP3, WAV, OGG, FLAC, RIFF, MOD, WEBM, XM, IT and S3M.&lt;br /&gt;
*For performance reasons, when using playSound3D for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false, bool throttled = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Sound|Sound3D]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''soundPath:''' raw data or [[filepath]] to the sound file you want to play. ('''Note:''' Playing sound files from other resources requires the target resource to be in the running state)&lt;br /&gt;
*'''soundURL:''' the URL (http://, https:// or ftp://) of the sound file you want to play. (In this version the file does not have to be predefined in the [[meta.xml]])&lt;br /&gt;
*'''x:''' a [[float]]ing point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' a [[float]]ing point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' a [[float]]ing point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' a [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''.&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled (i.e. given reduced download bandwidth). To throttle the sound, use ''true''.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a looping sound within a pizza shop. It's located in San Fierro near Pier 69.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onResourceStart()&lt;br /&gt;
    playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example plays internet radio at Grove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
    local uSound = playSound3D('http://977music.com/itunes/80s.pls', 2498, -1659, 12)&lt;br /&gt;
    if isElement(uSound) then&lt;br /&gt;
        setSoundMaxDistance(uSound, 100)&lt;br /&gt;
    end&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;
{{Client_audio_functions}}&lt;br /&gt;
[[HU:playSound3D]]&lt;br /&gt;
[[AR:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;br /&gt;
[[RU:playSound3D]]&lt;br /&gt;
[[PT-BR:playSound3D]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=82675</id>
		<title>PlaySound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=82675"/>
		<updated>2026-01-02T15:13:40Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] and plays it immediately after creation for the local player.&lt;br /&gt;
{{Added feature/item|1.6.0|1.5.9|21034|Added the feature of playing WebM files.}}&lt;br /&gt;
{{Note|&lt;br /&gt;
*The only supported audio formats are MP3, WAV, OGG, FLAC, RIFF, MOD, WEBM, XM, IT, S3M and PLS (e.g. Webstream).&lt;br /&gt;
*For performance reasons, when using playSound for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false, bool throttled = true ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Sound]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' [[filepath]], raw data or URL (http://, https:// or ftp://) of the sound file you want to play. ('''Note:''' Playing sound files from other resources requires the target resource to be in the running state)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' a [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''. Loop is not available for streaming sounds, only for sound files.&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled (i.e. given reduced download bandwidth). To throttle the sound, use ''true''. Sounds will be throttled per default and only for URLs.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''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;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
    local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) -- Play wasted.mp3 from the sounds folder&lt;br /&gt;
    if isElement(sound) then&lt;br /&gt;
        setSoundVolume(sound, 0.5) -- Set the sound volume to 50%&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, localPlayer, wasted) -- Add the event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[HU:playSound]]&lt;br /&gt;
[[AR:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;br /&gt;
[[RO:playSound]]&lt;br /&gt;
[[PT-BR:playSound]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=82674</id>
		<title>PlaySound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=82674"/>
		<updated>2026-01-02T15:13:15Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] and plays it immediately after creation for the local player.&lt;br /&gt;
{{Added feature/item|1.6.0|1.5.9|21034|Added the feature of playing WebM files.}}&lt;br /&gt;
{{Note|&lt;br /&gt;
*The only supported audio formats are MP3, WAV, OGG, FLAC, RIFF, MOD, WEBM, XM, IT, S3M and PLS (e.g. Webstream).&lt;br /&gt;
*For performance reasons, when using playSound for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false, bool throttled = true ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Sound]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' [[filepath]], raw data or URL (http://, https:// or ftp://) of the sound file you want to play. ('''Note:''' Playing sound files from other resources requires the target resource to be in the running state)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' a [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''. Loop is not available for streaming sounds, only for sound files.&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled (i.e. given reduced download bandwidth). To throttle the sound, use ''true''. Sounds will be throttled per default and only for URLs.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''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;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
    local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) -- Play wasted.mp3 from the sounds folder&lt;br /&gt;
    if isElement(sound) then&lt;br /&gt;
	    setSoundVolume(sound, 0.5) -- Set the sound volume to 50%&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, localPlayer, wasted) -- Add the event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[HU:playSound]]&lt;br /&gt;
[[AR:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;br /&gt;
[[RO:playSound]]&lt;br /&gt;
[[PT-BR:playSound]]&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerLatentServerEvent&amp;diff=82673</id>
		<title>TriggerLatentServerEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerLatentServerEvent&amp;diff=82673"/>
		<updated>2026-01-02T15:10:56Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is the same as [[triggerServerEvent]] except the transmission rate of the data contained in the arguments can be limited and other network traffic is not blocked while the data is being transferred.&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 triggerLatentServerEvent ( string event, [int bandwidth=5000, bool persist=false,] element theElement, [arguments...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''event:''' The name of the event to trigger server-side. You should register this event with [[addEvent]] and add at least one event handler using [[addEventHandler]].&lt;br /&gt;
*'''theElement:''' The element that is the [[Event system#Event handlers|source]] of the event. This could be another player, or if this isn't relevant, use the root element.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bandwidth:''' The bytes per second rate to send the data contained in the arguments.&lt;br /&gt;
*'''persist:''' A bool indicating whether the transmission should be allowed to continue even after the resource that triggered it has since stopped.&lt;br /&gt;
*'''arguments...:''' A list of arguments to trigger with the event. You can pass any Lua data type (except functions). You can also pass [[element]]s. The total amount of data should not exceed 100MB. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event trigger has been sent, ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileExists(&amp;quot;text.txt&amp;quot;) then&lt;br /&gt;
	file = fileOpen(&amp;quot;test.txt&amp;quot;)						--Open a file (you can create it yourself).&lt;br /&gt;
	local data = fileRead(file,100*1024*1024)				--Max 100 MB&lt;br /&gt;
	fileClose(file)								--Close File&lt;br /&gt;
	triggerLatentServerEvent(&amp;quot;onReadFile&amp;quot;,5000,false,root,data)	--trigger&lt;br /&gt;
end&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;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;onReadFile&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;onReadFile&amp;quot;,root,function(data)&lt;br /&gt;
	local file = fileCreate(&amp;quot;text.txt&amp;quot;)					--Save &amp;quot;data&amp;quot; into &amp;quot;text.txt&amp;quot;&lt;br /&gt;
	fileWrite(file,data)&lt;br /&gt;
	fileClose(file)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82672</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82672"/>
		<updated>2026-01-01T20:38:58Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|320px|right|[[Image:SetVehicleDirtEnabled-true.png|320px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function isVehicleDirtEnabled(theVehicle)&lt;br /&gt;
    if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&lt;br /&gt;
&lt;br /&gt;
--// Also u can use 'isVehicleDirtEnabled' to check.&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82671</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82671"/>
		<updated>2026-01-01T20:34:07Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add isVehicleDirtEnabled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|320px|right|[[Image:SetVehicleDirtEnabled-true.png|320px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function isVehicleDirtEnabled(theVehicle)&lt;br /&gt;
    if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82670</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82670"/>
		<updated>2026-01-01T20:29:31Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|320px|right|[[Image:SetVehicleDirtEnabled-true.png|320px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82669</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82669"/>
		<updated>2026-01-01T18:50:29Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|320px|right|[[Image:SetVehicleDirtEnabled-true.png|320px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82668</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82668"/>
		<updated>2026-01-01T18:47:48Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
[[Image:SetVehicleDirtEnabled-false.png|thumb|256px|right|[[Image:SetVehicleDirtEnabled-true.png|256px|right]]]]&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:SetVehicleDirtEnabled-true.png&amp;diff=82667</id>
		<title>File:SetVehicleDirtEnabled-true.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:SetVehicleDirtEnabled-true.png&amp;diff=82667"/>
		<updated>2026-01-01T18:46:09Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=File:SetVehicleDirtEnabled-false.png&amp;diff=82666</id>
		<title>File:SetVehicleDirtEnabled-false.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=File:SetVehicleDirtEnabled-false.png&amp;diff=82666"/>
		<updated>2026-01-01T18:45:52Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82665</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82665"/>
		<updated>2026-01-01T18:38:29Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabledState)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabledState) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabledState))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabledState then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82664</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82664"/>
		<updated>2026-01-01T18:37:04Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabled)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82663</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82663"/>
		<updated>2026-01-01T18:36:23Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(theVehicle, enabled)&lt;br /&gt;
    assert(isElement(theVehicle) and getElementType(theVehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(theVehicle) and getElementType(theVehicle) or type(theVehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            enabledVehicles[theVehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[theVehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[theVehicle], &amp;quot;vehiclegrunge256&amp;quot;, theVehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[theVehicle])&lt;br /&gt;
            enabledVehicles[theVehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:IManGaaX&amp;diff=82662</id>
		<title>User:IManGaaX</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:IManGaaX&amp;diff=82662"/>
		<updated>2026-01-01T18:28:04Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:iManGaaX-Prank.png|256px|center]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:20px; text-align:center; margin-bottom:20px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#14141c; color:#e6e6e6; border-radius:14px; padding:18px; border:1px solid #23232f; margin-bottom:20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:20px; font-weight:bold; color:#00ffa2;&amp;quot;&amp;gt;About Me&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b style=&amp;quot;color:#00e6ff;&amp;quot;&amp;gt;Name:&amp;lt;/b&amp;gt; &amp;lt;span style=&amp;quot;color:#fff;&amp;quot;&amp;gt;Youssef Maged&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b style=&amp;quot;color:#00e6ff;&amp;quot;&amp;gt;Nickname:&amp;lt;/b&amp;gt; &amp;lt;span style=&amp;quot;color:#fff;&amp;quot;&amp;gt;iManGaaX&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#10101a; border-radius:14px; padding:18px; border:1px solid #222233; margin-bottom:20px; text-align:center;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:20px; font-weight:bold; color:#00ffa2;&amp;quot;&amp;gt;My Works&amp;lt;/span&amp;gt;&lt;br /&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;
*[[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;
*[[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;
*[[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;
*[[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;
*[[isPedNearbyWall]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if player/ped is nearby walls like buildings or objects.&amp;lt;/span&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;
*[[isPedFalling]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if player/ped is falling from a high place.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.flatten]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a nested table into a flattened table with concatenated keys.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getColorName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves the nearest color name for a given RGB value using an online API.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getClosestPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds the closest point from a given element to a list of points in 2D space.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleDirtEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function toggles a dirt removal shader effect on the specified vehicle.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; flex-wrap:wrap; gap:12px; margin-top:20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;flex:1; min-width:230px; background:#12121a; border:2px solid #ff5555; border-radius:12px; padding:12px; box-shadow:0 0 8px rgba(255,85,85,0.25);&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; align-items:center; gap:8px; margin-bottom:6px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:YouTube_full-color_icon_(2017).svg|24px]]&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight:bold; color:#ff6969;&amp;quot;&amp;gt;YouTube&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;[https://youtube.com/@iManGaaX &amp;lt;span style=&amp;quot;color:#fff;&amp;quot;&amp;gt;youtube.com/@iManGaaX&amp;lt;/span&amp;gt;]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;flex:1; min-width:230px; background:#12121a; border:2px solid #7289da; border-radius:12px; padding:12px; box-shadow:0 0 8px rgba(114,137,218,0.25);&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; align-items:center; gap:8px; margin-bottom:6px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Discord.png|24px]]&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight:bold; color:#8c9eff;&amp;quot;&amp;gt;Discord&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;span style=&amp;quot;color:#aaa;&amp;quot;&amp;gt;&amp;lt;s&amp;gt;iManGaaX#1691&amp;lt;/s&amp;gt;&amp;lt;/span&amp;gt; → &amp;lt;b style=&amp;quot;color:#fff;&amp;quot;&amp;gt;imangaax&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;flex:1; min-width:230px; background:#12121a; border:2px solid #00e676; border-radius:12px; padding:12px; box-shadow:0 0 8px rgba(0,230,118,0.25);&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; align-items:center; gap:8px; margin-bottom:6px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:GitHub.png|24px]]&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight:bold; color:#00ffa2;&amp;quot;&amp;gt;GitHub&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;[https://github.com/iManGaaX &amp;lt;span style=&amp;quot;color:#fff;&amp;quot;&amp;gt;github.com/iManGaaX&amp;lt;/span&amp;gt;]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=82661</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=82661"/>
		<updated>2026-01-01T18:26:39Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: /* Vehicle 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;
*[[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;
*[[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;
*[[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.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;
*[[table.flatten]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a nested table into a flattened table with concatenated keys.&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;
*[[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;
*[[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;
&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;
*[[isPlayerAccount]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the account is a valid player account (account exists and is not a guest 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;
*[[sCamera]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» The function creates a speed camera in-game, fines speeding vehicles, and notifies the driver and take money from player based on vehicle speed.&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;
*[[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;
*[[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;
*[[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;
*[[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;
&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;
*[[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;
*[[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;
*[[getElementResourceName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the resource that created an element.&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;
*[[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;
*[[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;
*[[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;
*[[levenshtein]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function can be used to calculate the Levenshtein distance between two strings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[gregorianToJalali]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts gregorian date to jalali/shamsi date.&amp;lt;/span&amp;gt;&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;
*[[getServerAveragePing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets average players ping.&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;
*[[fixPersianString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a fixed sorted bilingual RTL for strings consisting of Farsi/Arabic and English.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getColorName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves the nearest color name for a given RGB value using an online API.&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;
*[[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;
*[[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;
=====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;
*[[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;
*[[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;
&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;
*[[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.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;
*[[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;
*[[math.absin]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a formula representing the just positive half of a sine wave.&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;
*[[getClosestPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds the closest point from a given element to a list of points in 2D space.&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;
*[[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;
*[[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;
*[[isPedFalling]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the player/ped is falling from a high place.&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;
*[[toggleAllVehicleControls]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function toggles all vehicle controls for a player on or off based on the provided boolean value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerNameRandomized]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function Checks whether the given player name looks like an automatically-generated random nickname.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&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;
*[[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;
*[[setVehicleDirtEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function toggles a dirt removal shader effect on the specified 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;
*[[createDirectory]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a directory in the resource's file system.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanBySerial]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the ban if the serial is banned.&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;
*[[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;
*[[listAllFiles]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function lists all files and subdirectories within a given directory and its subdirectories.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dumpdelete]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function recursively deletes elements inside a table, destroying elements like vehicles, peds, or killing timers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isEventHandlerAdded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a specific event handler has already been added to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String functions===&lt;br /&gt;
*[[string.endsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string ends with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.startsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string starts with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.repetition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function repeats a substring n times.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82660</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82660"/>
		<updated>2026-01-01T18:24:26Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if theVeh then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82659</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82659"/>
		<updated>2026-01-01T18:23:34Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local theVeh = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if theVeh then&lt;br /&gt;
    setVehicleDirtEnabled(theVeh, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(theVeh) then&lt;br /&gt;
        setVehicleDirtEnabled(theVeh, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82658</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82658"/>
		<updated>2026-01-01T18:23:01Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82657</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82657"/>
		<updated>2026-01-01T18:20:55Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, true)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82656</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82656"/>
		<updated>2026-01-01T18:18:45Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, false)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Disable dirt on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Show the dirt on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82655</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82655"/>
		<updated>2026-01-01T18:17:19Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, false)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Enable dirt removal shader on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Disable dirt removal shader on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82654</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82654"/>
		<updated>2026-01-01T18:15:30Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to remove dirt, true to show default dirt.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
        end&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, false)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Enable dirt removal shader on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Disable dirt removal shader on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82653</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82653"/>
		<updated>2026-01-01T18:11:25Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to false to enable the dirt removal shader, true to default.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if not enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
                return true&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
            return true&lt;br /&gt;
        else&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, false)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Enable dirt removal shader on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Disable dirt removal shader on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82652</id>
		<title>SetVehicleDirtEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtEnabled&amp;diff=82652"/>
		<updated>2026-01-01T18:09:25Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: add new useful function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;setVehicleDirtEnabled&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function toggles a dirt removal [[shader]] effect on the specified [[vehicle]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This function applies or removes a custom [[shader]] that removes dirt [[texture]] from the [[vehicle]]'s surface. It also handles [[shader]] cleanup automatically when the [[vehicle]] is destroyed.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleDirtEnabled( element theVehicle, boolean enabledState )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theVehicle''': the vehicle element on which to toggle the dirt effect.&lt;br /&gt;
* '''enabledState''': boolean value; set to true to enable the dirt removal shader, false to default.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* '''true''' if the operation was successful (shader applied or removed, or already in the requested state).&lt;br /&gt;
* '''false''' if the operation failed (e.g. shader creation failure).&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local enabledVehicles = {}&lt;br /&gt;
&lt;br /&gt;
local shaderCode = [[texture removeDirtyTexture;&lt;br /&gt;
technique TexReplace {&lt;br /&gt;
    pass P0 {&lt;br /&gt;
        Texture[0] = removeDirtyTexture;&lt;br /&gt;
    }&lt;br /&gt;
}]]&lt;br /&gt;
&lt;br /&gt;
function setVehicleDirtEnabled(vehicle, enabled)&lt;br /&gt;
    assert(isElement(vehicle) and getElementType(vehicle) == &amp;quot;vehicle&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected vehicle element at argument 1, got &amp;quot;..(isElement(vehicle) and getElementType(vehicle) or type(vehicle))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    assert(type(enabled) == &amp;quot;boolean&amp;quot;, &amp;quot;Bad argument @ 'setVehicleDirtEnabled' [Expected boolean at argument 2, got &amp;quot;..(type(enabled))..&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if enabled then&lt;br /&gt;
        if not isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            enabledVehicles[vehicle] = dxCreateShader(shaderCode, 0, 100, false, &amp;quot;vehicle&amp;quot;)&lt;br /&gt;
            if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
                engineApplyShaderToWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
                return true&lt;br /&gt;
            else&lt;br /&gt;
                return false&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if isElement(enabledVehicles[vehicle]) then&lt;br /&gt;
            engineRemoveShaderFromWorldTexture(enabledVehicles[vehicle], &amp;quot;vehiclegrunge256&amp;quot;, vehicle)&lt;br /&gt;
            destroyElement(enabledVehicles[vehicle])&lt;br /&gt;
            enabledVehicles[vehicle] = nil&lt;br /&gt;
            return true&lt;br /&gt;
        else&lt;br /&gt;
            return true&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientElementDestroy&amp;quot;, root, function()&lt;br /&gt;
    if getElementType(source) == &amp;quot;vehicle&amp;quot; then&lt;br /&gt;
        setVehicleDirtEnabled(source, false)&lt;br /&gt;
    end&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--// Enable dirt removal shader on the localPlayer's vehicle&lt;br /&gt;
local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
if vehicle then&lt;br /&gt;
    setVehicleDirtEnabled(vehicle, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--// Disable dirt removal shader on a vehicle after 5 seconds&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    if isElement(vehicle) then&lt;br /&gt;
        setVehicleDirtEnabled(vehicle, false)&lt;br /&gt;
    end&lt;br /&gt;
end, 5000, 1)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=82651</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=82651"/>
		<updated>2026-01-01T17:59:25Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: /* Vehicle functions */  [add new useful function]&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;
*[[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;
*[[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;
*[[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.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;
*[[table.flatten]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts a nested table into a flattened table with concatenated keys.&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;
*[[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;
*[[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;
&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;
*[[isPlayerAccount]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the account is a valid player account (account exists and is not a guest 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;
*[[sCamera]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» The function creates a speed camera in-game, fines speeding vehicles, and notifies the driver and take money from player based on vehicle speed.&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;
*[[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;
*[[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;
*[[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;
*[[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;
&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;
*[[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;
*[[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;
*[[getElementResourceName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the name of the resource that created an element.&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;
*[[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;
*[[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;
*[[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;
*[[levenshtein]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function can be used to calculate the Levenshtein distance between two strings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[gregorianToJalali]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function converts gregorian date to jalali/shamsi date.&amp;lt;/span&amp;gt;&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;
*[[getServerAveragePing]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function gets average players ping.&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;
*[[fixPersianString]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a fixed sorted bilingual RTL for strings consisting of Farsi/Arabic and English.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getColorName]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves the nearest color name for a given RGB value using an online API.&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;
*[[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;
*[[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;
=====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;
*[[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;
*[[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;
&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;
*[[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.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;
*[[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;
*[[math.absin]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns a formula representing the just positive half of a sine wave.&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;
*[[getClosestPoint]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function finds the closest point from a given element to a list of points in 2D space.&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;
*[[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;
*[[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;
*[[isPedFalling]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if the player/ped is falling from a high place.&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;
*[[toggleAllVehicleControls]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function toggles all vehicle controls for a player on or off based on the provided boolean value.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isPlayerNameRandomized]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function Checks whether the given player name looks like an automatically-generated random nickname.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource functions ===&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;
*[[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;
*[[setVehicleDirtEnabled]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function toggles the dirt effect on the given vehicle by applying or removing a custom shader.&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;
*[[createDirectory]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function creates a directory in the resource's file system.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getBanBySerial]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function returns the ban if the serial is banned.&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;
*[[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;
*[[listAllFiles]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function lists all files and subdirectories within a given directory and its subdirectories.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dumpdelete]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function recursively deletes elements inside a table, destroying elements like vehicles, peds, or killing timers.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isEventHandlerAdded]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether a specific event handler has already been added to an element.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===String functions===&lt;br /&gt;
*[[string.endsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string ends with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.startsWith]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function checks if a string starts with other string.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.repetition]] &amp;lt;span style=&amp;quot;color:gray; font-size:smaller;&amp;quot;&amp;gt;» This function repeats a substring n times.&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Useful Functions]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedFalling&amp;diff=82650</id>
		<title>IsPedFalling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedFalling&amp;diff=82650"/>
		<updated>2025-12-30T06:24:08Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function checks if [[player]]/[[ped]] is falling from a high place.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPedFalling( element thePed )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''thePed''': the [[player]]/[[ped]] element to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the player/ped is falling.&lt;br /&gt;
* ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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 isPedFalling(thePed)&lt;br /&gt;
    if not isElement(thePed) or (getElementType(thePed) ~= &amp;quot;player&amp;quot; and getElementType(thePed) ~= &amp;quot;ped&amp;quot;) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if isPedOnGround(thePed) or isPedInVehicle(thePed) or getPedOccupiedVehicle(thePed) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local vz = select(3, getElementVelocity(thePed))&lt;br /&gt;
    local verticalSpeed = vz * 50&lt;br /&gt;
&lt;br /&gt;
    if verticalSpeed &amp;lt; -10 then&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenX, screenY = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
    if isPedFalling(localPlayer) then&lt;br /&gt;
        dxDrawText(&amp;quot;You are falling!&amp;quot;, 0, 0, screenX, screenY, tocolor(255, 255, 255, 255), 1, &amp;quot;default-bold&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
    end&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedFalling&amp;diff=82649</id>
		<title>IsPedFalling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedFalling&amp;diff=82649"/>
		<updated>2025-12-30T06:15:38Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function checks if [[player]]/[[ped]] is falling from a high place.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPedFalling( element element )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''element''': the [[player]]/[[ped]] element to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the player/ped is falling.&lt;br /&gt;
* ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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 isPedFalling(element)&lt;br /&gt;
    if not isElement(element) or (getElementType(element) ~= &amp;quot;player&amp;quot; and getElementType(element) ~= &amp;quot;ped&amp;quot;) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if isPedOnGround(element) or isPedInVehicle(element) or getPedOccupiedVehicle(element) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local vz = select(3, getElementVelocity(element))&lt;br /&gt;
    local verticalSpeed = vz * 50&lt;br /&gt;
&lt;br /&gt;
    if verticalSpeed &amp;lt; -10 then&lt;br /&gt;
        return true&lt;br /&gt;
    end&lt;br /&gt;
&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenX, screenY = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, function()&lt;br /&gt;
    if isPedFalling(localPlayer) then&lt;br /&gt;
        dxDrawText(&amp;quot;You are falling!&amp;quot;, 0, 0, screenX, screenY, tocolor(255, 255, 255, 255), 1, &amp;quot;default-bold&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;center&amp;quot;)&lt;br /&gt;
    end&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetClosestPoint&amp;diff=82639</id>
		<title>GetClosestPoint</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetClosestPoint&amp;diff=82639"/>
		<updated>2025-12-07T17:38:11Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function finds the closest point from a given element to a list of points in 2D space.&lt;br /&gt;
&lt;br /&gt;
[[Image:GetClosestPoint2.png|thumb|256px|right|[[Image:GetClosestPoint.png|256px|right]]The difference between code No. 1 and code No. 2. The example in the image and below uses code No. 1.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|The example in the image and below uses code No. 1.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float, float, float getClosestPoint( element theElement, table thePoints )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': the element whose position is used as the reference.&lt;br /&gt;
* '''thePoints''': a table containing coordinates in the form {x, y, z}.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* Returns three ''float''s indicating the position of the element, ''x'', ''y'' and ''z'' respectively of the closest point.&lt;br /&gt;
&lt;br /&gt;
==Code (1)==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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 getClosestPoint(element, points)&lt;br /&gt;
    local ex, ey, ez = getElementPosition(element)&lt;br /&gt;
    local closestDist = math.huge&lt;br /&gt;
    local closestPoint = nil&lt;br /&gt;
&lt;br /&gt;
    for _, p in ipairs(points) do&lt;br /&gt;
        local dx, dy = p[1] - ex, p[2] - ey&lt;br /&gt;
        local dist = dx*dx + dy*dy&lt;br /&gt;
&lt;br /&gt;
        if dist &amp;lt; closestDist then&lt;br /&gt;
            closestDist = dist&lt;br /&gt;
            closestPoint = p&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return unpack(closestPoint)&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;
==Code (2)==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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 getClosestPoint(element, points)&lt;br /&gt;
    local ex, ey, ez = getElementPosition(element)&lt;br /&gt;
    local closestDist = math.huge&lt;br /&gt;
    local closestPoint = nil&lt;br /&gt;
&lt;br /&gt;
    for i = 1, #points - 1 do&lt;br /&gt;
        local x1, y1, z1 = unpack(points[i])&lt;br /&gt;
        local x2, y2, z2 = unpack(points[i + 1])&lt;br /&gt;
&lt;br /&gt;
        local t = ((ex - x1) * (x2 - x1) + (ey - y1) * (y2 - y1)) / ((x2 - x1)^2 + (y2 - y1)^2)&lt;br /&gt;
        t = math.max(0, math.min(1, t))&lt;br /&gt;
&lt;br /&gt;
        local px, py = x1 + t * (x2 - x1), y1 + t * (y2 - y1)&lt;br /&gt;
        local dist = (ex - px)^2 + (ey - py)^2&lt;br /&gt;
        if dist &amp;lt; closestDist then&lt;br /&gt;
            closestDist = dist&lt;br /&gt;
            closestPoint = {px, py, z1 + t * (z2 - z1)}&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return unpack(closestPoint)&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local lanePoints = {&lt;br /&gt;
    {2469.95850, -1675.36279, 14},&lt;br /&gt;
    {2489.37866, -1653.80859, 14},&lt;br /&gt;
    {2508.62891, -1662.11462, 14},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local xyz = {getClosestPoint(localPlayer, lanePoints)} --// Code (1), See the images above&lt;br /&gt;
outputChatBox(&amp;quot;Closest Lane Point: &amp;quot;..table.concat(xyz, &amp;quot;, &amp;quot;))&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RestoreWorldModel&amp;diff=82638</id>
		<title>RestoreWorldModel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RestoreWorldModel&amp;diff=82638"/>
		<updated>2025-12-07T17:17:54Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
This function restoring a removed world object, reversing the effect of [[removeWorldModel]].&lt;br /&gt;
&lt;br /&gt;
You may use [[restoreAllWorldModels]] to '''restore all world models removed with this function'''.&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 restoreWorldModel ( int modelID, float radius, float x, float y, float z [, int interior = -1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelID:''' A whole integer specifying the GTASA object model ID.&lt;br /&gt;
*'''radius:''' A floating point number representing the radius that will be eliminated.&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|3.0132|1.3.2|&lt;br /&gt;
*'''interior:''' The interior ID to apply the restoral to. Some objects in interior 13 show in all interiors so if you want to restore everything in interior 0 also restore everything in interior 13. A value of -1 here will affect all interiors.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world object was restored, ''false'' if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Remove every lamp post (object 1226) besides Grove Street.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
removeWorldModel(1226, 4000, 0, 0, 0, -1)&lt;br /&gt;
restoreWorldModel(1226, 50, 2489, -1665, 13, -1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04636|Added interior argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client world functions===&lt;br /&gt;
{{Client_world_functions}}&lt;br /&gt;
===Building functions===&lt;br /&gt;
{{Building functions}}&lt;br /&gt;
===Object functions===&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RestoreWorldModel&amp;diff=82637</id>
		<title>RestoreWorldModel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RestoreWorldModel&amp;diff=82637"/>
		<updated>2025-12-07T17:16:09Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
This function restoring a removed world object, reversing the effect of [[removeWorldModel]].&lt;br /&gt;
&lt;br /&gt;
You may use [[restoreAllWorldModels]] to '''restore all world models removed with this function'''.&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 restoreWorldModel ( int modelID, float radius, float x, float y, float z [, int interior = -1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelID:''' A whole integer specifying the GTASA object model ID.&lt;br /&gt;
*'''radius:''' A floating point number representing the radius that will be eliminated.&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{New items|3.0132|1.3.2|&lt;br /&gt;
*'''interior:''' The interior ID to apply the restoral to. Some objects in interior 13 show in all interiors so if you want to restore everything in interior 0 also restore everything in interior 13. A value of -1 here will affect all interiors.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world object was restored, ''false'' if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
Remove every lamp post (object 1226) besides Grove Street.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
removeWorldModel(1226, 4000, 0, 0, 0, -1)&lt;br /&gt;
restoreWorldModel(1226, 50, 2489, -1665, 13, -1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.1-9.04636|Added iInterior argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client world functions===&lt;br /&gt;
{{Client_world_functions}}&lt;br /&gt;
===Building functions===&lt;br /&gt;
{{Building functions}}&lt;br /&gt;
===Object functions===&lt;br /&gt;
{{Object functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiSetSelectedTab&amp;diff=82636</id>
		<title>GuiSetSelectedTab</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiSetSelectedTab&amp;diff=82636"/>
		<updated>2025-12-07T06:09:53Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function is used to change the currently selected [[Element/GUI/Tab|tab]] in a [[Element/GUI/Tab panel|tab panel]].&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 guiSetSelectedTab ( element tabPanel, element theTab )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''tabPanel:''' The [[Element/GUI/Tab panel|tab panel]] which current tab you want to change.&lt;br /&gt;
*'''theTab:''' The [[Element/GUI/Tab|tab]] which will be the new active tab.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the selected tab was changed to a new one successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example changes the selected tab to the next available tab.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tabPanel = guiCreateTabPanel(0.1, 0.1, 0.8, 0.8, true) --create a tab panel which fills the whole window&lt;br /&gt;
local tab1 = guiCreateTab(&amp;quot;Welcome&amp;quot;, tabPanel) --create a tab for the tab panel above&lt;br /&gt;
local tab2 = guiCreateTab(&amp;quot;Info&amp;quot;, tabPanel)--create another tab for the tab panel at the top&lt;br /&gt;
&lt;br /&gt;
function switchTabs()&lt;br /&gt;
    if guiGetSelectedTab(tabPanel) == tab1 then --Check what tab is currently shown&lt;br /&gt;
        guiSetSelectedTab(tabPanel, tab2) --if the &amp;quot;Welcome&amp;quot; tab is selected, change it to tab2(&amp;quot;Info&amp;quot; tab)&lt;br /&gt;
    else&lt;br /&gt;
        guiSetSelectedTab(tabPanel, tab1) --if the &amp;quot;Info&amp;quot; tab is selected, change it to tab1(&amp;quot;Welcome&amp;quot; tab)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
switchTabs()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
{{GUI_events}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsPedNearbyWall&amp;diff=82618</id>
		<title>IsPedNearbyWall</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsPedNearbyWall&amp;diff=82618"/>
		<updated>2025-11-13T06:41:37Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}} __NOTOC__&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
This function checks if [[player]]/[[ped]] is nearby walls like buildings or objects.&lt;br /&gt;
&lt;br /&gt;
{{Note|This function check if there are walls like buildings or objects in [[player]]/[[ped]]'s front angle.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isPedNearbyWall( element element, [ int customDistance = 2 ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''element''': the [[player]]/[[ped]] element to check.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''customDistance''': the distance between the walls and the [[player]]/[[ped]].&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the player/ped is nearby a wall.&lt;br /&gt;
* ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function isPedNearbyWall(element, customDistance)&lt;br /&gt;
    assert(isElement(element) and (getElementType(element) == &amp;quot;player&amp;quot; or getElementType(element) == &amp;quot;ped&amp;quot;), &amp;quot;Bad argument @ 'isPedNearbyWall' [Expected player/ped element at argument 1, got &amp;quot;..(isElement(element) and getElementType(element) or type(element))..&amp;quot;]&amp;quot;)&lt;br /&gt;
    local px, py, pz = getElementPosition(element)&lt;br /&gt;
    local rz = select(3, getElementRotation(element))&lt;br /&gt;
    local _px = px - math.sin(math.rad(rz)) * (customDistance or 2)&lt;br /&gt;
    local _py = py + math.cos(math.rad(rz)) * (customDistance or 2)&lt;br /&gt;
    if (not isLineOfSightClear(px, py, pz, _px, _py, pz, true, false, false, true, false)) then&lt;br /&gt;
        return true&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:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;nearbywall&amp;quot;, function()&lt;br /&gt;
    if isPedNearbyWall(localPlayer) then&lt;br /&gt;
        outputChatBox(&amp;quot;* You are nearby a wall currently.&amp;quot;, 0, 255, 0)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;* You are not nearby any wall.&amp;quot;, 255, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myPed = createPed(0, 2105.46, -1582.98, 26.11, 270)&lt;br /&gt;
setPedControlState(myPed, &amp;quot;forwards&amp;quot;, true)&lt;br /&gt;
&lt;br /&gt;
local myTimer&lt;br /&gt;
myTimer = setTimer(function()&lt;br /&gt;
    if isPedNearbyWall(myPed, 3) then&lt;br /&gt;
        killTimer(myTimer)&lt;br /&gt;
        setPedControlState(myPed, &amp;quot;forwards&amp;quot;, false)&lt;br /&gt;
        outputChatBox(&amp;quot;There is a wall next to the ped, the ped stopped moving.&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end, 250, 0)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerZoneChange&amp;diff=82605</id>
		<title>OnPlayerZoneChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerZoneChange&amp;diff=82605"/>
		<updated>2025-11-10T20:01:12Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__&lt;br /&gt;
This code implements an [[event]] that is triggered when the [[player]] enters a new area on the map.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string oldZone, string newZone&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldZone:''' old zone of [[player]].&lt;br /&gt;
*'''newZone:''' new zone of [[player]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the player whose zone was changed.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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;
local playersZone = {}&lt;br /&gt;
local zoneEventName = (localPlayer and &amp;quot;onClientPlayerZoneChange&amp;quot; or &amp;quot;onPlayerZoneChange&amp;quot;) -- client = &amp;quot;onClientPlayerZoneChange&amp;quot; — server = &amp;quot;onPlayerZoneChange&amp;quot;&lt;br /&gt;
local zoneCitiesOnly = false -- only major cities?&lt;br /&gt;
&lt;br /&gt;
local function checkPlayersZone()&lt;br /&gt;
    local playersTable = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    for playerID = 1, #playersTable do&lt;br /&gt;
        local playerElement = playersTable[playerID]&lt;br /&gt;
        local playerX, playerY, playerZ = getElementPosition(playerElement)&lt;br /&gt;
        local playerZoneNow = getZoneName(playerX, playerY, playerZ, zoneCitiesOnly)&lt;br /&gt;
        local playerZoneSaved = playersZone[playerElement]&lt;br /&gt;
        local playerZoneNeedsUpdate = (playerZoneSaved and playerZoneSaved ~= playerZoneNow)&lt;br /&gt;
&lt;br /&gt;
        if (playerZoneNeedsUpdate) then&lt;br /&gt;
            triggerEvent(zoneEventName, playerElement, playerZoneSaved, playerZoneNow)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        playersZone[playerElement] = playerZoneNow&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEvent(zoneEventName, false) -- disable remote triggering so players couldn't trigger this event on server (&amp;amp; vice-versa)&lt;br /&gt;
setTimer(checkPlayersZone, 500, 0)&lt;br /&gt;
&lt;br /&gt;
local function clearPlayersZone()&lt;br /&gt;
    playersZone[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(localPlayer and &amp;quot;onClientPlayerQuit&amp;quot; or &amp;quot;onPlayerQuit&amp;quot;, root, clearPlayersZone)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example will make label with the full zone name of the player, '''onPlayerZoneChange''' is function is change the label text to new zone when the player enter a new zone.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myCurrentZoneLabel&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
    local px, py, pz = getElementPosition(localPlayer)&lt;br /&gt;
    local firstZone = getZoneName(px, py, pz)&lt;br /&gt;
    myCurrentZoneLabel = guiCreateLabel(0, 0, 0.20, 0.02, firstZone, true)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerZoneChange&amp;quot;, root, function(_, newZone)&lt;br /&gt;
    if (source == localPlayer) then&lt;br /&gt;
        guiSetText(myCurrentZoneLabel, newZone)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example will out put in the chat the new zone full name when the player enter a new zone.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerZoneChange&amp;quot;, root, function(oldZone, newZone)&lt;br /&gt;
    outputChatBox(&amp;quot;Your Zone is Changed from '&amp;quot;..(oldZone)..&amp;quot;' to '&amp;quot;..(newZone)..&amp;quot;'.&amp;quot;, source, 255, 255, 0)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerZoneChange&amp;diff=82604</id>
		<title>OnPlayerZoneChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerZoneChange&amp;diff=82604"/>
		<updated>2025-11-10T19:56:52Z</updated>

		<summary type="html">&lt;p&gt;IManGaaX: correct mistakes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__&lt;br /&gt;
This code implements an [[event]] that is triggered when the [[player]] enters a new area on the map.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string oldZone, string newZone&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldZone:''' old zone of [[player]].&lt;br /&gt;
*'''newZone:''' new zone of [[player]].&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the player whose zone was changed.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&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;
local playersZone = {}&lt;br /&gt;
local zoneEventName = (localPlayer and &amp;quot;onClientPlayerZoneChange&amp;quot; or &amp;quot;onPlayerZoneChange&amp;quot;) -- client = &amp;quot;onClientPlayerZoneChange&amp;quot; — server = &amp;quot;onPlayerZoneChange&amp;quot;&lt;br /&gt;
local zoneCitiesOnly = false -- only major cities?&lt;br /&gt;
&lt;br /&gt;
local function checkPlayersZone()&lt;br /&gt;
    local playersTable = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    for playerID = 1, #playersTable do&lt;br /&gt;
        local playerElement = playersTable[playerID]&lt;br /&gt;
        local playerX, playerY, playerZ = getElementPosition(playerElement)&lt;br /&gt;
        local playerZoneNow = getZoneName(playerX, playerY, playerZ, zoneCitiesOnly)&lt;br /&gt;
        local playerZoneSaved = playersZone[playerElement]&lt;br /&gt;
        local playerZoneNeedsUpdate = (playerZoneSaved and playerZoneSaved ~= playerZoneNow)&lt;br /&gt;
&lt;br /&gt;
        if (playerZoneNeedsUpdate) then&lt;br /&gt;
            triggerEvent(zoneEventName, playerElement, playerZoneSaved, playerZoneNow)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        playersZone[playerElement] = playerZoneNow&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEvent(zoneEventName, false) -- disable remote triggering so players couldn't trigger this event on server (&amp;amp; vice-versa)&lt;br /&gt;
setTimer(checkPlayersZone, 1000, 0)&lt;br /&gt;
&lt;br /&gt;
local function clearPlayersZone()&lt;br /&gt;
    playersZone[source] = nil&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(localPlayer and &amp;quot;onClientPlayerQuit&amp;quot; or &amp;quot;onPlayerQuit&amp;quot;, root, clearPlayersZone)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Author:''' [[User:IManGaaX|Youssef Maged (iManGaaX)]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example will make label with the full zone name of the player, '''onPlayerZoneChange''' is function is change the label text to new zone when the player enter a new zone.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local myCurrentZoneLabel&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function()&lt;br /&gt;
    local px, py, pz = getElementPosition(localPlayer)&lt;br /&gt;
    local firstZone = getZoneName(px, py, pz)&lt;br /&gt;
    myCurrentZoneLabel = guiCreateLabel(0, 0, 0.20, 0.02, firstZone, true)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerZoneChange&amp;quot;, root, function(_, newZone)&lt;br /&gt;
    if (source == localPlayer) then&lt;br /&gt;
        guiSetText(myCurrentZoneLabel, newZone)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example will out put in the chat the new zone full name when the player enter a new zone.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerZoneChange&amp;quot;, root, function(oldZone, newZone)&lt;br /&gt;
    outputChatBox(&amp;quot;Your Zone is Changed from &amp;quot;..(oldZone)..&amp;quot; to &amp;quot;..(newZone)..&amp;quot;.&amp;quot;, source, 255, 255, 0)&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;
&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>IManGaaX</name></author>
	</entry>
</feed>