https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Botder&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T11:30:26ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=How_you_can_help&diff=77498How you can help2023-08-16T14:58:58Z<p>Botder: Reverted edits by TheRealSadra (talk) to last revision by Maurice</p>
<hr />
<div>__NOTOC__<br />
Multi Theft Auto has loads of areas in which you can help us. In turn, we'll be more than happy to help you get started with any ideas you have, help test them and - if they're good enough - release them to the whole community. This page outlines the key areas you could do something in, of course, there are many things we've not thought of, so think outside the box!<br />
<br />
==Coding for MTA:SA==<br />
* Become a patch contributor by sending [https://github.com/multitheftauto/mtasa-blue/pulls pull requests] to MTA, containing requested features or bugfixes. ([https://github.com/multitheftauto/mtasa-blue/blob/master/CONTRIBUTING.md#contributors-guide Coding guidelines])<br />
* Translate MTA:SA to your native language on Crowdin at https://multitheftauto.crowdin.com/<br />
<br />
==Scripting==<br />
* Become a contributor to MTA's official resources by sending [https://github.com/multitheftauto/mtasa-resources/pulls pull requests] to our resources repository<br />
* Create and [https://community.multitheftauto.com/ publish] a gamemode or useful script<br />
**[[Scripting Introduction]]<br />
**[https://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
* Make a general purpose resource that provides useful functions to other resources.<br />
<br />
==Mapping==<br />
* Create and [https://community.multitheftauto.com/ publish] a map for an existing gamemode, with the map editor.<br />
**[[Resource:Editor|Map Editor Manual]]<br />
<br />
==Web development==<br />
* Create your own system for statistics - using the [[PHP SDK]] as a basis. Join the [https://discord.com/invite/mtasa MTA Discord] (or [https://discord.gg/GNN6PRtTnu development Discord]) for help.<br />
<br />
==Documentation==<br />
Before you make changes check out: [[Help:Editing Guidelines|Editing Guidelines]] and [[Help:MTA Wiki Specific Templates|Specific Templates]]<br />
* Finish documentation for [[:Category:Incomplete|Incomplete functions]] - ask in #mta.scripting if you're not sure of something.<br />
* Add examples to [[:Category:Needs Example|functions & events missing examples]] - please '''test''' them, and again, ask if you need help.<br />
* Review and verify [[:Category:Needs Checking|pages that need checking]] - make sure highlighted issues are solved before removing pages from the category.<br />
* Expand the pages that explain [[:Category:Scripting_Concepts|MTA core concepts]].<br />
* Write [https://forum.multitheftauto.com/forum/123-tutorials/ tutorials] to help new people.<br />
* Translate the wiki pages so people from other countries can get started in MTA too.<br />
* Create documentation for undocumented functions and events [[Undocumented Items]]<br />
* Keep 'changes in' [current work-in-progress: https://wiki.multitheftauto.com/wiki/Changes_in_1.6] for future releases updated.<br />
<br />
==Quality Assurance==<br />
* [https://github.com/multitheftauto/mtasa-blue/issues Report issues] with the mod, make sure to do a search on the already reported issues first.<br />
* Test and confirm existing reported issues.<br />
* Use the newest build of MTA to detect and report new bugs, by going to 'Settings', 'Advanced', 'Update build type' and choosing 'Nightly' or get it regularly [https://nightly.multitheftauto.com/ from here].<br />
* Any bugs which are related to a scripting function / event and present in the main release (rather than nightlies), document that bug by adding a [https://wiki.multitheftauto.com/wiki/Help:MTA_Wiki_Specific_Templates warning] to the wiki page to save other scripters a lot of time.<br />
<br />
==Specific tasks==<br />
* Create a fuzzer to check for crashes in our scripting functions.<br />
<br />
==Grant==<br />
You can donate to MTA:SA [https://multitheftauto.com/donate/manage.php here]<br />
<br />
[[ar:كيف_يمكنك_المساعدة]]<br />
[[en:How you can help]]<br />
[[ru:How you can help]]<br />
[[pl:Jak możesz pomóc]]<br />
[[uk:How you can help]]<br />
[[es:Cómo puedes ayudar]]<br />
[[hu:How you can help]]<br />
[[tr:Nasıl yardımcı olabilirsiniz]]<br />
[[pt-br:Como você pode ajudar]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:File_functions&diff=77420Template:File functions2023-08-07T20:55:54Z<p>Botder: </p>
<hr />
<div><ul><br />
<li>[[fileClose]]</li><br />
<li>[[fileCopy]]</li><br />
<li>[[fileCreate]]</li><br />
<li>[[fileDelete]]</li><br />
<li>[[fileExists]]</li><br />
<li>[[fileFlush]]</li><br />
{{New items|3.0161|1.6.0|<br />
<li>[[fileGetContents]]</li><br />
|21938}}<br />
{{New items|3.0153|1.5.3|<br />
<li>[[fileGetPath]]</li><br />
|7446}}<br />
<li>[[fileGetPos]]</li><br />
<li>[[fileGetSize]]</li><br />
<li>[[fileIsEOF]]</li><br />
<li>[[fileOpen]]</li><br />
<li>[[fileRead]]</li><br />
<li>[[fileRename]]</li><br />
<li>[[fileSetPos]]</li><br />
<li>[[fileWrite]]</li><br />
</ul><br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=FileGetContents&diff=77419FileGetContents2023-08-07T20:54:29Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
{{Added feature/item|1.6.1|1.6.0|21938|<br />
Reads the entire contents of the file, optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string. The file cursor position is not modified by calls to this function.<br />
}}<br />
<br />
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )<br />
</syntaxhighlight><br />
{{OOP||[[file]]:getContents}}<br />
<br />
===Required Arguments===<br />
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.<br />
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content<br />
<br />
===Returns===<br />
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.<br />
<br />
==Example==<br />
This example opens the file test.txt and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local handle = fileOpen("code.lua", true)<br />
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as <file> for this example)<br />
fileClose(handle)<br />
<br />
if buffer then<br />
loadstring(buffer)()<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=FileGetContents&diff=77418FileGetContents2023-08-07T20:06:02Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
{{Added feature/item|1.6.1|1.6.0|21933|<br />
Reads the entire contents of the file, optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string. The file cursor position is not modified by calls to this function.<br />
}}<br />
<br />
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )<br />
</syntaxhighlight><br />
{{OOP||[[file]]:getContents}}<br />
<br />
===Required Arguments===<br />
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.<br />
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content<br />
<br />
===Returns===<br />
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.<br />
<br />
==Example==<br />
This example opens the file test.txt and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local handle = fileOpen("code.lua", true)<br />
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as <file> for this example)<br />
fileClose(handle)<br />
<br />
if buffer then<br />
loadstring(buffer)()<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=FileGetContents&diff=77417FileGetContents2023-08-07T20:04:44Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
{{Added feature/item|1.6.1|1.6.0|21933|<br />
Reads the entire contents of the file '''starting from the current file position''', optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string.<br />
}}<br />
<br />
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )<br />
</syntaxhighlight><br />
{{OOP||[[file]]:getContents}}<br />
<br />
===Required Arguments===<br />
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.<br />
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content<br />
<br />
===Returns===<br />
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.<br />
<br />
==Example==<br />
This example opens the file test.txt and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local handle = fileOpen("code.lua", true)<br />
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as <file> for this example)<br />
fileClose(handle)<br />
<br />
if buffer then<br />
loadstring(buffer)()<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=FileGetContents&diff=77416FileGetContents2023-08-07T19:18:24Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
{{Added feature/item|1.6.1|1.6.0|21932|<br />
Reads the entire contents of the file '''starting from the current file position''', optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string.<br />
}}<br />
<br />
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )<br />
</syntaxhighlight><br />
{{OOP||[[file]]:getContents}}<br />
<br />
===Required Arguments===<br />
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.<br />
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content<br />
<br />
===Returns===<br />
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.<br />
<br />
==Example==<br />
This example opens the file test.txt and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local handle = fileOpen("code.lua", true)<br />
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as <file> for this example)<br />
fileClose(handle)<br />
<br />
if buffer then<br />
loadstring(buffer)()<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=FileGetContents&diff=77415FileGetContents2023-08-07T19:16:30Z<p>Botder: Created page with "__NOTOC__ {{Server client function}} Reads the entire contents of the file '''starting from the current file position''', optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string. Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. Th..."</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
Reads the entire contents of the file '''starting from the current file position''', optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string.<br />
<br />
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )<br />
</syntaxhighlight><br />
{{OOP||[[file]]:getContents}}<br />
<br />
===Required Arguments===<br />
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.<br />
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content<br />
<br />
===Returns===<br />
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.<br />
<br />
==Example==<br />
This example opens the file test.txt and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local handle = fileOpen("code.lua", true)<br />
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as <file> for this example)<br />
fileClose(handle)<br />
<br />
if buffer then<br />
loadstring(buffer)()<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=OnExplosion&diff=77230OnExplosion2023-07-30T13:20:18Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
{{Added feature/item|1.6.1|1.6.0|21914|This event is triggered every time an explosion is created either by server-side [[createExplosion]], or reported by [[player]].}}<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
float x, float y, float z, int theType<br />
</syntaxhighlight><br />
*'''x:''' X coordinate of where the explosion was created<br />
*'''y:''' Y coordinate of where the explosion was created<br />
*'''z:''' Z coordinate of where the explosion was created<br />
*'''theType:''' the type of explosion created, values are:<br />
{{Explosions}}<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] who notified server about explosion, or [[root]] if explosion was created without specifying creator in [[createExplosion]].<br />
<br />
===Canceling===<br />
If this event is [[Event system #Canceling|canceled]], the explosion will not occur. <br />
<br />
==Example==<br />
This example outputs information about occuring explosion.<br />
<syntaxhighlight lang="lua"><br />
local explosionTypes = {<br />
[0] = "Grenade",<br />
[1] = "Molotov",<br />
[2] = "Rocket",<br />
[3] = "Rocket Weak",<br />
[4] = "Car",<br />
[5] = "Car Quick",<br />
[6] = "Boat",<br />
[7] = "Heli",<br />
[8] = "Mine",<br />
[9] = "Object",<br />
[10] = "Tank Grenade",<br />
[11] = "Small",<br />
[12] = "Tiny",<br />
}<br />
<br />
function onExplosion(explosionX, explosionY, explosionZ, explosionType)<br />
local explosionPos = (explosionX..", "..explosionY..", "..explosionZ)<br />
local explosionTypeName = explosionTypes[explosionType]<br />
local explosionSource = inspect(source)<br />
<br />
local debugMsg = (explosionTypeName.." explosion has occured at "..explosionPos.." (source: "..explosionSource..")")<br />
local debugMsgLevel = 4<br />
local debugMsgR = 255<br />
local debugMsgG = 127<br />
local debugMsgB = 0<br />
<br />
outputDebugString(debugMsg, debugMsgLevel, debugMsgR, debugMsgG, debugMsgB)<br />
end<br />
addEventHandler("onExplosion", root, onExplosion)<br />
</syntaxhighlight><br />
<br />
{{See also/Server event|Server events}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Server_events&diff=77228Template:Server events2023-07-30T13:19:12Z<p>Botder: </p>
<hr />
<div>*[[onBan]]<br />
*[[onChatMessage]]<br />
*[[onDebugMessage]]<br />
{{Added feature/item|1.6.1|1.6.0|21914|<br />
*[[onExplosion]]<br />
}}<br />
*[[onSettingChange]]<br />
*[[onUnban]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Next_Stable_Version&diff=77227Template:Next Stable Version2023-07-30T13:18:52Z<p>Botder: Bump next stable version</p>
<hr />
<div>{{#ifeq:{{{1|}}}|full|Error!|1.6.1}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Current_Stable_Version&diff=77226Template:Current Stable Version2023-07-30T13:18:40Z<p>Botder: Bump stable version</p>
<hr />
<div>{{#ifeq:{{{1|}}}|full|Error!|1.6.0}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=User:Botder&diff=77132User:Botder2023-06-28T15:28:37Z<p>Botder: </p>
<hr />
<div>{{MTA Developer}}<br />
<br />
== Contact ==<br />
*Discord: '''botder''' (before: '''botder#1218''')<br />
*[https://github.com/botder GitHub Profile]<br />
*[https://forum.mtasa.com/profile/40389-botder/ Forum Profile]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=EncodeString&diff=76315EncodeString2023-03-21T22:50:56Z<p>Botder: Add RSA example</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0156|1.5.5|11849|<br />
This function encodes a [[string]] using the specified algorithm. The counterpart of this function is [[decodeString]].<br />
}}<br />
<br />
{{Tip|If it doesn't matter which algorithm you use for the encoding, keep in mind that ''aes128'' uses hardware acceleration so it may outperform the ''tea'' algorithm on most processors.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string encodeString ( string algorithm, string input, table options [, function callback ] ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''algorithm:''' The algorithm to use.<br />
*'''input:''' The input to encode.<br />
*'''options:''' A [[table]] with options and other necessary data for the algorithm, as detailed below.<br />
<br />
===Options for each algorithm===<br />
* ''tea'' ([https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm Tiny Encryption Algorithm])<br />
** '''key''': a key to encode the input with.<br />
{{Added feature/item|1.5.9|1.5.8|20898|<br />
* ''aes128'' ([https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard] in CTR mode)<br />
** '''key''': a key to encode the input with (must be 16 characters long).<br />
|20898}}<br />
{{Added feature/item|1.5.9|1.5.8|21055|<br />
* ''rsa'' ([https://en.wikipedia.org/wiki/RSA_(cryptosystem) Rivest-Shamir-Adleman] in OAEP with SHA-1 mode)<br />
** '''key''': a public key to encode the input. (use [[generateKeyPair]] to create a new private and public key)<br />
|21055}}<br />
<br />
===Optional Arguments===<br />
*'''callback:''' providing a callback will run this function asynchronously, the arguments to the callback are the same as the returned values below.<br />
===Returns for each algorithm===<br />
* ''tea'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
{{New items|3.0159|1.5.8|<br />
* ''aes128'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
** '''iv''' ([https://en.wikipedia.org/wiki/Initialization_vector Initialization vector]): this is a string generated by the encryption algorithm that is needed to decrypt the message by [[decodeString]]. If a callback was provided, ''true'' is returned immediately, and the ''iv'' is passed as an argument to the callback.<br />
|20898}}<br />
{{New items|3.0159|1.5.8|<br />
* ''rsa'' <br />
** '''encodedString''': the encoded string if successful, ''false'' otherwise. If a callback was provided, ''true'' is returned immediately, and the encoded string is passed as an argument to the callback.<br />
|21055}}<br />
<br />
==Examples== <br />
<br />
<section name="Server" class="server" show="true"><br />
Adds an ''/encode'' command in which you can provide an algorithm, key and data to encode. Below is the example provided as both server-side and client-side variations.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("encode", <br />
function(player, _, algorithm, key, ...)<br />
if algorithm and key then<br />
local text = table.concat({...}, " ")<br />
if type(text) == "string" and text ~= "" then<br />
local encoded = encodeString(algorithm, text, { key = key })<br />
if encoded then<br />
outputChatBox("The result of " .. algorithm .. " encoding is: " .. encoded, player)<br />
else<br />
outputChatBox("Failed to encode. Make sure that all arguments are valid.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Please specify text in the command.", player, 255, 0, 0)<br />
end<br />
else<br />
outputChatBox("Invalid algorithm and/or key.", player, 255, 0, 0)<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
This example shows you how to use the RSA encryption with a simple string message.<br />
<syntaxhighlight lang="lua"><br />
local private, public = generateKeyPair("rsa", { size = 2048 })<br />
<br />
local input = "Hello, world!"<br />
local encrypted = encodeString("rsa", input, { key = public })<br />
local decrypted = decodeString("rsa", encrypted, { key = private })<br />
<br />
outputServerLog("RSA test: ".. tostring(input == decrypted))<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Utility_functions&diff=75651Template:Utility functions2022-11-03T14:14:58Z<p>Botder: </p>
<hr />
<div>*[[addDebugHook]]<br />
*[[base64Decode]]<br />
*[[base64Encode]]<br />
{{Bit_functions}}<br />
*[[debugSleep]]<br />
{{New items|3.0156|1.5.5|<br />
*[[decodeString]]<br />
|11849}}<br />
*[[deref]]<br />
{{New items|3.0156|1.5.5|<br />
*[[encodeString]]<br />
|11849}}<br />
*[[fromJSON]]<br />
<!--{{New items|3.0160|1.6.0|--><br />
{{Added feature/item|1.6.0|1.5.9|21055|<br />
*[[generateKeyPair]]<br />
}}<br />
*[[getColorFromString]]<br />
*[[getDevelopmentMode]]<br />
*[[getDistanceBetweenPoints2D]]<br />
*[[getDistanceBetweenPoints3D]]<br />
*[[getEasingValue]]<br />
*[[getFPSLimit]]<br />
*[[getNetworkStats]]<br />
*[[getNetworkUsageData]]<br />
*[[getPerformanceStats]]<br />
<!--{{New items|3.0160|1.6.0|--><br />
{{Added feature/item|1.6.0|1.5.9|21389|<br />
*[[getProcessMemoryStats]]<br />
}}<br />
*[[getRealTime]]<br />
*[[getServerConfigSetting]]<br />
*[[getTickCount]]<br />
*[[getTimerDetails]]<br />
*[[getTimers]]<br />
*[[gettok]]<br />
*[[getUserdataType]]<br />
*[[getVersion]]<br />
*[[hash]]<br />
*[[inspect]]<br />
*[[interpolateBetween]]<br />
*[[iprint]]<br />
*[[isOOPEnabled]]<br />
*[[isTimer]]<br />
*[[killTimer]]<br />
*[[md5]]<br />
*[[passwordHash]]<br />
*[[passwordVerify]]<br />
*[[pregFind]]<br />
*[[pregMatch]]<br />
*[[pregReplace]]<br />
*[[removeDebugHook]]<br />
*[[ref]]<br />
*[[resetTimer]]<br />
*[[setDevelopmentMode]]<br />
*[[setFPSLimit]]<br />
*[[setServerConfigSetting]]<br />
*[[setTimer]]<br />
*[[sha256]]<br />
*[[split]]<br />
*[[teaDecode]]<br />
*[[teaEncode]]<br />
{{New items|3.0156|1.5.5|<br />
*[[tocolor]]<br />
|13977}}<br />
*[[toJSON]]<br />
*[[utfChar]]<br />
*[[utfCode]]<br />
*[[utfLen]]<br />
*[[utfSeek]]<br />
*[[utfSub]]<br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=GetProcessMemoryStats&diff=75650GetProcessMemoryStats2022-11-03T14:12:09Z<p>Botder: Created page with "__NOTOC__ {{Shared function}} {{Added feature/item|1.6.0|1.5.9|21389|This function returns a breakdown of the process memory usage. The reported numbers are always byte units and these numbers can be '''inaccurate'''.}} ==Syntax== <syntaxhighlight lang="lua"> table|nil getProcessMemoryStats ( ) </syntaxhighlight> ==Returns== Returns a table if successful, otherwise returns '''nil''' {| class="wikitable" style="cellpadding: 10px;" |- ! Property || Description |- | <c..."</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{Added feature/item|1.6.0|1.5.9|21389|This function returns a breakdown of the process memory usage. The reported numbers are always byte units and these numbers can be '''inaccurate'''.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
table|nil getProcessMemoryStats ( )<br />
</syntaxhighlight> <br />
<br />
==Returns==<br />
Returns a table if successful, otherwise returns '''nil'''<br />
<br />
{| class="wikitable" style="cellpadding: 10px;"<br />
|-<br />
! Property || Description<br />
|-<br />
| <code>virtual</code> || total program size<br />
|-<br />
| <code>resident</code> || resident set size (memory in physical space/ram, also known as ''working set'')<br />
|-<br />
| <code>shared</code> || size of resident shared memory (shared with other processes)<br />
|-<br />
| <code>private</code> || size of resident private memory (only for this process)<br />
|}<br />
<br />
'''Note:''' Resident set size should be roughly <code>shared</code> + <code>private</code> from the table.<br />
<br />
==Example==<br />
This example will output the memory usage by the server process to the console every 5 minutes.<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
setTimer(function()<br />
local div = 1024^2<br />
<br />
local pmem = getProcessMemoryStats()<br />
<br />
if pmem then<br />
outputServerLog(("[SYS] %.2f MiB rss:%.2f MiB shr:%.2f MiB prv:%.2f MiB"):format(<br />
pmem.virtual / div,<br />
pmem.resident / div,<br />
pmem.shared / div,<br />
pmem.private / div<br />
))<br />
end<br />
end, 5 * 60000, 0)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=EngineReplaceModel&diff=75640EngineReplaceModel2022-11-03T13:27:33Z<p>Botder: </p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
<br />
This function replaces the given model ID with the model contained in a DFF file loaded by [[engineLoadDFF]]. This function supports [[vehicle|vehicles]], [[object|objects]], [[ped|peds]] and [[player|players]] but not CJ clothing and body parts.<br />
<br />
{{Deprecated feature|3.0111|1.1.1|This function does not support ped and weapon models.}}<br />
<br />
To replace weapon models you must use their object IDs, not weapon IDs. There is a weapon model list available at [[weapons]].<br />
{{Note|<br />
* Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations.<br />
* Default GTA map objects behave inconsistently when using this function on them. If you want to replace models in the original GTA map, use one of the [[EngineReplaceModel notes|methods shown here]].<br />
* A raw data DFF element can only be used once, because the underlying memory for the model is released after replacement.<br />
* If the replacement model is broken and the original model is not loaded/streamed-in at the time of replacement, this function will succeed and you won't see any error message, neither when the model replacement fails once the original model starts to load/stream-in.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineReplaceModel ( dff theModel, int modelID [, bool alphaTransparency = false ] )<br />
</syntaxhighlight> <br />
{{OOP||[[DFF|dff]]:replace}}<br />
===Required Arguments=== <br />
*'''theModel:''' The model to replace the given model ID with<br />
*'''modelID:''' The model it to replace the model of<br />
<br />
===Optional Arguments=== <br />
*'''alphaTransparency:''' Set to true if model uses semi-transparent textures, e.g. windows. This will ensure other objects behind the semi-transparent textures are rendered correctly. (Can slightly impact performance, so only set when required)<br />
<br />
===Returns===<br />
Returns ''true'' if the model was successfully replaced, ''false'' if it failed for some reason, ie. the DFF or the model ID is not valid.<br />
<br />
==Example== <br />
<section name="Client" class="client" show="true"><br />
This example allows you to replace single or many models (with ability to toggle TXD filtering/DFF alpha transparency) - by using [[table]]. Do not forget to add those file paths to [[meta.xml]]<br />
<syntaxhighlight lang="lua"><br />
function onClientResourceStartReplaceModels()<br />
local modelsToReplace = {<br />
{ -- replace object<br />
colFile = "object.col",<br />
txdFile = "object.txd",<br />
dffFile = "object.dff",<br />
modelID = 1337,<br />
alphaTransparency = false,<br />
filteringEnabled = true,<br />
},<br />
{ -- replace vehicle<br />
colFile = false, -- if .col is not present set to false/nil<br />
txdFile = "vehicle.txd",<br />
dffFile = "vehicle.dff",<br />
modelID = 434,<br />
alphaTransparency = false,<br />
filteringEnabled = true,<br />
},<br />
}<br />
<br />
for assetID = 1, #modelsToReplace do<br />
local modelData = modelsToReplace[assetID]<br />
local modelCol = modelData.colFile<br />
local modelTxd = modelData.txdFile<br />
local modelDff = modelData.dffFile<br />
local modelID = modelData.modelID<br />
<br />
if modelCol then<br />
local colData = engineLoadCOL(modelCol)<br />
<br />
if colData then<br />
engineReplaceCOL(colData, modelID)<br />
end<br />
end<br />
<br />
if modelTxd then<br />
local filteringEnabled = modelData.filteringEnabled<br />
local txdData = engineLoadTXD(modelTxd, filteringEnabled)<br />
<br />
if txdData then<br />
engineImportTXD(txdData, modelID)<br />
end<br />
end<br />
<br />
if modelDff then<br />
local dffData = engineLoadDFF(modelDff)<br />
<br />
if dffData then<br />
local alphaTransparency = modelData.alphaTransparency<br />
<br />
engineReplaceModel(dffData, modelID, alphaTransparency)<br />
end<br />
end<br />
end<br />
end<br />
addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStartReplaceModels)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=How_you_can_help&diff=75639How you can help2022-11-03T13:16:07Z<p>Botder: Reverted edits by Absolwent (talk) to last revision by Lopez</p>
<hr />
<div>__NOTOC__<br />
Multi Theft Auto has loads of areas in which you can help us. In turn, we'll be more than happy to help you get started with any ideas you have, help test them and - if they're good enough - release them to the whole community. This page outlines the key areas you could do something in, of course, there are many things we've not thought of, so think outside the box!<br />
<br />
==Coding for MTA:SA==<br />
* Become a patch contributor by sending [https://github.com/multitheftauto/mtasa-blue/pulls pull requests] to MTA, containing requested features or bugfixes. ([https://github.com/multitheftauto/mtasa-blue/blob/master/CONTRIBUTING.md#contributors-guide Coding guidelines])<br />
* Translate MTA:SA to your native language - https://translate.multitheftauto.com/<br />
<br />
==Scripting==<br />
* Become a contributor to MTA's official resources by sending [https://github.com/multitheftauto/mtasa-resources/pulls pull requests] to our resources repository<br />
* Create and [https://community.mtasa.com/ publish] a gamemode or useful script<br />
**[[Scripting Introduction]]<br />
**[https://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
* Make a general purpose resource that provides useful functions to other resources.<br />
<br />
==Mapping==<br />
* Create and [https://community.mtasa.com/ publish] a map for an existing gamemode, with the map editor.<br />
**[[Resource:Editor|Map Editor Manual]]<br />
<br />
==Web development==<br />
* Create your own system for statistics - using the [[PHP SDK]] as a basis. Join the [https://discord.gg/RygaCSD MTA discord] (or [https://discord.gg/GNN6PRtTnu development discord]) for help.<br />
<br />
==Documentation==<br />
Before you make changes check out: [[Help:Editing Guidelines|Editing Guidelines]] and [[Help:MTA Wiki Specific Templates|Specific Templates]]<br />
* Finish documentation for [[:Category:Incomplete|Incomplete functions]] - ask in #mta.scripting if you're not sure of something.<br />
* Add examples to [[:Category:Needs Example|functions & events missing examples]] - please '''test''' them, and again, ask if you need help.<br />
* Review and verify [[:Category:Needs Checking|pages that need checking]] - make sure highlighted issues are solved before removing pages from the category.<br />
* Expand the pages that explain [[:Category:Scripting_Concepts|MTA core concepts]].<br />
* Write [https://forum.mtasa.com/forum/123-tutorials/ tutorials] to help new people.<br />
* Translate the wiki pages so people from other countries can get started in MTA too.<br />
* Create documentation for undocumented functions and events [[Undocumented Items]]<br />
* Keep 'changes in' [current work-in-progress: https://wiki.multitheftauto.com/wiki/Changes_in_1.6] for future releases updated.<br />
<br />
==Quality Assurance==<br />
* [https://github.com/multitheftauto/mtasa-blue/issues Report issues] with the mod, make sure to do a search on the already reported issues first.<br />
* Test and confirm existing reported issues.<br />
* Use the newest build of MTA to detect and report new bugs, by going to 'Settings', 'Advanced', 'Update build type' and choosing 'Nightly' or get it regularly [https://nightly.mtasa.com/ from here].<br />
* Any bugs which are related to a scripting function / event and present in the main release (rather than nightlies), document that bug by adding a [https://wiki.multitheftauto.com/wiki/Help:MTA_Wiki_Specific_Templates warning] to the wiki page to save other scripters a lot of time.<br />
<br />
==Specific tasks==<br />
* Create a fuzzer to check for crashes in our scripting functions.<br />
<br />
==Grant==<br />
You can donate to MTA:SA [https://mtasa.com/donate/manage.php here]<br />
<br />
[[ar:كيف_يمكنك_المساعدة]]<br />
[[en:How you can help]]<br />
[[ru:How you can help]]<br />
[[pl:Jak możesz pomóc]]<br />
[[uk:How you can help]]<br />
[[es:Cómo puedes ayudar]]<br />
[[hu:How you can help]]<br />
[[tr:Nasıl yardımcı olabilirsiniz]]<br />
[[pt-br:Como você pode ajudar]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Strona_g%C5%82%C3%B3wna&diff=75638Strona główna2022-11-03T13:15:56Z<p>Botder: Reverted edits by Absolwent (talk) to last revision by Tracer</p>
<hr />
<div>{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div style="/*border: 1px solid #D8D8D8;*/ padding-left: 15px; padding-right: 15px; height: 100%;"><br />
[[File:Mtalogo.png|left|100px|link=http://wiki.multitheftauto.com/]]'''Witaj na polskiej wiki [[PL/Multi Theft Auto|Multi Theft Auto]].''' Znajdziesz tutaj wiele informacji na temat korzystania z Multi Theft Auto.<br />
<br />
Jest wiele [[PL/How you can help|rzeczy które możesz zrobić]], aby pomóc nam w rozwijaniu MTA - stworzyć mapę, tryb gry, pomóc w dokumentowaniu funkcji, napisać przykładowy kod, napisać poradnik lub po prostu grać w MTA i zgłaszać błędy, które znajdziesz.<br />
<br />
Jeśli masz jakieś pytania bądź problemy związane z pisaniem skryptów, zapytaj nas na [[PL/IRC Channel|kanale IRC]].<br />
<br/><br/>[ Przestań się bawić ze sobą ]<br />
</div><br />
|}<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
|-<br />
|width="50%" style="vertical-align:top;" |<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;"><br />
<div style="float:right; width: 32px;">[[File:Input-gaming.png|link=]]</div><br />
<h3>Graj</h3><br />
<div style="background: #FFEEAA; border: 1px solid #FFCD19;"><br />
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Pobierz Multi Theft Auto: San Andreas {{Current Version|full}}]'''</div><br />
* [[PL/Where to buy GTASA|Gdzie kupić GTASA]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Client Manual|Obsługa klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
<!-- * [[PL/Changes_in_{{padleft:|3|{{Current Version|full}}}}| Zmiany w {{padleft:|3|{{Current Version|full}}}}]] --><br />
* [[Changes_in_{{padleft:|5|{{Current Version|full}}}}|Zmiany w {{padleft:|5|{{Current Version|full}}}}]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[PL/Known_Issues_-_FAQ|Znane problemy]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[PL/Migracja_z_MTA:Race_do_MTA:SA_1.0.x|Migracja z MTA:Race do MTA:SA {{padleft:|3|{{Current Version|full}}}}]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Server Manual|Obsługa serwera]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Map manager|Menadżer map]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
<br />
<h3>Edytor map</h3><br />
*[[PL/Resource:Editor|Instrukcja]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Resource:Editor/EDF|Edytor Właściwości Mapy]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
*[[Resource:Editor/Plugins|Pluginy]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
*[[PL/Resource:Editor#FAQ|Najczęściej zadawane pytania]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Package-x-generic.png|link=]]</div><br />
<h3>Bazy danych</h3><br />
Ta sekcja opisuje wszystkie możliwości Lua umożliwiane przez MTA lub zasoby.<br />
* [[PL/Category:Resource|Katalog zasobów]] - Musisz je poznać, aby tworzyć właściwe skrypty<br />
* [[PL/Client side scripts|Skrypty po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Moduły]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-development.png|link=]]</div><br />
<h3>Rozwijanie Multi Theft Auto</h3><br />
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Nightly builds]<br />
* [[Compiling_MTASA|Kompilacja MTASA na Windows]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Building_MTASA_Server_on_GNU_Linux|Kompilacja MTASA na GNU/Linux]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Coding guidelines|Wytyczne dot. pisania kodu]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [https://github.com/multitheftauto/mtasa-blue Repozytorium Github]<br />
* [[Roadmap]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [http://bugs.mtasa.com/ Bugtracker]<br />
* [[Branches|Branże]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-office.png|link=]]</div><br />
<h3>Polskie Wiki - jak możesz pomóc?</h3><br />
* Pomóż tłumaczyć hasła, przy których jest angielska flaga<br />
* Twórz hasła, które istnieją w angielskiej wiki, a których u nas brakuje<br />
** Staraj się, aby nowe artykuły miały takie same nazwy (angielskie), a jedynie poprzedzane były przedrostkiem PL/ - przykład: [[PL/Character_Skins]]<br />
* Zwołaj znajomych, informuj na forach, niech inni dowiedzą się o takiej możliwości!<br />
* Jeśli nie masz pomysłu na edycję, wykonaj coś z [[PL/Todo|tej listy]]. Możesz ją także rozbudować.<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Internet-group-chat.png|link=]]</div><br />
<h3>Społeczność</h3><br />
* [http://forum.multitheftauto.com/ Forum]<br />
* Discord: [https://forum.mtasa.com/topic/95008-multi-theft-autos-official-discord-server/ Oficjalny serwer Discord MTA]<br />
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]<br />
* [http://community.mtasa.com/ MTA Community] - dodaj lub pobierz skrypty<br />
* [http://twitter.com/#!/MTAQA/ Twitter] - [http://www.youtube.com/user/MTAQA Youtube] - [http://plus.google.com/102014133442331779727/ Google+] - [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]<br />
</div><br />
<br />
| width="50%" style="vertical-align:top;" |<br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Accessories-text-editor.png|link=]]</div><br />
<h3>Skryptowanie</h3><br />
* [[Wstęp do pisania skryptów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Wstęp do pisania skryptów GUI]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Debugging|Poradnik debugowania]] [[Image:usen.gif|Artykuł w języku angielskim]] - Jak znaleźć błędy w swoich skryptach<br />
* [[PL/Zasoby|Wstęp do zasobów]] [[Image:Plflag.png|Artykuł w języku angielskim]]<br />
** [[Resource Web Access|Dostęp WWW do zasobów]] [[Image:usen.gif|Artykuł w języku angielskim]] - Jak pisać strony WWW z wykorzystaniem zasobów<br />
** [[:Category:Resource|Katalog zasobów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
** [[PL/Meta.xml|Meta.xml]] [[Image:Plflag.png|Artykuł w języku polskim]] - każdy zasób jest definiowany przez plik meta<br />
** [[ACL]] [[Image:usen.gif|Artykuł w języku angielskim]] - Access Control List, który jest niezbędny, aby skrypty działały<br />
* [[Writing_Gamemodes|Pisanie gamemodów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
* [[Przydatne Funkcje]] [[Image:Plflag.png|Artykuł w polskim]]<br />
Linki na fora<br />
* [https://forum.mtasa.com/forum/71-scripting/ Forum na temat skryptowania]<br />
* [https://forum.mtasa.com/forum/123-tutorials/ Forum z poradnikami do skryptowania]<br />
* [https://forum.mtasa.com/topic/24702-mtasa-wiki-offline-copies-online-mirrors/ Kopie Wiki]<br />
<div style="float:right; width: 32px;">[[File:start-here.png|link=]]</div><br />
<h3>Pomoc dotycząca LUA</h3><br />
Strony zaprojektowane, by pomóc Ci zrozumieć język LUA.<br />
*[http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]<br />
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]<br />
*[http://nixstaller.sourceforge.net/manual/0.5.1/nixstaller_10.html A general guide to Lua from Nixstaller]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;"><br />
<div style="float:right; width: 32px;">[[File:Preferences-system.png|link=]]</div><br />
<h3>Odwołania</h3><br />
* [[PL/Funkcje po stronie klienta|Funkcje po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Client Scripting Events|Zdarzenia po stronie klienta]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[PL/Server Scripting Functions|Funkcje po stronie serwera]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
* [[Server Scripting Events|Zdarzenia po stronie serwera]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
<!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --><br />
* [[PL/MTA Classes|Klasy MTA]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]] -- Szczegółowe opisy wszystkich typów MTA<br />
** [[PL/Element|Elementy MTA]] [[Image:Plflag.png|Artykuł w języku angielskim]] / [[Element tree|Drzewo elementów]] [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:System-file-manager.png|link=]]</div><br />
<h3>[[PL/Id|Listy ID]]</h3><br />
*[[PL/Animations|Animacje]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Character Skins|Skiny postaci]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/CJ_Clothes|Ubrania]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Garage|Garaże]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Interior IDs|Interiory]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Material IDs|Materiały]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Projectiles|Pociski]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Radar Blips|Znaczniki]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Sounds|Dźwięki]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle IDs|Pojazdy]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle Colors|Kolory pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle Upgrades|Modyfikacje pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle variants|Warianty pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Vehicle component manipulation|Manipulowanie komponentami pojazdów]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Weapons|Bronie]] [[Image:Plflag.png|Artykuł w języku polskim]]<br />
*[[PL/Weather|Pogoda]] [[Image:Plflag.png|Artykuł w języku polskim]] / [[Image:usen.gif|Artykuł w języku angielskim]]<br />
</div><br />
<div style="padding:4px 8px 8px 8px; margin:10px;"><br />
[[File:Osi symbol.png|75px|link=http://opensource.org/|left]]<br />
'''Multi Theft Auto''' jest '''Otwartym Oprogramowaniem'''. <br />
<br/>To znaczy, że każdy może pomóc w byciu Multi Theft Auto lepszym!<br />
</div><br />
|-<br />
| colspan="2" |<br />
|}<br />
{| width="100%" cellspacing="0" cellpadding="0"<br />
| colspan="2" |<br />
<div style="padding-left: 15px; padding-right: 15px;" class="plainlinks"><br />
[[File:MTALogo_8ball.png|left|85px|link=Archive]]<br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''O [[PL/Multi Theft Auto|Multi Theft Auto]]'''</li><br />
<li>[[PL/Archive|Archiwum]]</li><br />
<li>[[Press Coverage|MTA w mediach]]</li><br />
<li>[http://code.google.com/p/mtasa-blue/people/list Developerzy]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Multi Theft Auto 0.5'''</li><br />
<li>[[PL/Archive#Multi_Theft_Auto_0.5|Pobierz]]</li><br />
<li>[[MTA 0.5r2 Known Issues|Zauważone problemy]]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Statystyki Wiki'''</li><br />
<li>{{NUMBEROFARTICLES}} artykuły</li><br />
<li>{{NUMBEROFPAGES}} strony</li><br />
<li>{{NUMBEROFFILES}} pliki</li><br />
</ul><br />
<ul style="list-style: none; width: 240px; float: left;"><br />
<li>{{NUMBEROFEDITS}} edycji</li><br />
<li>{{NUMBEROFADMINS}} administratorów</li><br />
<li>{{NUMBEROFUSERS}} zarejestrowanych użytkowników</li><br />
<li>{{NUMBEROFACTIVEUSERS}} aktywnych użytkowników</li><br />
</ul><br />
</div><br />
|}<br />
<br />
__NOTOC__<br />
__NOEDITSECTION__<br />
{{Languages list|pl}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=RU/Shared_Scripting_Functions&diff=75249RU/Shared Scripting Functions2022-07-10T15:21:18Z<p>Botder: Add XML translations</p>
<hr />
<div><pageclass class="both"></pageclass><br />
{{RU/Adding_Pages_to_Categories_and_Templates}}<br />
На этой странице перечислены все '''shared''' скриптовые функции, которые были реализованы и доступны как собственные функции из мода Deathmatch.<br />
<br />
Для получения дополнительных функций посмотрите [[Useful_Functions|страницу полезных функций]].<br />
__TOC__<br />
<br />
==Функции ввода==<br />
{{Shared_input_functions}}<br />
<br />
==Функции взрыва==<br />
{{Shared_explosion_functions}}<br />
<br />
==Функции воды==<br />
{{RU/Shared_water_functions}}<br />
<br />
==Функции вывода==<br />
{{Shared_output_functions}}<br />
<br />
==Функции звука==<br />
{{Shared_sound_functions}}<br />
<br />
==Функции игрока==<br />
{{Shared_player_functions}}<br />
<br />
==Функции камеры==<br />
{{Shared_camera_functions}}<br />
<br />
==Функции коллизии==<br />
{{Shared_collision_shape_functions}}<br />
<br />
==Функции курсора==<br />
{{Shared_cursor_functions}}<br />
<br />
==Функции маркера==<br />
{{Shared_marker_functions}}<br />
<br />
==Функции матрицы==<br />
{{Shared_matrix_functions}}<br />
<br />
==Функции меток на радаре==<br />
{{Shared_blip_functions}}<br />
<br />
==Функции мира==<br />
{{Shared_world_functions}}<br />
<br />
==Функции объекта==<br />
{{Shared_object_functions}}<br />
<br />
==Функции оружия==<br />
{{RU/Shared_weapon_functions}}<br />
<br />
==Функции пешехода (NPC)==<br />
{{Shared_ped_functions}}<br />
<br />
==Функции пикапа==<br />
{{Shared_pickup_functions}}<br />
<br />
==Функции ресурса==<br />
{{RU/Shared_resource_functions}}<br />
<br />
==Функции сервера==<br />
{{Shared_server_functions}}<br />
<br />
==Функции снаряда==<br />
{{Shared_projectile_functions}}<br />
<br />
==Функции события==<br />
{{RU/Shared_event_functions}}<br />
<br />
==Функции тела и одежды==<br />
{{Shared_clothes_and_body_functions}}<br />
<br />
==Функции территории радара==<br />
{{Shared_radar_functions}}<br />
<br />
==Функции транспорта==<br />
{{Shared_vehicle_functions}}<br />
<br />
==Функции утилит==<br />
{{Shared_utility_functions}}<br />
<br />
==Файловые функции==<br />
{{Shared_file_functions}}<br />
<br />
==Функции элемента==<br />
{{RU/Shared_element_functions}}<br />
<br />
==Функции UTF-8==<br />
{{Shared_utf8_functions}}<br />
<br />
==Функции XML==<br />
{{RU/Shared_XML_functions}}<br />
<br />
[[en:Shared Scripting Functions]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Shared_Scripting_Functions&diff=75248Shared Scripting Functions2022-07-10T15:19:16Z<p>Botder: Undo last two edits</p>
<hr />
<div><pageclass class="both"></pageclass><br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
This page lists all the '''shared''' scripting functions that have been implemented and are available as native functions from the Deathmatch mod. To request a function or event, use [[Requested Functions and Events]]<br />
<br />
For more functions, check the [[Useful_Functions|useful functions page]].<br />
__TOC__<br />
<br />
==Element functions==<br />
{{Shared_element_functions}}<br />
<br />
==Ped functions==<br />
{{Shared_ped_functions}}<br />
<br />
==Player functions==<br />
{{Shared_player_functions}}<br />
<br />
==Weapon functions==<br />
{{Shared_weapon_functions}}<br />
<br />
==Sound functions==<br />
{{Shared_sound_functions}}<br />
<br />
==Blip functions==<br />
{{Shared_blip_functions}}<br />
<br />
==Camera functions==<br />
{{Shared_camera_functions}}<br />
<br />
==Clothes and body functions==<br />
{{Shared_clothes_and_body_functions}}<br />
<br />
==Collision shape functions==<br />
{{Shared_collision_shape_functions}}<br />
<br />
==Cursor functions==<br />
{{Shared_cursor_functions}}<br />
<br />
==Event functions==<br />
{{Shared_event_functions}}<br />
<br />
==Explosion functions==<br />
{{Shared_explosion_functions}}<br />
<br />
==File functions==<br />
{{Shared_file_functions}}<br />
<br />
==Input functions==<br />
{{Shared_input_functions}}<br />
<br />
==Marker functions==<br />
{{Shared_marker_functions}}<br />
<br />
==Matrix functions==<br />
{{Shared_matrix_functions}}<br />
<br />
==Object functions==<br />
{{Shared_object_functions}}<br />
<br />
==Output functions==<br />
{{Shared_output_functions}}<br />
<br />
==Pickup functions==<br />
{{Shared_pickup_functions}}<br />
<br />
==Projectile functions==<br />
{{Shared_projectile_functions}}<br />
<br />
==Radar functions==<br />
{{Shared_radar_functions}}<br />
<br />
==Resource functions==<br />
{{Shared_resource_functions}}<br />
<br />
==Server functions==<br />
{{Shared_server_functions}}<br />
<br />
==Utility functions==<br />
{{Shared_utility_functions}}<br />
<br />
==UTF8 Library==<br />
{{Shared_utf8_functions}}<br />
<br />
==Vehicle functions==<br />
{{Shared_vehicle_functions}}<br />
<br />
==Water functions==<br />
{{Shared_water_functions}}<br />
<br />
==World functions==<br />
{{Shared_world_functions}}<br />
<br />
==XML functions==<br />
{{Shared_xml_functions}}<br />
<br />
[[ru:Shared Scripting Functions]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=75217Template:Useful Functions2022-07-01T18:36:20Z<p>Botder: /* Gridlists */</p>
<hr />
<div>__NOTOC__<br />
=== Table functions ===<br />
*[[addTableChangeHandler]] <span style="color:gray; font-size:smaller;">» This function monitors the changes of a table.</span><br />
*[[getTableFromSql]] <span style="color:gray; font-size:smaller;">» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).</span><br />
*[[isValueInTable]] <span style="color:gray; font-size:smaller;">» This function returns true if the value exists in the table, false if the value does not exist in the table.</span><br />
*[[pairsByKeys]] <span style="color:gray; font-size:smaller;">» This function sort pairs table.</span><br />
*[[rangeToTable]] <span style="color:gray; font-size:smaller;">» This function converts a string range to a table containing number values.</span><br />
*[[setTableProtected]] <span style="color:gray; font-size:smaller;">» This function protects a table and makes it read-only.</span><br />
*[[setTableToSql]] <span style="color:gray; font-size:smaller;">» This function is used to save the table in the database (sql).</span><br />
*[[Sort_Functions]] <span style="color:gray; font-size:smaller;">» These functions are able to sort your tables by a key.</span><br />
*[[table.compare]] <span style="color:gray; font-size:smaller;">» This function checks whether two given tables are equal.</span><br />
*[[table.copy]] <span style="color:gray; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.deepmerge]] <span style="color:gray; font-size:smaller;">» This function deep merges two tables. Every nested table will be correspondingly merged.</span><br />
*[[table.element]] <span style="color:gray; font-size:smaller;">» This function returns a new table with only userdata content.</span><br />
*[[table.empty]] <span style="color:gray; font-size:smaller;">» This function checks whether a table is empty.</span><br />
*[[table.fromString]] <span style="color:gray; font-size:smaller;">» This function converts string to a table.</span><br />
*[[table.getRandomRows]] <span style="color:gray; font-size:smaller;">» This function returns random rows from table.</span><br />
*[[table.map]] <span style="color:gray; font-size:smaller;">» 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.</span><br />
*[[table.merge]] <span style="color:gray; font-size:smaller;">» This function merges two or more tables together.</span><br />
*[[table.random]] <span style="color:gray; font-size:smaller;">» This function retrieves a random value from a table.</span><br />
*[[table.removeValue]] <span style="color:gray; font-size:smaller;">» This function removes a specified value from a table.</span><br />
*[[table.size]] <span style="color:gray; font-size:smaller;">» This function returns the absolute size of a table.</span><br />
*[[table.toString]] <span style="color:gray; font-size:smaller;">» This function converts table to a string.</span><br />
<br />
=== ACL functions ===<br />
*[[aclGroupClone]] <span style="color:gray; font-size:smaller;">» This function clone a group to another group with/without ACLs and/or objects.</span><br />
*[[getAccountsRanks]] <span style="color:gray; font-size:smaller;">» This function is used to detect the account name groups and put them in the chat.</span><br />
*[[getPlayerAcls]] <span style="color:gray; font-size:smaller;">» This function returns a table of all ACL groups on a player.</span><br />
*[[getPlayersInACLGroup]] <span style="color:gray; font-size:smaller;">» This function returns all players in an ACL group.</span><br />
*[[isPlayerInACL]] <span style="color:gray; font-size:smaller;">» This function checks if a player element is in an ACL group.</span><br />
*[[renameAclGroup]] <span style="color:gray; font-size:smaller;">» This function gives an existing ACL group a new name.</span><br />
<br />
=== Account functions ===<br />
*[[getPlayerFromAccountName]] <span style="color:gray; font-size:smaller;">» This function is used to obtain a player by the name of his account.</span><br />
<br />
=== Camera functions ===<br />
*[[smoothMoveCamera]] <span style="color:gray; font-size:smaller;">» This function allows you to create a cinematic camera flight.<br />
<br />
=== Cursor functions ===<br />
*[[getCursorMovedOn]] <span style="color:gray; font-size:smaller;">» This function checks in which way the cursor is currently moving.</span><br />
<br />
=== Drawing functions ===<br />
*[[dxDrawAnimWindow]] <span style="color:gray; font-size:smaller;">» This function draws an animated 2D window on the screen.</span><br />
*[[dxDrawBorderedRectangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a bordered rectangle.</span><br />
*[[dxDrawBorderedText]] <span style="color:gray; font-size:smaller;">» This is a function that will create a bordered text.</span><br />
*[[dxDrawDashedLine]] <span style="color:gray; font-size:smaller;">» This function draws a line with dashes.</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-size:smaller;">» This function simulates the effect of a GIF image by using image sprites in 2D.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-size:smaller;">» This function draws a 3D image in GTA world.</span><br />
*[[dxDrawImageOnElement]] <span style="color:gray; font-size:smaller;">» This function draws an image on any element.</span><br />
*[[dxDrawLinedRectangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a rectangle outline with dx lines.</span><br />
*[[dxDrawLoading]] <span style="color:gray; font-size:smaller;">» This function draws a loading bar on the screen.</span><br />
*[[dxDrawOctagon3D]] <span style="color:gray; font-size:smaller;">» This function creates a 3D Octagon</span><br />
*[[dxDrawPolygon]] <span style="color:gray; font-size:smaller;">» This function draws a custom polygon on the screen.</span><br />
*[[dxDrawProgressBar]] <span style="color:gray; font-size:smaller;">» This function simulates a progress bar drawed using DirectDraw.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-size:smaller;">» This function draws a 3D rectangle in GTA world.</span><br />
*[[dxDrawRectangleOnPlayer]] <span style="color:gray; font-size:smaller;">» This function draws a 3D rectangle above the player.</span><br />
*[[dxDrawRing]] <span style="color:gray; font-size:smaller;">» This function draws a ring with dx lines.</span><br />
*[[dxDrawRombo]] <span style="color:gray; font-size:smaller;">» This function creates a Rhombus.</span><br />
*[[dxDrawSprite]] <span style="color:gray; font-size:smaller;">» This function draw a sprite in the 3D world.</span><br />
*[[dxDrawTextOnElement]] <span style="color:gray; font-size:smaller;">» This function draws a text on any element.</span><br />
*[[dxDrawTextOnRectangle]] <span style="color:gray; font-size:smaller;">» Esta funcion crea un rectangle con un texto dentro.</span><br />
*[[dxDrawTriangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a triangle with dx lines.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-size:smaller;">» This function calculates the font size from given height.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-size:smaller;">» This function calculates the height of a font.</span><br />
*[[getScreenStartPositionFromBox]] <span style="color:gray; font-size:smaller;">» This function helps with getting the correct position for your dx-effects.</span><br />
*[[wordWrap]] <span style="color:gray; font-size:smaller;">» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.</span><br />
*[[CreateRectangle3D]] <span style="color:gray; font-size:smaller;">» This is a function that will create a 3d rectangle on the player screen.</span><br />
<br />
=== Effects functions ===<br />
*[[attachEffect]] <span style="color:gray; font-size:smaller;">» This function allows you attach an effect to an element.</span><br />
<br />
=== Element functions === <br />
*[[autoAttach]] <span style="color:gray; font-size:smaller;">» This function attaches one element into another at the same position and rotation they are.</span><br />
*[[isElementPlayer]] <span style="color:gray; font-size:smaller;">» This function checks whether the element is a player or not.</span><br />
*[[attachElementToBone]] <span style="color:gray; font-size:smaller;">» This function allows you to attach an element to ped bone accurately using new bone functions.</span><br />
*[[getElementsInDimension]] <span style="color:gray; font-size:smaller;">» This function returns a table of elements that are in the specified dimension.</span><br />
*[[getElementSpeed]] <span style="color:gray; font-size:smaller;">» This function returns the specified element's speed in m/s, km/h or mph.</span><br />
*[[getElementsWithinMarker]] <span style="color:gray; font-size:smaller;">» This function returns a table of elements that are within a marker's collision shape.</span><br />
*[[getElementUsingData]] <span style="color:gray; font-size:smaller;">» This function returns table elements that contains the elements data with the given key and value.</span><br />
*[[getNearestElement]] <span style="color:gray; font-size:smaller;">» This function returns the nearest element (of a specific type) to a player.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-size:smaller;">» This function checks if an element is in the player's camera picture area.</span><br />
*[[isElementInRange]] <span style="color:gray; font-size:smaller;">» This function allows you to check if an element's range to a main point is within the maximum range.</span><br />
*[[isElementMoving]]<span style="color:gray; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isElementWithinAColShape]]<span style="color:gray; font-size:smaller;">» This function checks if an element is within a collision shape element.</span><br />
*[[isElementInAir]]<span style="color:gray; font-size:smaller;">» This function checks if an element is in air or not.</span><br />
*[[multi_check]] <span style="color:gray; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-size:smaller;">» This function allows you to set the speed of an element in kph or mph units.</span><br />
<br />
=== Events ===<br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-size:smaller;">» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.</span><br />
<br />
=== Input functions ===<br />
*[[bindControlKeys]] <span style="color:gray; font-size:smaller;">» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.</span><br />
*[[getBoundControls]] <span style="color:gray; font-size:smaller;">» This function returns a table of control names that are bound to the specified key.</span><br />
*[[unbindControlKeys]] <span style="color:gray; font-size:smaller;">» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].</span><br />
<br />
=== Data functions === <br />
*[[byte2human]] <span style="color:gray; font-size:smaller;">» This function converts an integer (number of bytes) into a human-readable unit.</span><br />
*[[capitalize]] <span style="color:gray; font-size:smaller;">» This function capitalizes a given string.</span><br />
*[[convertDate]] <span style="color:gray; font-size:smaller;">» This function converts date to another look.</span><br />
*[[convertServerTickToTimeStamp]] <span style="color:gray; font-size:smaller;">» This function converts server ticks to a unix timestamp.</span><br />
*[[convertTextToSpeech]] <span style="color:gray; font-size:smaller;">» This function converts the provided text to a speech in the provided language which players can hear.</span><br />
*[[findRotation3D]] <span style="color:gray; font-size:smaller;">» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.</span><br />
*[[findRotation]] <span style="color:gray; font-size:smaller;">» This function takes two points and returns the direction from point A to point B.</span><br />
*[[formatDate]] <span style="color:gray; font-size:smaller;">» This function formats a date on the basis of a format string and returns it.</span><br />
*[[formatNumber]] <span style="color:gray; font-size:smaller;">» This function formats large numbers by adding commas.</span><br />
*[[generateRandomASCIIString]] <span style="color:gray; font-size:smaller;">» This function returns a random string which uses ASCII characters. </span><br />
*[[generateString]] <span style="color:gray; font-size:smaller;">» This function generates a random string with any characters.</span><br />
*[[getAge]] <span style="color:gray; font-size:smaller;">» This function calculates the age of a given birthday.</span><br />
*[[getDistanceBetweenElements]] <span style="color:gray; font-size:smaller;">» Returns the distance between two elements.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-size:smaller;">» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getEasterDate]] <span style="color:gray; font-size:smaller;">» This function returns easter date monthday and month for a given year.</span><br />
*[[getFreeDimension]] <span style="color:gray; font-size:smaller;">» This function get free dimension.</span><br />
*[[getKeyFromValueInTable]] <span style="color:gray; font-size:smaller;">» This function returns the key of the specified value in a table.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-size:smaller;">» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.</span><br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-size:smaller;">» This function finds a point based on a starting point, direction and distance.</span><br />
*[[getRealMonth]] <span style="color:gray; font-size:smaller;">» This function returns the current month name</span><br />
*[[getRGColorFromPercentage]] <span style="color:gray; font-family:'Georgia', sans-serif; font-size:smaller;">»This function returns two integers representing red and green colors according to the specified percentage.</span><br />
*[[getScreenRotationFromWorldPosition]] <span style="color:gray; font-size:smaller;">» This function returns a screen relative rotation to a world position.</span><br />
*[[getTimestamp]] <span style="color:gray; font-size:smaller;">» This function returns the UNIX timestamp of a specified date and time.</span><br />
*[[gradientString]] <span style="color:gray; font-size:smaller;">» This function transforms a string in a new coloured gradient string.</span><br />
*[[hex2rgb]] <span style="color:gray; font-size:smaller;">» This function convert hex to rgb.</span><br />
*[[hexColorToRGB]] <span style="color:gray; font-size:smaller;">» This function convert hex string/number to RGBA values.</span><br />
*[[isLeapYear]] <span style="color:gray; font-size:smaller;">» This function returns a boolean representing if a given year is a leap year.</span><br />
*[[isValidMail]] <span style="color:gray; font-size:smaller;">» This function checks whether a provided e-mail string is valid.</span><br />
*[[removeHex]] <span style="color:gray; font-size:smaller;">» This function is used to remove hexadecimal numbers (colors, for example) from strings.<br />
*[[RGBToHex]] <span style="color:gray; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[RGBToHSV]] <span style="color:gray; font-size:smaller;">» This function convert RGB to HSV color space.</span><br />
*[[RGBToDecimal]] <span style="color:gray; font-size:smaller;">» This function convert RGB to Decimal color.</span><br />
*[[secondsToTimeDesc]] <span style="color:gray; font-size:smaller;">» This function converts a plain seconds-integer into a user-friendly time description.</span><br />
*[[string.count]] <span style="color:gray; font-size:smaller;">» This function counts the amount of occurences of a string in a string.</span><br />
*[[string.explode]] <span style="color:gray; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[string.insert]] <span style="color:gray; font-size:smaller;">» This function inserts a string within another string at a given position.</span><br />
*[[switch]] <span style="color:gray; font-size:smaller;">» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.</span><br />
*[[tocolor2rgba]] <span style="color:gray; font-size:smaller;">» This function convert tocolor to rgba.</span><br />
*[[toHex]] <span style="color:gray; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.</span><br />
*[[var dump]] <span style="color:gray; font-size:smaller;">» This function outputs information about one or more variables using outputConsole.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-size:smaller;">» This function converts a physical wavelength of light to a RGBA color.</span><br />
<br />
=== GUI functions === <br />
*[[centerWindow]] <span style="color:gray; font-size:smaller;">» This function centers a CEGUI window element responsively in any resolution.</span><br />
*[[guiMoveElement]] <span style="color:gray; font-size:smaller;">» This function moves guiElement by/like using moveObject.</span><br />
*[[guiSetStaticImageMovable]] <span style="color:gray; font-size:smaller;">» This function allows you to move a static image like a gui window.</span><br />
*[[isMouseOnGUICloseButton]] <span style="color:gray; font-size:smaller;">» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.</span><br />
*[[isMouseOnGuiElement]] <span style="color:gray; font-size:smaller;">» 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. </span><br />
=====Comboboxes=====<br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-size:smaller;">» This function adjusts a CEGUI combobox element to have the correct height.</span><br />
<br />
=====Gridlists=====<br />
*[[convertGridListToText]] <span style="color:gray; font-size:smaller;">» This function converts grid list contents to text.</span><br />
*[[getGridListRowIndexFromText]] <span style="color:gray; font-size:smaller;">» This function returns the GridList row index from the specified text.</span><br />
*[[guiGridListAddPlayers]] <span style="color:gray; font-size:smaller;">» This function add all online players to a grid list.</span><br />
*[[guiGridListGetColumnIDFromTitle]] <span style="color:gray; font-size:smaller;">» This function gets a gridlist's column ID from the column title.</span><br />
*[[guiGridListGetSelectedText]] <span style="color:gray; font-size:smaller;">» This function returns a string containing the inner text of a selected gridlist item.</span><br />
*[[guiGridListSetColumnNonSortable]] <span style="color:gray; font-size:smaller;">» This function makes a gridlist column become non-sortable.</span><br />
*[[isTextInGridList]] <span style="color:gray; font-size:smaller;">» This function checks if some text exist or not in the GridList.</span><br />
<br />
=====Labels=====<br />
*[[guiLabelAddEffect]] <span style="color:gray; font-size:smaller;">» This function add an effects to the gui-label like (shadow, outline).</span><br />
<br />
=== Marker functions ===<br />
*[[createMarkerAttachedTo]] <span style="color:gray; font-size:smaller;">» This function creates a marker that is attached to an element.</span><br />
<br />
=== Math functions ===<br />
*[[math.clamp]] <span style="color:gray; font-size:smaller;">» This function returns the number between range of numbers or it's minimum or maximum.</span><br />
*[[math.getBezierPoint]] <span style="color:gray; font-size:smaller;">» Get N-th order bezier point.</span><br />
*[[math.hypot]] <span style="color:gray; font-size:smaller;">» This function returns the Hypotenuse of the triangle given by sides x and y.</span><br />
*[[math.isPointInPolygon]] <span style="color:gray; font-size:smaller;">» Check if point is inside polygon or not.</span><br />
*[[math.lerp]] <span style="color:gray; font-size:smaller;">» Get val between two integer.</span><br />
*[[math.percent]] <span style="color:gray; font-size:smaller;">» This function returns a percentage from two number values.</span><br />
*[[math.polygonArea]] <span style="color:gray; font-size:smaller;">» Compute area of any polygon.</span><br />
*[[math.randomDiff]] <span style="color:gray; font-size:smaller;">» Generates a pseudo-random integer that's always different from the last random number generated.</span><br />
*[[math.rotVecToEulerAngle]] <span style="color:gray; font-size:smaller;">» Rotation Vector To Euler Angle</span><br />
*[[math.round]] <span style="color:gray; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
*[[mathNumber]] <span style="color:gray; font-size:smaller;">» This function is a workaround for the client-side floating-point precision of 24-bits.</span><br />
*[[reMap]] <span style="color:gray; font-size:smaller;">» Re-maps a number from one range to another.</span><br />
*[[Math.percentProgress|math.percentProgress]] <span style="color:gray; font-size:smaller;">» Returns a percentage progress from two specific values.</span><br />
*[[math.average]] <span style="color:gray; font-size:smaller;">» This function returns the simple arithmetic mean of multiple numbers.</span><br />
<br />
=== Map functions ===<br />
*[[assignLod]] <span style="color:gray; font-size:smaller;">» This function lets you conveniently generate and apply a LOD model to a mapping object.</span><br />
*[[getWorldPositionFromMapPosition]] <span style="color:gray; font-size:smaller;">» This function converts an F11 map position to world position.</span><br />
<br />
=== Ped functions ===<br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-size:smaller;">» This function returns a table of the alive players client-side.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getGuestPlayers]] <span style="color:gray; font-size:smaller;">» This function gets a players not login or players Guest .</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-size:smaller;">» This function returns a table of all logged-in administrators.</span><br />
*[[getPedEyesPosition]] <span style="color:gray; font-size:smaller;">» This function allows you to get peds eyes position.</span><br />
*[[getPedGender]] <span style="color:gray; font-size:smaller;">» This function allows you to get peds their gender.</span><br />
*[[getPedMaxHealth]] <span style="color:gray; font-size:smaller;">» This function returns a pedestrians's maximum health by converting it from their maximum health stat.</span><br />
*[[getPedMaxOxygenLevel]] <span style="color:gray; font-size:smaller;">» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.</span><br />
*[[getPedWeaponSkill]] <span style="color:gray; font-size:smaller;">» This function returns a ped's corresponding weapon skill level name.</span><br />
*[[getPedHitBone]] <span style="color:gray; font-size:smaller;">» This function gets the approximate number of the bone where the ped is hit.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-size:smaller;">» This function returns a player from partial name.</span><br />
*[[getPlayerFromSerial]] <span style="color:gray; font-size:smaller;">» This function returns a player from their serial.</span><br />
*[[getPlayersByData]] <span style="color:gray; font-size:smaller;">» This function returns a table of players that have the specified data name.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-size:smaller;">» This function returns a table of all players in photograph.</span><br />
*[[getPlayersInVehicles]] <span style="color:gray; font-size:smaller;">» This function returns a table of the players insides vehicles from a specified dimension.</span><br />
*[[isPedAiming]]<span style="color:gray; font-size:smaller;">» This function checks if a pedestrian is aiming their weapon.</span><br />
*[[isPedAimingNearPed]] <span style="color:gray; font-size:smaller;">» This is similar to isPedAiming but uses a colshape to be more precise.</span><br />
*[[isPedDiving]] <span style="color:gray; font-size:smaller;">» This feature checks that pedestrian is diving in the water.</span><br />
*[[isPedDrivingVehicle]] <span style="color:gray; font-size:smaller;">» This function checks if a specified pedestrian is driving a vehicle.</span><br />
*[[isPlayerInTeam]] <span style="color:gray; font-size:smaller;">» This function checks if a player is in a specified team.</span><br />
*[[setPedAttack]] <span style="color:gray; font-size:smaller;">» This function will make a ped attack a specified target.</span><br />
*[[setPedFollow]] <span style="color:gray; font-size:smaller;">» This function will make a ped follow a specified target.</span><br />
*[[getPlayerNameFromID]] <span style="color:gray; font-size:smaller;">» This function will get the player name from the ID element data.</span><br />
<br />
=== Player functions ===<br />
*[[countPlayersInRange]] <span style="color:gray; font-size:smaller;">» This function returns the number of players that are within a certain range of the specified coordinates.</span><br />
*[[getPlayerPreviousAndNextWeapon]] <span style="color:gray; font-size:smaller;">» This function returns the player previous and next weapon.</span><br />
*[[getPlayersInRange]]<span style="color:gray; font-size:smaller;">» This function make a table of players within certain range.</span><br />
*[[isPlayerHitByVehicle]]<span style="color:gray; font-size:smaller;">» This function cancels event when a element is hit by a vehicle.</span><br />
*[[warpToPlayer]]<span style="color:gray; font-size:smaller;">» This function make player warp to another player.</span><br />
<br />
=== Resource functions ===<br />
*[[getFilesInResourceFolder]] <span style="color:gray; font-size:smaller;">» This function gets a list of files that are inside a folder of a resource.</span><br />
*[[getResourceScripts]] <span style="color:gray; font-size:smaller;">» This function returns a table of the resource scripts.</span><br />
*[[getResourceSettings]] <span style="color:gray; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getResourceSize]] <span style="color:gray; font-size:smaller;">» This function returns the size of a specified resource in kB(kilobyte)</span><br />
*[[refreshResource]] <span style="color:gray; font-size:smaller;">» This function refreshes your resource if you changed any of the files<br />
*[[setResourcePriority]] <span style="color:gray; font-size:smaller;">» This function set resource download priority group.</span><br />
<br />
=== Sound functions ===<br />
*[[isSoundFinished]] <span style="color:gray; font-size:smaller;">» This function checks if a sound element has finished.</span><br />
*[[isSoundPlaying]] <span style="color:gray; font-size:smaller;">» This function checks if a sound element is playing or not.</span><br />
*[[stopSoundSlowly]] <span style="color:gray; font-size:smaller;">» This function stop your sound element slowly.</span><br />
<br />
=== Browser functions ===<br />
*[[playVideo]] <span style="color:gray; font-size:smaller;">» This function plays a video on the screen.</span><br />
<br />
=== Team functions ===<br />
*[[getTeamFromColor]] <span style="color:gray; font-size:smaller;">» This function returns a team element by the specified color.</span><br />
*[[getTeamWithFewestPlayers]] <span style="color:gray; font-size:smaller;">» This function returns a team element with least players of all the specified teams.</span><br />
<br />
=== Vehicle functions ===<br />
*[[findEmptyCarSeat]] <span style="color:gray; font-size:smaller;">» This function finds you the first empty seat in a vehicle.</span><br />
*[[getNearestVehicle]] <span style="color:gray; font-size:smaller;">» This function gets the nearest vehicle to the specified player in a specified distance.</span><br />
*[[getRandomVehicle]] <span style="color:gray; font-size:smaller;">» This function gets a random vehicle.</span><br />
*[[getValidVehicleModels]] <span style="color:gray; font-size:smaller;">» This function returns a table of all valid vehicle models.</span><br />
*[[getVehiclesCountByType]] <span style="color:gray; font-size:smaller;">» This function returns the amount of vehicles by the given type as an integer value.</span><br />
*[[getVehicleTurnVelocityCenterOfMass]]<span style="color:gray; font-size:smaller;">» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.</span><br />
*[[isVehicleDoubleExhaust]] <span style="color:gray; font-size:smaller;">» This function checks is exhaust vehicle double.</span><br />
*[[isVehicleEmpty]] <span style="color:gray; font-size:smaller;">» This function checks whether a vehicle is empty.</span><br />
*[[isVehicleOccupied]] <span style="color:gray; font-size:smaller;">» This function checks if a specified vehicle is occupied.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[isVehicleReversing]] <span style="color:gray; font-size:smaller;">» This function checks if a specified vehicle is moving backwards.</span><br />
*[[isVehicleUpgraded]] <span style="color:gray; font-size:smaller;">» This function checks is vehicle upgraded by upgrade ID.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-size:smaller;">» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
*[[setVehicleTurnVelocityCenterOfMass]]<span style="color:gray; font-size:smaller;">» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.</span><br />
*[[setVehicleHandlingFromText]]<span style="color:gray; font-size:smaller;">» This function sets a vehicle's handling from text.</span><br />
<br />
=== Weapon functions === <br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
<br />
=== Object functions ===<br />
*[[getDynamicDoorObjectOpenRatio]] <span style="color:gray; font-size:smaller;">» This function tells you how open a dynamic door is in a range from 0 to 1.</span><br />
*[[isElementObject]] <span style="color:gray; font-size:smaller;">» This function tells you if an element is an object or no.</span><br />
<br />
=== XML functions ===<br />
*[[getXMLNodes]] <span style="color:gray; font-size:smaller;">» This function returns all children of a XML node.</span><br />
<br />
=== Engine functions ===<br />
*[[engineGetCOLsFromLibrary]] <span style="color:gray; font-size:smaller;">» This function gets the collision data from the col library.</span><br />
*[[engineLoadIMGContainer]] <span style="color:gray; font-size:smaller;">» This function loads the IMG container.</span><br />
<br />
=== Utility ===<br />
*[[animate]] <span style="color:gray; font-size:smaller;">» This function allows you to use interpolateBetween without render event and easily used.</span><br />
*[[callClientFunction]] <span style="color:gray; font-size:smaller;">» This function allows you to call any client-side function from the server's side.</span><br />
*[[callServerFunction]] <span style="color:gray; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[check]] <span style="color:gray; font-size:smaller;">» This function checks if its arguments are of the right type and calls the error-function if one is not.</span><br />
*[[checkPassiveTimer]] <span style="color:gray; font-size:smaller;">» This function allows you to use passive timers in your conditions. For example you want to prevent players r<br />
epeatedly using a command.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-size:smaller;">» This function applies a fix for hidden coroutine error messages.</span><br />
*[[compact]] <span style="color:gray; font-size:smaller;">» This function create table containing variables and their values.</span><br />
*[[getBanFromName]] <span style="color:gray; font-size:smaller;">» This functions returns the ban of the given playername.</span><br />
*[[getCurrentFPS]] <span style="color:gray; font-size:smaller;">» This function returns the frames per second at which GTA: SA is running.</span><br />
*[[getSkinNameFromID]] <span style="color:gray; font-size:smaller;">» This function returns the name of the skin from the given id.</span><br />
*[[IfElse]] <span style="color:gray; font-size:smaller;">» This function returns one of two values based on a boolean expression.</span><br />
*[[isCharInString]] <span style="color:gray; font-size:smaller;">» This shared function allows you to check if a char specified is in a string value.</span><br />
*[[isMouseInCircle]] <span style="color:gray; font-size:smaller;">» This function checks if a cursor position is in circular area or not.</span><br />
*[[isMouseInPosition]] <span style="color:gray; font-size:smaller;">» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.</span><br />
*[[iterElements]] <span style="color:gray; font-size:smaller;">» This function returns ''a time-saving'' iterator for your for-loops.</span><br />
*[[PlotTrajectoryAtTime]] <span style="color:gray; font-size:smaller;">» Calculate projectile/water trajectory.</span><br />
*[[preprocessor]] <span style="color:gray; font-size:smaller;">» This function allow you to use gcc macros.</span><br />
*[[vector3:compare]] <span style="color:gray; font-size:smaller;">» This method checks whether two vectors match, with optional precision.</span><br />
*[[svgCreateRoundedRectangle]] <span style="color:gray; font-size:smaller;">» This function creates a rectangle with rounded edges.</span><br />
<br />
<noinclude>[[Category:Useful Functions]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=75215Template:Useful Functions2022-07-01T18:27:10Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
=== Table functions ===<br />
*[[addTableChangeHandler]] <span style="color:gray; font-size:smaller;">» This function monitors the changes of a table.</span><br />
*[[getTableFromSql]] <span style="color:gray; font-size:smaller;">» This functionality is used to obtain saved tables using the function ([https://wiki.multitheftauto.com/wiki/SetTableToSql SetTableToSql ]).</span><br />
*[[isValueInTable]] <span style="color:gray; font-size:smaller;">» This function returns true if the value exists in the table, false if the value does not exist in the table.</span><br />
*[[pairsByKeys]] <span style="color:gray; font-size:smaller;">» This function sort pairs table.</span><br />
*[[rangeToTable]] <span style="color:gray; font-size:smaller;">» This function converts a string range to a table containing number values.</span><br />
*[[setTableProtected]] <span style="color:gray; font-size:smaller;">» This function protects a table and makes it read-only.</span><br />
*[[setTableToSql]] <span style="color:gray; font-size:smaller;">» This function is used to save the table in the database (sql).</span><br />
*[[Sort_Functions]] <span style="color:gray; font-size:smaller;">» These functions are able to sort your tables by a key.</span><br />
*[[table.compare]] <span style="color:gray; font-size:smaller;">» This function checks whether two given tables are equal.</span><br />
*[[table.copy]] <span style="color:gray; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.deepmerge]] <span style="color:gray; font-size:smaller;">» This function deep merges two tables. Every nested table will be correspondingly merged.</span><br />
*[[table.element]] <span style="color:gray; font-size:smaller;">» This function returns a new table with only userdata content.</span><br />
*[[table.empty]] <span style="color:gray; font-size:smaller;">» This function checks whether a table is empty.</span><br />
*[[table.fromString]] <span style="color:gray; font-size:smaller;">» This function converts string to a table.</span><br />
*[[table.getRandomRows]] <span style="color:gray; font-size:smaller;">» This function returns random rows from table.</span><br />
*[[table.map]] <span style="color:gray; font-size:smaller;">» 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.</span><br />
*[[table.merge]] <span style="color:gray; font-size:smaller;">» This function merges two or more tables together.</span><br />
*[[table.random]] <span style="color:gray; font-size:smaller;">» This function retrieves a random value from a table.</span><br />
*[[table.removeValue]] <span style="color:gray; font-size:smaller;">» This function removes a specified value from a table.</span><br />
*[[table.size]] <span style="color:gray; font-size:smaller;">» This function returns the absolute size of a table.</span><br />
*[[table.toString]] <span style="color:gray; font-size:smaller;">» This function converts table to a string.</span><br />
<br />
=== ACL functions ===<br />
*[[aclGroupClone]] <span style="color:gray; font-size:smaller;">» This function clone a group to another group with/without ACLs and/or objects.</span><br />
*[[getAccountsRanks]] <span style="color:gray; font-size:smaller;">» This function is used to detect the account name groups and put them in the chat.</span><br />
*[[getPlayerAcls]] <span style="color:gray; font-size:smaller;">» This function returns a table of all ACL groups on a player.</span><br />
*[[getPlayersInACLGroup]] <span style="color:gray; font-size:smaller;">» This function returns all players in an ACL group.</span><br />
*[[isPlayerInACL]] <span style="color:gray; font-size:smaller;">» This function checks if a player element is in an ACL group.</span><br />
*[[renameAclGroup]] <span style="color:gray; font-size:smaller;">» This function gives an existing ACL group a new name.</span><br />
<br />
=== Account functions ===<br />
*[[getPlayerFromAccountName]] <span style="color:gray; font-size:smaller;">» This function is used to obtain a player by the name of his account.</span><br />
<br />
=== Camera functions ===<br />
*[[smoothMoveCamera]] <span style="color:gray; font-size:smaller;">» This function allows you to create a cinematic camera flight.<br />
<br />
=== Cursor functions ===<br />
*[[getCursorMovedOn]] <span style="color:gray; font-size:smaller;">» This function checks in which way the cursor is currently moving.</span><br />
<br />
=== Drawing functions ===<br />
*[[dxDrawAnimWindow]] <span style="color:gray; font-size:smaller;">» This function draws an animated 2D window on the screen.</span><br />
*[[dxDrawBorderedRectangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a bordered rectangle.</span><br />
*[[dxDrawBorderedText]] <span style="color:gray; font-size:smaller;">» This is a function that will create a bordered text.</span><br />
*[[dxDrawDashedLine]] <span style="color:gray; font-size:smaller;">» This function draws a line with dashes.</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-size:smaller;">» This function simulates the effect of a GIF image by using image sprites in 2D.</span><br />
*[[dxDrawImage3D]] <span style="color:gray; font-size:smaller;">» This function draws a 3D image in GTA world.</span><br />
*[[dxDrawImageOnElement]] <span style="color:gray; font-size:smaller;">» This function draws an image on any element.</span><br />
*[[dxDrawLinedRectangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a rectangle outline with dx lines.</span><br />
*[[dxDrawLoading]] <span style="color:gray; font-size:smaller;">» This function draws a loading bar on the screen.</span><br />
*[[dxDrawOctagon3D]] <span style="color:gray; font-size:smaller;">» This function creates a 3D Octagon</span><br />
*[[dxDrawPolygon]] <span style="color:gray; font-size:smaller;">» This function draws a custom polygon on the screen.</span><br />
*[[dxDrawProgressBar]] <span style="color:gray; font-size:smaller;">» This function simulates a progress bar drawed using DirectDraw.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-size:smaller;">» This function draws a 3D rectangle in GTA world.</span><br />
*[[dxDrawRectangleOnPlayer]] <span style="color:gray; font-size:smaller;">» This function draws a 3D rectangle above the player.</span><br />
*[[dxDrawRing]] <span style="color:gray; font-size:smaller;">» This function draws a ring with dx lines.</span><br />
*[[dxDrawRombo]] <span style="color:gray; font-size:smaller;">» This function creates a Rhombus.</span><br />
*[[dxDrawSprite]] <span style="color:gray; font-size:smaller;">» This function draw a sprite in the 3D world.</span><br />
*[[dxDrawTextOnElement]] <span style="color:gray; font-size:smaller;">» This function draws a text on any element.</span><br />
*[[dxDrawTextOnRectangle]] <span style="color:gray; font-size:smaller;">» Esta funcion crea un rectangle con un texto dentro.</span><br />
*[[dxDrawTriangle]] <span style="color:gray; font-size:smaller;">» This is a function that will create a triangle with dx lines.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-size:smaller;">» This function calculates the font size from given height.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-size:smaller;">» This function calculates the height of a font.</span><br />
*[[getScreenStartPositionFromBox]] <span style="color:gray; font-size:smaller;">» This function helps with getting the correct position for your dx-effects.</span><br />
*[[wordWrap]] <span style="color:gray; font-size:smaller;">» This function breaks a long string into a table of separate lines limited to a specific length in pixels, for drawing separately.</span><br />
*[[CreateRectangle3D]] <span style="color:gray; font-size:smaller;">» This is a function that will create a 3d rectangle on the player screen.</span><br />
<br />
=== Effects functions ===<br />
*[[attachEffect]] <span style="color:gray; font-size:smaller;">» This function allows you attach an effect to an element.</span><br />
<br />
=== Element functions === <br />
*[[autoAttach]] <span style="color:gray; font-size:smaller;">» This function attaches one element into another at the same position and rotation they are.</span><br />
*[[isElementPlayer]] <span style="color:gray; font-size:smaller;">» This function checks whether the element is a player or not.</span><br />
*[[attachElementToBone]] <span style="color:gray; font-size:smaller;">» This function allows you to attach an element to ped bone accurately using new bone functions.</span><br />
*[[getElementsInDimension]] <span style="color:gray; font-size:smaller;">» This function returns a table of elements that are in the specified dimension.</span><br />
*[[getElementSpeed]] <span style="color:gray; font-size:smaller;">» This function returns the specified element's speed in m/s, km/h or mph.</span><br />
*[[getElementsWithinMarker]] <span style="color:gray; font-size:smaller;">» This function returns a table of elements that are within a marker's collision shape.</span><br />
*[[getElementUsingData]] <span style="color:gray; font-size:smaller;">» This function returns table elements that contains the elements data with the given key and value.</span><br />
*[[getNearestElement]] <span style="color:gray; font-size:smaller;">» This function returns the nearest element (of a specific type) to a player.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-size:smaller;">» This function checks if an element is in the player's camera picture area.</span><br />
*[[isElementInRange]] <span style="color:gray; font-size:smaller;">» This function allows you to check if an element's range to a main point is within the maximum range.</span><br />
*[[isElementMoving]]<span style="color:gray; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isElementWithinAColShape]]<span style="color:gray; font-size:smaller;">» This function checks if an element is within a collision shape element.</span><br />
*[[isElementInAir]]<span style="color:gray; font-size:smaller;">» This function checks if an element is in air or not.</span><br />
*[[multi_check]] <span style="color:gray; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-size:smaller;">» This function allows you to set the speed of an element in kph or mph units.</span><br />
<br />
=== Events ===<br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-size:smaller;">» This code implements an event that is triggered when a player in a vehicle fires a vehicle's weapon.</span><br />
<br />
=== Input functions ===<br />
*[[bindControlKeys]] <span style="color:gray; font-size:smaller;">» This function allows you to bind each key bound to a control individually. Doing this bypasses a little MTA restriction.</span><br />
*[[getBoundControls]] <span style="color:gray; font-size:smaller;">» This function returns a table of control names that are bound to the specified key.</span><br />
*[[unbindControlKeys]] <span style="color:gray; font-size:smaller;">» This function allows you to unbind each key bound to a control individually. Use this function with [[bindControlKeys]].</span><br />
<br />
=== Data functions === <br />
*[[byte2human]] <span style="color:gray; font-size:smaller;">» This function converts an integer (number of bytes) into a human-readable unit.</span><br />
*[[capitalize]] <span style="color:gray; font-size:smaller;">» This function capitalizes a given string.</span><br />
*[[convertDate]] <span style="color:gray; font-size:smaller;">» This function converts date to another look.</span><br />
*[[convertServerTickToTimeStamp]] <span style="color:gray; font-size:smaller;">» This function converts server ticks to a unix timestamp.</span><br />
*[[convertTextToSpeech]] <span style="color:gray; font-size:smaller;">» This function converts the provided text to a speech in the provided language which players can hear.</span><br />
*[[findRotation3D]] <span style="color:gray; font-size:smaller;">» This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B.</span><br />
*[[findRotation]] <span style="color:gray; font-size:smaller;">» This function takes two points and returns the direction from point A to point B.</span><br />
*[[formatDate]] <span style="color:gray; font-size:smaller;">» This function formats a date on the basis of a format string and returns it.</span><br />
*[[formatNumber]] <span style="color:gray; font-size:smaller;">» This function formats large numbers by adding commas.</span><br />
*[[generateRandomASCIIString]] <span style="color:gray; font-size:smaller;">» This function returns a random string which uses ASCII characters. </span><br />
*[[generateString]] <span style="color:gray; font-size:smaller;">» This function generates a random string with any characters.</span><br />
*[[getAge]] <span style="color:gray; font-size:smaller;">» This function calculates the age of a given birthday.</span><br />
*[[getDistanceBetweenElements]] <span style="color:gray; font-size:smaller;">» Returns the distance between two elements.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-size:smaller;">» This function takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.</span><br />
*[[getEasterDate]] <span style="color:gray; font-size:smaller;">» This function returns easter date monthday and month for a given year.</span><br />
*[[getFreeDimension]] <span style="color:gray; font-size:smaller;">» This function get free dimension.</span><br />
*[[getKeyFromValueInTable]] <span style="color:gray; font-size:smaller;">» This function returns the key of the specified value in a table.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-size:smaller;">» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.</span><br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-size:smaller;">» This function finds a point based on a starting point, direction and distance.</span><br />
*[[getRealMonth]] <span style="color:gray; font-size:smaller;">» This function returns the current month name</span><br />
*[[getRGColorFromPercentage]] <span style="color:gray; font-family:'Georgia', sans-serif; font-size:smaller;">»This function returns two integers representing red and green colors according to the specified percentage.</span><br />
*[[getScreenRotationFromWorldPosition]] <span style="color:gray; font-size:smaller;">» This function returns a screen relative rotation to a world position.</span><br />
*[[getTimestamp]] <span style="color:gray; font-size:smaller;">» This function returns the UNIX timestamp of a specified date and time.</span><br />
*[[gradientString]] <span style="color:gray; font-size:smaller;">» This function transforms a string in a new coloured gradient string.</span><br />
*[[hex2rgb]] <span style="color:gray; font-size:smaller;">» This function convert hex to rgb.</span><br />
*[[hexColorToRGB]] <span style="color:gray; font-size:smaller;">» This function convert hex string/number to RGBA values.</span><br />
*[[isLeapYear]] <span style="color:gray; font-size:smaller;">» This function returns a boolean representing if a given year is a leap year.</span><br />
*[[isValidMail]] <span style="color:gray; font-size:smaller;">» This function checks whether a provided e-mail string is valid.</span><br />
*[[removeHex]] <span style="color:gray; font-size:smaller;">» This function is used to remove hexadecimal numbers (colors, for example) from strings.<br />
*[[RGBToHex]] <span style="color:gray; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[RGBToHSV]] <span style="color:gray; font-size:smaller;">» This function convert RGB to HSV color space.</span><br />
*[[RGBToDecimal]] <span style="color:gray; font-size:smaller;">» This function convert RGB to Decimal color.</span><br />
*[[secondsToTimeDesc]] <span style="color:gray; font-size:smaller;">» This function converts a plain seconds-integer into a user-friendly time description.</span><br />
*[[string.count]] <span style="color:gray; font-size:smaller;">» This function counts the amount of occurences of a string in a string.</span><br />
*[[string.explode]] <span style="color:gray; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[string.insert]] <span style="color:gray; font-size:smaller;">» This function inserts a string within another string at a given position.</span><br />
*[[switch]] <span style="color:gray; font-size:smaller;">» This function allows the value of a variable or expression to control the flow of program execution via a multiway branch.</span><br />
*[[tocolor2rgba]] <span style="color:gray; font-size:smaller;">» This function convert tocolor to rgba.</span><br />
*[[toHex]] <span style="color:gray; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.</span><br />
*[[var dump]] <span style="color:gray; font-size:smaller;">» This function outputs information about one or more variables using outputConsole.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-size:smaller;">» This function converts a physical wavelength of light to a RGBA color.</span><br />
<br />
=== GUI functions === <br />
*[[centerWindow]] <span style="color:gray; font-size:smaller;">» This function centers a CEGUI window element responsively in any resolution.</span><br />
*[[guiMoveElement]] <span style="color:gray; font-size:smaller;">» This function moves guiElement by/like using moveObject.</span><br />
*[[guiSetStaticImageMovable]] <span style="color:gray; font-size:smaller;">» This function allows you to move a static image like a gui window.</span><br />
*[[isMouseOnGUICloseButton]] <span style="color:gray; font-size:smaller;">» This function allows you to check whether the mouse cursor/pointer is within a gui-window's native close button.</span><br />
*[[isMouseOnGuiElement]] <span style="color:gray; font-size:smaller;">» 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. </span><br />
=====Comboboxes=====<br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-size:smaller;">» This function adjusts a CEGUI combobox element to have the correct height.</span><br />
<br />
=====Gridlists=====<br />
*[[convertGridListToText]] <span style="color:gray; font-size:smaller;">» This function converts grid list contents to text.</span><br />
*[[getGridListRowIndexFromText]] <span style="color:gray; font-size:smaller;">» This function returns the GridList row index from the specified text.</span><br />
*[[guiGridListAddPlayers]] <span style="color:gray; font-size:smaller;">» This function add all online players to a grid list.</span><br />
*[[guiGridListGetColumnIDFromTitle]] <span style="color:gray; font-size:smaller;">» This function gets a gridlist's column ID from the column title.</span><br />
*[[guiGridListGetSelectedText]] <span style="color:gray; font-size:smaller;">» This function returns a string containing the inner text of a selected gridlist item.</span><br />
*[[guiGridListSetColumnNonSortable]] <span style="color:gray; font-size:smaller;">» This function makes a gridlist column become non-sortable.</span><br />
*[[guiGridListSetColumnsFixedWidth]] <span style="color:gray; font-size:smaller;">» This function makes a gridlist have all its columns fixed width.</span><br />
*[[isTextInGridList]] <span style="color:gray; font-size:smaller;">» This function checks if some text exist or not in the GridList.</span><br />
<br />
=====Labels=====<br />
*[[guiLabelAddEffect]] <span style="color:gray; font-size:smaller;">» This function add an effects to the gui-label like (shadow, outline).</span><br />
<br />
=== Marker functions ===<br />
*[[createMarkerAttachedTo]] <span style="color:gray; font-size:smaller;">» This function creates a marker that is attached to an element.</span><br />
<br />
=== Math functions ===<br />
*[[math.clamp]] <span style="color:gray; font-size:smaller;">» This function returns the number between range of numbers or it's minimum or maximum.</span><br />
*[[math.getBezierPoint]] <span style="color:gray; font-size:smaller;">» Get N-th order bezier point.</span><br />
*[[math.hypot]] <span style="color:gray; font-size:smaller;">» This function returns the Hypotenuse of the triangle given by sides x and y.</span><br />
*[[math.isPointInPolygon]] <span style="color:gray; font-size:smaller;">» Check if point is inside polygon or not.</span><br />
*[[math.lerp]] <span style="color:gray; font-size:smaller;">» Get val between two integer.</span><br />
*[[math.percent]] <span style="color:gray; font-size:smaller;">» This function returns a percentage from two number values.</span><br />
*[[math.polygonArea]] <span style="color:gray; font-size:smaller;">» Compute area of any polygon.</span><br />
*[[math.randomDiff]] <span style="color:gray; font-size:smaller;">» Generates a pseudo-random integer that's always different from the last random number generated.</span><br />
*[[math.rotVecToEulerAngle]] <span style="color:gray; font-size:smaller;">» Rotation Vector To Euler Angle</span><br />
*[[math.round]] <span style="color:gray; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
*[[mathNumber]] <span style="color:gray; font-size:smaller;">» This function is a workaround for the client-side floating-point precision of 24-bits.</span><br />
*[[reMap]] <span style="color:gray; font-size:smaller;">» Re-maps a number from one range to another.</span><br />
*[[Math.percentProgress|math.percentProgress]] <span style="color:gray; font-size:smaller;">» Returns a percentage progress from two specific values.</span><br />
*[[math.average]] <span style="color:gray; font-size:smaller;">» This function returns the simple arithmetic mean of multiple numbers.</span><br />
<br />
=== Map functions ===<br />
*[[assignLod]] <span style="color:gray; font-size:smaller;">» This function lets you conveniently generate and apply a LOD model to a mapping object.</span><br />
*[[getWorldPositionFromMapPosition]] <span style="color:gray; font-size:smaller;">» This function converts an F11 map position to world position.</span><br />
<br />
=== Ped functions ===<br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-size:smaller;">» This function returns a table of the alive players client-side.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getGuestPlayers]] <span style="color:gray; font-size:smaller;">» This function gets a players not login or players Guest .</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-size:smaller;">» This function returns a table of all logged-in administrators.</span><br />
*[[getPedEyesPosition]] <span style="color:gray; font-size:smaller;">» This function allows you to get peds eyes position.</span><br />
*[[getPedGender]] <span style="color:gray; font-size:smaller;">» This function allows you to get peds their gender.</span><br />
*[[getPedMaxHealth]] <span style="color:gray; font-size:smaller;">» This function returns a pedestrians's maximum health by converting it from their maximum health stat.</span><br />
*[[getPedMaxOxygenLevel]] <span style="color:gray; font-size:smaller;">» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.</span><br />
*[[getPedWeaponSkill]] <span style="color:gray; font-size:smaller;">» This function returns a ped's corresponding weapon skill level name.</span><br />
*[[getPedHitBone]] <span style="color:gray; font-size:smaller;">» This function gets the approximate number of the bone where the ped is hit.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-size:smaller;">» This function returns a player from partial name.</span><br />
*[[getPlayerFromSerial]] <span style="color:gray; font-size:smaller;">» This function returns a player from their serial.</span><br />
*[[getPlayersByData]] <span style="color:gray; font-size:smaller;">» This function returns a table of players that have the specified data name.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-size:smaller;">» This function returns a table of all players in photograph.</span><br />
*[[getPlayersInVehicles]] <span style="color:gray; font-size:smaller;">» This function returns a table of the players insides vehicles from a specified dimension.</span><br />
*[[isPedAiming]]<span style="color:gray; font-size:smaller;">» This function checks if a pedestrian is aiming their weapon.</span><br />
*[[isPedAimingNearPed]] <span style="color:gray; font-size:smaller;">» This is similar to isPedAiming but uses a colshape to be more precise.</span><br />
*[[isPedDiving]] <span style="color:gray; font-size:smaller;">» This feature checks that pedestrian is diving in the water.</span><br />
*[[isPedDrivingVehicle]] <span style="color:gray; font-size:smaller;">» This function checks if a specified pedestrian is driving a vehicle.</span><br />
*[[isPlayerInTeam]] <span style="color:gray; font-size:smaller;">» This function checks if a player is in a specified team.</span><br />
*[[setPedAttack]] <span style="color:gray; font-size:smaller;">» This function will make a ped attack a specified target.</span><br />
*[[setPedFollow]] <span style="color:gray; font-size:smaller;">» This function will make a ped follow a specified target.</span><br />
*[[getPlayerNameFromID]] <span style="color:gray; font-size:smaller;">» This function will get the player name from the ID element data.</span><br />
<br />
=== Player functions ===<br />
*[[countPlayersInRange]] <span style="color:gray; font-size:smaller;">» This function returns the number of players that are within a certain range of the specified coordinates.</span><br />
*[[getPlayerPreviousAndNextWeapon]] <span style="color:gray; font-size:smaller;">» This function returns the player previous and next weapon.</span><br />
*[[getPlayersInRange]]<span style="color:gray; font-size:smaller;">» This function make a table of players within certain range.</span><br />
*[[isPlayerHitByVehicle]]<span style="color:gray; font-size:smaller;">» This function cancels event when a element is hit by a vehicle.</span><br />
*[[warpToPlayer]]<span style="color:gray; font-size:smaller;">» This function make player warp to another player.</span><br />
<br />
=== Resource functions ===<br />
*[[getFilesInResourceFolder]] <span style="color:gray; font-size:smaller;">» This function gets a list of files that are inside a folder of a resource.</span><br />
*[[getResourceScripts]] <span style="color:gray; font-size:smaller;">» This function returns a table of the resource scripts.</span><br />
*[[getResourceSettings]] <span style="color:gray; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getResourceSize]] <span style="color:gray; font-size:smaller;">» This function returns the size of a specified resource in kB(kilobyte)</span><br />
*[[refreshResource]] <span style="color:gray; font-size:smaller;">» This function refreshes your resource if you changed any of the files<br />
*[[setResourcePriority]] <span style="color:gray; font-size:smaller;">» This function set resource download priority group.</span><br />
<br />
=== Sound functions ===<br />
*[[isSoundFinished]] <span style="color:gray; font-size:smaller;">» This function checks if a sound element has finished.</span><br />
*[[isSoundPlaying]] <span style="color:gray; font-size:smaller;">» This function checks if a sound element is playing or not.</span><br />
*[[stopSoundSlowly]] <span style="color:gray; font-size:smaller;">» This function stop your sound element slowly.</span><br />
<br />
=== Browser functions ===<br />
*[[playVideo]] <span style="color:gray; font-size:smaller;">» This function plays a video on the screen.</span><br />
<br />
=== Team functions ===<br />
*[[getTeamFromColor]] <span style="color:gray; font-size:smaller;">» This function returns a team element by the specified color.</span><br />
*[[getTeamWithFewestPlayers]] <span style="color:gray; font-size:smaller;">» This function returns a team element with least players of all the specified teams.</span><br />
<br />
=== Vehicle functions ===<br />
*[[findEmptyCarSeat]] <span style="color:gray; font-size:smaller;">» This function finds you the first empty seat in a vehicle.</span><br />
*[[getNearestVehicle]] <span style="color:gray; font-size:smaller;">» This function gets the nearest vehicle to the specified player in a specified distance.</span><br />
*[[getRandomVehicle]] <span style="color:gray; font-size:smaller;">» This function gets a random vehicle.</span><br />
*[[getValidVehicleModels]] <span style="color:gray; font-size:smaller;">» This function returns a table of all valid vehicle models.</span><br />
*[[getVehiclesCountByType]] <span style="color:gray; font-size:smaller;">» This function returns the amount of vehicles by the given type as an integer value.</span><br />
*[[getVehicleTurnVelocityCenterOfMass]]<span style="color:gray; font-size:smaller;">» This function gets a vehicle's turn velocity relative to the vehicle's center or mass.</span><br />
*[[isVehicleDoubleExhaust]] <span style="color:gray; font-size:smaller;">» This function checks is exhaust vehicle double.</span><br />
*[[isVehicleEmpty]] <span style="color:gray; font-size:smaller;">» This function checks whether a vehicle is empty.</span><br />
*[[isVehicleOccupied]] <span style="color:gray; font-size:smaller;">» This function checks if a specified vehicle is occupied.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[isVehicleReversing]] <span style="color:gray; font-size:smaller;">» This function checks if a specified vehicle is moving backwards.</span><br />
*[[isVehicleUpgraded]] <span style="color:gray; font-size:smaller;">» This function checks is vehicle upgraded by upgrade ID.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-size:smaller;">» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
*[[setVehicleTurnVelocityCenterOfMass]]<span style="color:gray; font-size:smaller;">» This function sets a vehicle's turn velocity relative to the vehicle's center or mass.</span><br />
*[[setVehicleHandlingFromText]]<span style="color:gray; font-size:smaller;">» This function sets a vehicle's handling from text.</span><br />
<br />
=== Weapon functions === <br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
<br />
=== Object functions ===<br />
*[[getDynamicDoorObjectOpenRatio]] <span style="color:gray; font-size:smaller;">» This function tells you how open a dynamic door is in a range from 0 to 1.</span><br />
*[[isElementObject]] <span style="color:gray; font-size:smaller;">» This function tells you if an element is an object or no.</span><br />
<br />
=== XML functions ===<br />
*[[getXMLNodes]] <span style="color:gray; font-size:smaller;">» This function returns all children of a XML node.</span><br />
<br />
=== Engine functions ===<br />
*[[engineGetCOLsFromLibrary]] <span style="color:gray; font-size:smaller;">» This function gets the collision data from the col library.</span><br />
*[[engineLoadIMGContainer]] <span style="color:gray; font-size:smaller;">» This function loads the IMG container.</span><br />
<br />
=== Utility ===<br />
*[[animate]] <span style="color:gray; font-size:smaller;">» This function allows you to use interpolateBetween without render event and easily used.</span><br />
*[[callClientFunction]] <span style="color:gray; font-size:smaller;">» This function allows you to call any client-side function from the server's side.</span><br />
*[[callServerFunction]] <span style="color:gray; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[check]] <span style="color:gray; font-size:smaller;">» This function checks if its arguments are of the right type and calls the error-function if one is not.</span><br />
*[[checkPassiveTimer]] <span style="color:gray; font-size:smaller;">» This function allows you to use passive timers in your conditions. For example you want to prevent players r<br />
epeatedly using a command.</span><br />
*[[coroutine.resume]] <span style="color:gray; font-size:smaller;">» This function applies a fix for hidden coroutine error messages.</span><br />
*[[compact]] <span style="color:gray; font-size:smaller;">» This function create table containing variables and their values.</span><br />
*[[getBanFromName]] <span style="color:gray; font-size:smaller;">» This functions returns the ban of the given playername.</span><br />
*[[getCurrentFPS]] <span style="color:gray; font-size:smaller;">» This function returns the frames per second at which GTA: SA is running.</span><br />
*[[getSkinNameFromID]] <span style="color:gray; font-size:smaller;">» This function returns the name of the skin from the given id.</span><br />
*[[IfElse]] <span style="color:gray; font-size:smaller;">» This function returns one of two values based on a boolean expression.</span><br />
*[[isCharInString]] <span style="color:gray; font-size:smaller;">» This shared function allows you to check if a char specified is in a string value.</span><br />
*[[isMouseInCircle]] <span style="color:gray; font-size:smaller;">» This function checks if a cursor position is in circular area or not.</span><br />
*[[isMouseInPosition]] <span style="color:gray; font-size:smaller;">» This function allows you to check whether the mouse cursor/pointer is within a rectangular position.</span><br />
*[[iterElements]] <span style="color:gray; font-size:smaller;">» This function returns ''a time-saving'' iterator for your for-loops.</span><br />
*[[PlotTrajectoryAtTime]] <span style="color:gray; font-size:smaller;">» Calculate projectile/water trajectory.</span><br />
*[[preprocessor]] <span style="color:gray; font-size:smaller;">» This function allow you to use gcc macros.</span><br />
*[[vector3:compare]] <span style="color:gray; font-size:smaller;">» This method checks whether two vectors match, with optional precision.</span><br />
*[[svgCreateRoundedRectangle]] <span style="color:gray; font-size:smaller;">» This function creates a rectangle with rounded edges.</span><br />
<br />
<noinclude>[[Category:Useful Functions]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=GetDistanceBetweenElements&diff=75214GetDistanceBetweenElements2022-07-01T18:26:25Z<p>Botder: </p>
<hr />
<div>{{Useful Function}}<br />
<br />
Function to obtain the distance between one element and another.<br />
<br />
<lowercasetitle/><br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">int getDistanceBetweenElements(element arg1, element arg2)</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''arg1''': first element.<br />
* '''arg2''': second element.<br />
<br />
===Returns===<br />
Returns the distance between two elements.<br />
<br />
==Code==<br />
<section name="Client/Server - side" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
function getDistanceBetweenElements(arg1, arg2)<br />
local element1 = Vector3(getElementPosition( arg1 ))<br />
local element2 = Vector3(getElementPosition( arg2 ))<br />
local distance = getDistanceBetweenPoints3D( element1,element2 )<br />
return distance<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=File:Visual_Studio_Community.PNG&diff=73118File:Visual Studio Community.PNG2021-12-07T21:09:27Z<p>Botder: Botder uploaded a new version of File:Visual Studio Community.PNG</p>
<hr />
<div></div>Botderhttps://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&diff=73117Compiling MTASA2021-12-07T21:08:31Z<p>Botder: Visual Studio 2022 update</p>
<hr />
<div>In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.<br />
<br />
Please read the instructions carefully and do not skip parts of it, if you have no experience.<br />
<br />
== Prerequisites ==<br />
<br />
Compiling the Multi Theft Auto client is only supported on Windows 10.<br />
<br />
Make sure you have the following software and SDKs installed:<br />
<br />
=== Visual Studio 2022 ===<br />
[[File:Visual_Studio_Community.PNG|right|150px|link=https://www.visualstudio.com/vs/]]<br />
# '''[https://visualstudio.microsoft.com/vs/ Download Microsoft Visual Studio 2022]''' - make sure you get the Community Edition, that one is free.<br />
# On the installation checklist, [[:File:VsFoundationClasses.png|make sure you tick these 2 items]]:<br />
## ''Desktop development with C++''<br />
## Optional component ''C++ MFC for latest v143 build tools (x86 & x64)''<br />
<br />
If you don't enable MFC, you will get the following error: <code>cannot open include file 'afxres.h'</code>.<br />
<br />
If you've made a mistake, you can run the ''Visual Studio Installer'' app to modify your current installation. There is no need to uninstall and reinstall.<br />
<br />
=== Microsoft DirectX SDK ===<br />
[[File:DirectX_SDK.jpg|right|150px|link=http://web.archive.org/web/20200804044856/https://www.microsoft.com/en-us/download/details.aspx?id=23549]]<br />
'''Download Microsoft DirectX SDK (August 2009) (DXSDK_Aug09.exe):'''<br />
* [https://archive.org/download/dxsdk_aug09/DXSDK_Aug09.exe Mirror 1]<br />
* [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe Mirror 2]<br />
<br />
{| class="wikitable" style="margin-top: 0px; width: 70%; word-break: break-all;"<br />
|+ File verification<br />
|- style="vertical-align:bottom;"<br />
! colspan="2" | Algorithm and variant<br />
! Hash<br />
! Hash file<br />
|- style="text-align:center;vertical-align:center;"<br />
| rowspan="6" | '''{{nowrap|SHA-3}}''' || ''SHA3-224'' || 8bfcdc03518d7edd34689534fd4d21291469ff2f2eb10437ad648c58 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-224 DXSDK_Aug09.exe.sha3-224]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA3-256'' || 45bf3e08da3b3636ddb4f4a74243430f8d65759c074c0d79756ef810c4701c5a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256 DXSDK_Aug09.exe.sha3-256]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA3-384'' || b358e529963d6f5fd7f8bd4b530fb18f6a2e6a442009a54e981b2f9967589ed48150af310f283640d56f9b60d41100c9 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-384 DXSDK_Aug09.exe.sha3-384]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA3-512'' || 43522187053af744250059ef69c0f3083cecd1157fe56daac16b9497ebc6fb5b525875144e42898367c55f757cffd3526f37074d544470578602a5a944a45a75 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-512 DXSDK_Aug09.exe.sha3-512]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHAKE128'' || 2a7c81bde9e867cbb5ef00b72ad8de66a3ee64c1d59f16465fa712479b6a84d28a02cc5ed08afa1d51e72011657453dbd4656cc9340d32e18179c39d03982dfc35c8f0c2a5c99e11dc74d0e23ed21b1e55f19c809a5a152bde39a2d46fcd12421f373f2d691ade1b57faf6c2ab7aded5a7d174f1f1c77127c0d6a1523b4775c569c5e1b4efa2da4bf2f708a96707a709e245a7f507382e69a81777919c90e95a091c0b699ce7f517 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-128000 DXSDK_Aug09.exe.sha3-128000]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHAKE256'' || 9c100dac5245a61774f3a2752bf9e941bdcd5654b18035155161c63b20936dfc9bd7334feb9a6fe9a99a65491161083b39ac3bd578e2cf4f90cba3c786e9924fa0611f65a725331b77b63e7c8b552e1637bc77531ba0f2c9cac72115b28e523929ede4e5b246a0755e8d5c4089d94bf16627fb08672cfffa523bba3d976489a0eec60d3c6a96ca2b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha3-256000 DXSDK_Aug09.exe.sha3-256000]<br />
|- style="text-align:center;vertical-align:center;"<br />
| rowspan="6" | '''{{nowrap|SHA-2}}''' || ''SHA-224'' || a3a74b89cccfe314b79418d5598aac5e94800221e5d945c74f15c004 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-224 DXSDK_Aug09.exe.sha2-224]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA-256'' || 4ab1de69312f10f6b41310a5218d80c478bbd823bc0f86627318d690b128fb9f || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-256 DXSDK_Aug09.exe.sha2-256]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA-384'' || 254ed29c6ad2cadc6f013d2d51c0ac78a6bbe236a2c94ca99610eba8b2c1200d1a62c445ca9ee51bb09354875d5eca8a || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-384 DXSDK_Aug09.exe.sha2-384]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA-512'' || style="width: 60%;" | 736393c0dfa32221e229890f87eb330174d70dd2a02fa0cace303816d3e7a10a332a44129748de39665d1b339e627d6028c2080268f7afdd5240c447fec8ff0b || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512 DXSDK_Aug09.exe.sha2-512]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA-512/224'' || 7e23d9ba916000782a17e23abf48e25237f45590cfe767aed9d79f10 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512224 DXSDK_Aug09.exe.sha2-512224]<br />
|- style="text-align:center;vertical-align:center;"<br />
| ''SHA-512/256'' || 0c833a56046fe7e4213fcb1862c730acf313d1b8f60b51eebf64dc3e79730c1c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha2-512256 DXSDK_Aug09.exe.sha2-512256]<br />
|- style="text-align:center;vertical-align:center;"<br />
| colspan="2" | '''MD5''' || 66e5379ecf46b014688779621bcc677c || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.md5 DXSDK_Aug09.exe.md5]<br />
|- style="text-align:center;vertical-align:center;"<br />
| colspan="2" | '''{{nowrap|SHA-1}}''' || 5b9b969ed7b6cf5534bb7350e44c09b3573b0e71 || [https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sha1 DXSDK_Aug09.exe.sha1]<br />
|}<br />
CRC32 e9f5c61d ([https://assets.mtasa.com/DXSDK/DXSDK_Aug09.exe.sfv DXSDK_Aug09.exe.sfv])<br><br />
<br />
'''NOTE:''' Restart your computer after installing ''Microsoft DirectX SDK'', because otherwise the environment variable '''DXSDK_DIR''' won't be available yet. After restarting it re-run '''create-projects.bat'''<br />
<br />
'''Cant find d3dx9.h'''<br><br />
Add the '''$(DXSDK_DIR)Include;''' to the VC++ Directories in DirectX9GuiRenderer, GUI and Client Core projects.<br />
You can find the VC++ Directories list by selecting a project, then pressing the shortcut ALT + ENTER (without the +), then under the 'Configuration properties' you can find 'VC++ Directories', and in there you can find the 'Include Directories' field, click on it and add ''';$(DXSDK_DIR)Include;''' at the end of it. <br />
'''Note: You need to do the same thing in Release mode as well'''<br />
<br />
'''Cant find d3dx9.lib'''<br><br />
Do do same as in the error above, but instead of ''';$(DXSDK_DIR)Include;''' you must add ''';$(DXSDK_DIR)Lib/x86;''' to the '''Library directories''' field<br />
'''Note: You need to do the same thing in Release mode as well'''<br />
<br />
'''S1023 Error'''<br><br />
[https://support.microsoft.com/en-us/kb/2728613 "S1023" error when you install the DirectX SDK (June 2010)]<br style="clear:both"><br />
<br />
=== Git Client ===<br />
[[File:Git_logo.png|left|32px|link=https://git-scm.com/]]<br />
<br />
If you would like to contribute to MTA, you should install Git. This will allow you to collaborate with us by creating branches and pushing to your own fork. If you are not comfortable with the command line, we recommend you to download and install [https://desktop.github.com/ GitHub Desktop].<br />
<br />
If you only want to compile the source code and are not interested in contributing to MTA, you can download the source directly (see below).<br />
<br />
== Getting the latest source code ==<br />
<br />
To get the latest code, you will have to download the latest copy of our Git repository.<br><br />
We recommend cloning the repository in your Git client because you can pull any updates from there easily.<br />
<br />
* '''Repository:''' [https://github.com/multitheftauto/mtasa-blue multitheftauto/mtasa-blue]<br />
* '''.zip:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.zip master.zip]<br />
* '''.tar.gz:''' [https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz master.tar.gz]<br />
<br />
== Compiling the code ==<br />
# Execute the script '''win-create-projects.bat'''<br />
# Open the solution file '''MTASA.sln''' in the '''Build''' directory<br />
# If you are asked to upgrade the project, click '''Cancel'''<br />
# Compile in Visual Studio with '''Debug''' configuration (may take some minutes)<br />
# Execute the script '''win-install-data.bat'''<br />
<br />
= Running the software =<br />
<br />
== Running the client ==<br />
<br />
You can start your client in the '''Bin''' directory. You might find there a ''Multi Theft Auto.exe'' and/or ''Multi Theft Auto_d.exe'' executable. The ''_d'' suffix indicates a debug build of the software.<br><br />
Furthermore, you can also run your client inside the debugger from Visual Studio if you want to investigate a stack trace or set breakpoints in interesting code regions (read more in the section Debugging below).<br />
<br />
== Running the dedicated server ==<br />
<br />
If you already have run step 5 (''Install resources'') in ''Compiling the code'' to install resources then you can go to ''Starting the server''.<br />
<br />
=== Installing the latest resources ===<br />
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.<br />
<br />
Our official resources repository is [https://github.com/multitheftauto/mtasa-resources hosted on GitHub]. You can download the latest resources from there or [http://mirror.mtasa.com/mtasa/resources/ download a zipped version]. Make sure that you have the latest resources package.<br />
<br />
=== Starting the server ===<br />
To run the server, open the ''MTA Server.exe'' executable in the '''Bin/server''' directory. The ''_d'' suffix indicates a debug build of the software.<br><br />
You can also run the debug build ''MTA Server_d.exe'' with the Visual Studio Debugger (as of writing, you can do that by right-clicking on the Server's Launcher project and selecting ''Start a local instance'' in the ''Debugger'' menu), but you can also attach to a running debug build MTA server (see more in the section Debugging below).<br />
<br />
== Debugging ==<br />
If you already compiled the code in the '''Debug''' configuration then continue reading, if not, then go up to ''Compiling the code'' and follow the steps for a ''Debug'' build.<br><br />
You can either launch MTA yourself and attach any debugger you want to use (also applies to the Visual Studio debugger) or you start a local debugging session in Visual Studio.<br><br />
[[File:Local_Windows_Debugger.PNG]]<br />
<br />
=== How to enable breakpoints ===<br />
If you choose to run MTA with Visual Studio then you should also attach the debugger to the executable '''gta_sa.exe''' (press ''CTRL + ALT + P'' in Visual Studio) - otherwise, your<br />
breakpoints will not work for anything besides the MTA Launcher project.<br><br />
[[File:Attach_to_Process.png|600px]]<br />
<br />
=== Extending timeout duration ===<br />
When you use breakpoints during debugging, you may get kicked by the server due to timeout, because the client is frozen. To prevent this, create the '''timeout.longtime''' file in your ''Bin/server/'' directory. <br />
The content of the file is the new timeout duration in seconds, so make sure you type a huge number in there. If you keep the file empty, the timeout will be set to 120 seconds.<br />
<br />
=== ReAttach for Visual Studio ===<br />
You can use [https://marketplace.visualstudio.com/items?itemName=ErlandR.ReAttach ReAttach] to re-attach the debugger to the '''gta_sa.exe''' executable whenever you start your local debugger in Visual Studio.<br><br />
[[File:ReAttach_to_GTASA.PNG]]<br />
<br />
= Getting involved =<br />
Please see our [[Coding guidelines]] for information on the coding practice.<br />
<br />
= Additional information =<br />
If you need more information, try our [http://bugs.mtasa.com/ bug tracker] or [irc://irc.multitheftauto.com IRC channel].<br />
<br />
= Errors =<br />
== CL38 error. [netc_d.dll not found] ==<br />
Solution: Delete '''Multi Theft Auto_d.exe''' and hit compile again.<br />
<br />
== After cloning the repository, it doesn't compile the project ==<br />
Solution: Execute '''win-create-projects.bat''' in main directory.<br />
<br />
== CL17 Load field. Please ensure that the latest data files have been installed correctly ==<br />
Solution: Execute '''win-install-data.bat''' in main directory.<br />
<br />
== ERROR: Loading network library (net_d.dll) failed! ==<br />
Solution: Execute '''win-install-data.bat''' in main directory.<br />
<br />
[[en:Compiling MTASA]]<br />
[[hu:Compiling MTASA]]<br />
[[pt-br:Compilando o MTASA]]<br />
[[ru:Compiling MTASA]]<br />
[[Category: Development]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=File:VsFoundationClasses.png&diff=73116File:VsFoundationClasses.png2021-12-07T21:08:05Z<p>Botder: Botder uploaded a new version of File:VsFoundationClasses.png</p>
<hr />
<div></div>Botderhttps://wiki.multitheftauto.com/index.php?title=File:Skinid106.jpg&diff=72946File:Skinid106.jpg2021-10-21T01:44:54Z<p>Botder: Botder reverted File:Skinid106.jpg to an old version</p>
<hr />
<div></div>Botderhttps://wiki.multitheftauto.com/index.php?title=User:ZJK&diff=72909User:ZJK2021-10-13T17:32:13Z<p>Botder: Botder moved page User:ZJK to User:Djebzer: Automatically moved page while renaming the user "ZJK" to "Djebzer"</p>
<hr />
<div>#REDIRECT [[User:Djebzer]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Talk:SetPedBleeding&diff=72012Talk:SetPedBleeding2021-09-03T12:01:42Z<p>Botder: Created page with "--~~~~ @Hydra The example overall wasn't good."</p>
<hr />
<div>--[[User:Botder|Botder]] ([[User talk:Botder|talk]]) 12:01, 3 September 2021 (UTC) <br />
@Hydra<br />
The example overall wasn't good.</div>Botderhttps://wiki.multitheftauto.com/index.php?title=SetPedBleeding&diff=72011SetPedBleeding2021-09-03T11:59:17Z<p>Botder: Reverted edits by Hydra (talk) to last revision by StrixG</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0159|1.5.8|20935|This function allows you to set [[player|player's]] or [[ped|ped's]] bleeding effect.}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool setPedBleeding( ped thePed, bool bleeding ) </syntaxhighlight> <br />
{{OOP||[[ped]]:setBleeding|bleeding|isPedBleeding}}<br />
<br />
===Required Arguments===<br />
*'''thePed:''' the player or ped whose bleeding effect you want to set of.<br />
*'''bleeding:''' boolean specifying whether the player or ped is bleeding or not.<br />
<br />
===Returns===<br />
Returns ''true'' if the bleeding state was successfully set, ''error'' is raised otherwise.<br />
<br />
==Example==<br />
{{Example}}<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.5.8-9.20935|}}<br />
<br />
==See Also==<br />
{{Client ped functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=IsPedBleeding&diff=72010IsPedBleeding2021-09-03T11:57:47Z<p>Botder: We can see your name in the page history</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0159|1.5.8|20935|This function gets the state of a [[player|player's]] or [[ped|ped's]] bleeding effect.}}<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool isPedBleeding( ped thePed ) </syntaxhighlight> <br />
{{OOP||[[ped]]:isBleeding|bleeding|setPedBleeding}}<br />
<br />
===Required Arguments===<br />
*'''thePed:''' the player or ped whose bleeding effect state you want to get.<br />
<br />
===Returns===<br />
Returns ''true'' if the player or ped is bleeding, ''false'' otherwise.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
function checkBleeding()<br />
if isPedBleeding(localPlayer) then<br />
outputChatBox("The ped is bleeding")<br />
else<br />
outputChatBox("The ped is not bleeding")<br />
end<br />
end<br />
addCommandHandler("cBleed", checkBleeding)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.5.8-9.20935|}}<br />
<br />
==See Also==<br />
{{Client ped functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Shutdown&diff=71651Shutdown2021-08-11T16:01:48Z<p>Botder: </p>
<hr />
<div>{{Server function}}<br />
__NOTOC__<br />
This function shuts down the server. <br />
<br />
Make sure your server ACL setup has function.shutdown object protected.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool shutdown ( [ string reason = "No reason specified" ] ) <br />
</syntaxhighlight> <br />
{{New items|3.0159|1.5.8|<br />
<syntaxhighlight lang="lua"><br />
bool shutdown ( [ string reason = "No reason specified", number exitCode = 0 ] ) <br />
</syntaxhighlight> <br />
|20915}}<br />
<br />
===Optional Arguments===<br />
*'''reason:''' the reason why the server has been shutdown.<br />
{{New items|3.0159|1.5.8|<br />
*'''exitCode:''' the server application exit code to be returned on shutdown.<br />
|20915}}<br />
<br />
===Returns===<br />
Returns ''false'' if it was not possible to shut down the server.<br />
<br />
==Example== <br />
This command shuts down the server on request<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler ( "shutdown", function ( player, command, reason )<br />
if ( hasObjectPermissionTo ( player, "function.shutdown" ) ) then<br />
shutdown ( reason or "" )<br />
end<br />
end )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Server functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=GetWaterLevel&diff=71641GetWaterLevel2021-08-10T13:50:55Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}} <br />
This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam).<br />
{{Note|Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro.}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
float getWaterLevel ( float posX, float posY, float posZ [ , bool ignoreDistanceToWaterThreshold = false ] )<br />
</syntaxhighlight><br />
<syntaxhighlight lang="lua"><br />
float getWaterLevel ( water theWater )<br />
</syntaxhighlight><br />
<br />
===Required Arguments=== <br />
*'''x:''' The X axis position<br />
*'''y:''' The Y axis position<br />
*'''z:''' The Z axis position<br />
<br />
''or:''<br />
*'''theWater:''' the water element<br />
<br />
===Optional Arguments=== <br />
*'''ignoreDistanceToWaterThreshold:''' If set to false, this function returns false, if the difference between water level (without waves) and posZ is greater than 3.0<br />
<br />
===Returns===<br />
Returns an ''integer'' of the water level if the [[localPlayer]]/position is near the water (-3 to 20 on the Z coordinate) else ''false'' if there's no water near the [[localPlayer]]/position.<br />
<br />
==Example==<br />
This example will tell you what's the water level where the specified player is located.<br />
<syntaxhighlight lang="lua"><br />
function scriptGetLevel ( command, playername ) --when getlevel is called<br />
local thePlayer = getPlayerFromName ( playername ) --get the player from nickname<br />
if ( thePlayer ~= false ) then --if there is a player from the nickname<br />
local x, y, z = getElementPosition ( thePlayer ) -- get his position<br />
local level = getWaterLevel ( x, y, z )<br />
if level then -- if it's not false<br />
level = z - level -- calculate how far away is he from the water<br />
outputChatBox( "You are " .. level .. " units away from the water!", source )<br />
else outputChatBox ( "There's no sign of water" )<br />
end<br />
else outputChatBox ( "Player does not exist" )<br />
end<br />
end<br />
addCommandHandler( "getlevel", scriptGetLevel ) -- add a command "getloc" which<br />
</syntaxhighlight><br />
<br />
== Issues ==<br />
{{Issues|<br />
{{GH_Issue|458|bCheckWaves argument does nothing}}<br />
}}<br />
<br />
==See Also==<br />
{{Client water functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Element/Connection&diff=70875Element/Connection2021-04-19T20:51:08Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
The element type of this class is '''"db-connection"'''.<br />
<br />
==Related scripting functions==<br />
===Server===<br />
{{SQL_functions}}<br />
[[Category:Element Types]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Connection&diff=70874Connection2021-04-19T20:51:00Z<p>Botder: Botder moved page Connection to Element/Connection</p>
<hr />
<div>#REDIRECT [[Element/Connection]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Element/Connection&diff=70873Element/Connection2021-04-19T20:51:00Z<p>Botder: Botder moved page Connection to Element/Connection</p>
<hr />
<div>==Related scripting functions==<br />
===Server===<br />
{{connection functions}}<br />
[[Category:Scripting Concepts]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Meta.xml&diff=70694Meta.xml2021-04-15T23:16:20Z<p>Botder: </p>
<hr />
<div>The ''meta.xml'' file presents MTA with a set of metadata, such as the resource's name, the scripts to include, and which files to precache for sending to clients among other things. It is also the scope of "elements". It is written in XML, which is based on HTML and is the parent of XHTML.<br />
<br />
=Tags=<br />
XML is a textual data format which is widely used for the representation of data. MTA uses an XML-based language to describe the metadata for resources by using the tags below:<br />
<br />
*'''<info />''' Information about this resource, possible parameters include (any arbitrary parameters can be used and read using [[getResourceInfo]]):<br />
** '''author:''' The author of this resource<br />
** '''version:''' The version of this resource<br />
** '''name:''' The name of this resource<br />
** '''description:''' A brief description of this resource<br />
** '''type:''' The type of this resource, that can be "gamemode", "script", "map" or "misc".<br />
** '''gamemodes:''' The gamemodes to be compatible with the resource. It must be the name of the gamemode resource, not the gamemode name. If you want it to be compatible with multiple gamemodes, it must be in a comma-separated list without spaces. (e.g. gamemodes="test1,test2"). <br />
*'''<script />''' Source code for this resource, possible parameters are:<br />
** '''src:''' The file name of the source code<br />
** '''type:''' The type of source code: "client", "server" or "shared".<br />
*** A '''shared''' script will be ran for both client and server, but separately as usual (basically adds the script twice: once for server and once for client)<br />
**'''cache:''' When the script file type is "client", this setting controls whether the file is saved on the clients' hard drive. Default is "true". Using "false" will mean the file is not saved. ''(Note: cache=false files are started at the client first, so lua file load order might differ when mixing cache settings)''<br />
**'''validate:''' If set to "false", compatibility checks are skipped.<br />
*'''<map />''' The map for a gamemode, possible parameters are:<br />
**'''src:''' .map file name (can be path too eg. "maps/filename.map")<br />
**'''dimension:''' Dimension in which the map will be loaded (optional)<br />
*'''<file />''' A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)<br />
**'''src:''' client-side file name (can be path too eg. "images/image.png")<br />
**'''download:''' Whether or not to be sent to the client automatically (optional). Default is "true". Using "false" will mean they are not sent on resource start but could later be used by [[downloadFile]].<br />
*'''<include />''' Include resources that this resource will use<br />
**'''resource:''' Resource name that you want to start with this resource<br />
**'''minversion:''' Minimum version that '''resource''' needs to be (optional)<br />
**'''maxversion:''' Maximum version that '''resource''' needs to be (optional)<br />
*'''<config />''' Config file (.xml) can be accessed by resource, possible parameters are:<br />
**'''src:''' The file name of the config file<br />
**'''type:''' The type of the config file: "client" or "server"<br />
*'''<export />''' This exports functions from this resource, so other resources can use them with [[call]]<br />
**'''function:''' The function name<br />
**'''type''' Whether function is exported server-side or client-side (valid values are: "client", "server" and "shared")<br />
*** A '''shared''' export will make the function callable from both client and server scripts (basically adds the export twice: once for server and once for client)<br />
**'''http:''' Can the function be called via HTTP (true/false)<br />
*'''<html />'''<br />
**'''src:''' The filename for the HTTP file (can be a path)<br />
**'''default:''' The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)<br />
**'''raw:''' The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)<br />
*'''<settings />''' Most gamemodes use [[settings system]] to let server admins to configure it how they like. For instance you could set round time and then use [[get]] and [[set]] to get the value or change it, respectively.<br />
** '''<setting />''' Resource settings can be accessed by resource and Admin panel, possible parameters are:<br />
*** '''name:''' The setting name used by the scripts to get or set the setting value<br />
*** '''value:''' The setting default value used by the scripts<br />
*** '''friendlyname:''' A friendly name to the setting (optional)<br />
*** '''accept:''' The values the setting could accept (optional)<br />
*** '''examples:''' An Example of a value (optional)<br />
*** '''desc:''' A description of the setting (optional)<br />
*'''<min_mta_version />''' Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is "{{Current Version|full}}"). See example for example.<br />
**'''client:''' The minimum client version<br />
**'''server:''' The minimum server version<br />
*'''<aclrequest />''' A list of [[Access_Control_List|ACL]] rights this resource will need.<br />
** '''<right />''' an individual right<br />
***'''name:''' The right name.<br />
***'''access:''' Set to ''true'' to allow the resource to access this right. Set to ''false'' to deny the access to this right.<br />
{{New items|3.0132|1.3.1 r4141|<br />
*'''<sync_map_element_data />''' Controls whether map [[Element_data|element data]] such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.<br />
**'''false:''' Disable transfer of map element data for all resources. This can reduce map download times considerably.<br />
**'''true:''' Enable transfer of map element data for all resources. (If '''false''' and '''true''' are set in different resources, true will have priority and all resources will transfer map element data)<br />
}}<br />
{{New items|3.0140|1.4.0 r5313|<br />
*'''<oop />''' OOP - Please refer to [[OOP]] for documentation.<br />
**'''false:''' Disable OOP.<br />
**'''true:''' Enable OOP.<br />
}}<br />
{{New feature/item|3.0150|1.5.0|7308|<br />
*'''<download_priority_group />''' If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. This option is useful for resources with critical client functionality that other things in your gamemode (or fair play) rely on. If set to less than 0 (a negative number, like -1), the resource will be downloaded and started on the client later than other resources. As this can be confusing, here is an example: <br />
**'''Resource A: <download_priority_group>20</download_priority_group>''' will start earlier than..<br />
**'''Resource B: <download_priority_group>10</download_priority_group>'''<br/>In this case, Resource A will start earlier than Resource B because its value (20) is higher than (10). In turn, Resource B will still start earlier than a resource with a negative value or a value below 10 (like 5).<br />
<br />
}}<br />
<br />
== Example ==<br />
Here's an example of a meta file using some of the tags mentioned:<br />
{{#tag:syntaxhighlight |<br />
<meta><br />
<info author="Slothman" version="1.0.2" name="Stealth" description="Allow scripts to insert a ped that simulates combat with a real player" type="gamemode" /><br />
<br />
<script src="stealthmain_server.lua" /><br />
<script src="noiseblip.lua" /><br />
<script src="mission_timer.lua" /><br />
<script src="gadgets_server.lua" /><br />
<script src="gadgets_client.lua" type="client"/><br />
<script src="stealthmain_client.lua" type="client" validate="true"/><br />
<script src="noisebar.lua" type="client"/><br />
<script src="spycam.lua" type="client"/><br />
<script src="riemann_z_demonstration.lua" type="client" cache="false"/><br />
<br />
<map src="base.map" dimension="1"/><br />
<br />
<file src="riot_shield.txd" download="false" /><br />
<file src="riot_shield.dff" download="false" /><br />
<file src="riot_shield.col" download="false" /><br />
<file src="armor.png" /><br />
<file src="camera.png" /><br />
<file src="cloak.png" /><br />
<file src="goggles.png" /><br />
<file src="mine.png" /><br />
<file src="radar.png" /><br />
<file src="shield.png" /><br />
<br />
<include resource="scoreboard" /><br />
<include resource="killmessages" /><br />
<include resource="maplimits" /><br />
<br />
<config src="help.xml" type="client"/><br />
<br />
<export function="exampleExport1" type="server" /><br />
<export function="exampleExport2" type="client" /><br />
<export function="exampleExport3" type="shared" /><br />
<br />
<settings><br />
<setting name="roundlimit" value="[6]" /> <!-- round length in minutes --><br />
<setting name="teamdamage" value="[1]" /> <!-- 0 for team protection off, 1 for team protection on --><br />
<setting name="teambalance" value="[1]" /> <!-- difference limit of amount of players between teams --><br />
<setting name="isAllowedToShoot" value="true" /><br />
<setting name="admingroup" value="Admin,AdminPlus"<br />
friendlyname="Admin group list"<br />
group="_Advanced"<br />
accept="*"<br />
examples="Admin,Moderator,SuperModerator"<br />
desc="To use this resource, the player must belong to one of the groups listed."<br />
/> <!-- a setting example using all optional parameters --><br />
<setting name="spazammo" value="[25]" /> <!-- ammo amounts --><br />
<setting name="m4ammo" value="[100]" /><br />
<setting name="shotgunammo" value="[25]" /><br />
<setting name="sniperammo" value="[20]" /><br />
<setting name="ak47ammo" value="[120]" /><br />
<setting name="rifleammo" value="[40]" /><br />
<setting name="deserteagleammo" value="[45]" /><br />
<setting name="pistolammo" value="[132]" /><br />
<setting name="uziammo" value="[150]" /><br />
<setting name="tec9ammo" value="[150]" /><br />
<setting name="silencedammo" value="[65]" /><br />
<setting name="grenadeammo" value="[4]" /><br />
<setting name="satchelammo" value="[4]" /><br />
<setting name="teargasammo" value="[4]" /><br />
<setting name="molatovammo" value="[4]" /><br />
</settings><br />
<br />
<min_mta_version server="1.5.2-9.07903" client="1.5.2-9.07903" /><br />
<br />
<aclrequest><br />
<right name="function.startResource" access="true" /><br />
<right name="function.stopResource" access="true" /><br />
<right name="function.setPlayerMuted" access="true" /><br />
</aclrequest><br />
<br />
<sync_map_element_data>false</sync_map_element_data><br />
<br />
<oop>false</oop><br />
<br />
<download_priority_group>0</download_priority_group><br />
</meta><br />
|lang="xml"}}<br />
[[Category:Scripting Concepts]]<br />
[[hu:Meta.xml]]<br />
[[cs:Meta.xml]]<br />
[[de:Meta.xml]]<br />
[[es:Sobre el archivo "meta.xml"]]<br />
[[it:Meta.xml]]<br />
[[pl:Meta.xml]]<br />
[[ru:Meta.xml]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Meta.xml&diff=70693Meta.xml2021-04-15T23:15:37Z<p>Botder: </p>
<hr />
<div>The ''meta.xml'' file presents MTA with a set of metadata, such as the resource's name, the scripts to include, and which files to precache for sending to clients among other things. It is also the scope of "elements". It is written in XML, which is based on HTML and is the parent of XHTML.<br />
<br />
=Tags=<br />
XML is a textual data format which is widely used for the representation of data. MTA uses an XML-based language to describe the metadata for resources by using the tags below:<br />
<br />
*'''<info />''' Information about this resource, possible parameters include (any arbitrary parameters can be used and read using [[getResourceInfo]]):<br />
** '''author:''' The author of this resource<br />
** '''version:''' The version of this resource<br />
** '''name:''' The name of this resource<br />
** '''description:''' A brief description of this resource<br />
** '''type:''' The type of this resource, that can be "gamemode", "script", "map" or "misc".<br />
** '''gamemodes:''' The gamemodes to be compatible with the resource. It must be the name of the gamemode resource, not the gamemode name. If you want it to be compatible with multiple gamemodes, it must be in a comma-separated list without spaces. (e.g. gamemodes="test1,test2"). <br />
*'''<script />''' Source code for this resource, possible parameters are:<br />
** '''src:''' The file name of the source code<br />
** '''type:''' The type of source code: "client", "server" or "shared".<br />
*** A '''shared''' script will be ran for both client and server, but separately as usual (basically adds the script twice: once for server and once for client)<br />
**'''cache:''' When the script file type is "client", this setting controls whether the file is saved on the clients' hard drive. Default is "true". Using "false" will mean the file is not saved. ''(Note: cache=false files are started at the client first, so lua file load order might differ when mixing cache settings)''<br />
**'''validate:''' If set to "false", compatibility checks are skipped.<br />
*'''<map />''' The map for a gamemode, possible parameters are:<br />
**'''src:''' .map file name (can be path too eg. "maps/filename.map")<br />
**'''dimension:''' Dimension in which the map will be loaded (optional)<br />
*'''<file />''' A client-side file. Generally these are images, .txd, .col, .dff or .xml files. They'll be downloaded by clients when the resources is started (or on join)<br />
**'''src:''' client-side file name (can be path too eg. "images/image.png")<br />
**'''download:''' Whether or not to be sent to the client automatically (optional). Default is "true". Using "false" will mean they are not sent on resource start but could later be used by [[downloadFile]].<br />
*'''<include />''' Include resources that this resource will use<br />
**'''resource:''' Resource name that you want to start with this resource<br />
**'''minversion:''' Minimum version that '''resource''' needs to be (optional)<br />
**'''maxversion:''' Maximum version that '''resource''' needs to be (optional)<br />
*'''<config />''' Config file (.xml) can be accessed by resource, possible parameters are:<br />
**'''src:''' The file name of the config file<br />
**'''type:''' The type of the config file: "client" or "server"<br />
*'''<export />''' This exports functions from this resource, so other resources can use them with [[call]]<br />
**'''function:''' The function name<br />
**'''type''' Whether function is exported server-side or client-side (valid values are: "client", "server" and "shared")<br />
*** A '''shared''' export will make the function callable from both client and server scripts (basically adds the export twice: once for server and once <br />
**'''http:''' Can the function be called via HTTP (true/false)<br />
*'''<html />'''<br />
**'''src:''' The filename for the HTTP file (can be a path)<br />
**'''default:''' The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false)<br />
**'''raw:''' The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false)<br />
*'''<settings />''' Most gamemodes use [[settings system]] to let server admins to configure it how they like. For instance you could set round time and then use [[get]] and [[set]] to get the value or change it, respectively.<br />
** '''<setting />''' Resource settings can be accessed by resource and Admin panel, possible parameters are:<br />
*** '''name:''' The setting name used by the scripts to get or set the setting value<br />
*** '''value:''' The setting default value used by the scripts<br />
*** '''friendlyname:''' A friendly name to the setting (optional)<br />
*** '''accept:''' The values the setting could accept (optional)<br />
*** '''examples:''' An Example of a value (optional)<br />
*** '''desc:''' A description of the setting (optional)<br />
*'''<min_mta_version />''' Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is "{{Current Version|full}}"). See example for example.<br />
**'''client:''' The minimum client version<br />
**'''server:''' The minimum server version<br />
*'''<aclrequest />''' A list of [[Access_Control_List|ACL]] rights this resource will need.<br />
** '''<right />''' an individual right<br />
***'''name:''' The right name.<br />
***'''access:''' Set to ''true'' to allow the resource to access this right. Set to ''false'' to deny the access to this right.<br />
{{New items|3.0132|1.3.1 r4141|<br />
*'''<sync_map_element_data />''' Controls whether map [[Element_data|element data]] such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.<br />
**'''false:''' Disable transfer of map element data for all resources. This can reduce map download times considerably.<br />
**'''true:''' Enable transfer of map element data for all resources. (If '''false''' and '''true''' are set in different resources, true will have priority and all resources will transfer map element data)<br />
}}<br />
{{New items|3.0140|1.4.0 r5313|<br />
*'''<oop />''' OOP - Please refer to [[OOP]] for documentation.<br />
**'''false:''' Disable OOP.<br />
**'''true:''' Enable OOP.<br />
}}<br />
{{New feature/item|3.0150|1.5.0|7308|<br />
*'''<download_priority_group />''' If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. This option is useful for resources with critical client functionality that other things in your gamemode (or fair play) rely on. If set to less than 0 (a negative number, like -1), the resource will be downloaded and started on the client later than other resources. As this can be confusing, here is an example: <br />
**'''Resource A: <download_priority_group>20</download_priority_group>''' will start earlier than..<br />
**'''Resource B: <download_priority_group>10</download_priority_group>'''<br/>In this case, Resource A will start earlier than Resource B because its value (20) is higher than (10). In turn, Resource B will still start earlier than a resource with a negative value or a value below 10 (like 5).<br />
<br />
}}<br />
<br />
== Example ==<br />
Here's an example of a meta file using some of the tags mentioned:<br />
{{#tag:syntaxhighlight |<br />
<meta><br />
<info author="Slothman" version="1.0.2" name="Stealth" description="Allow scripts to insert a ped that simulates combat with a real player" type="gamemode" /><br />
<br />
<script src="stealthmain_server.lua" /><br />
<script src="noiseblip.lua" /><br />
<script src="mission_timer.lua" /><br />
<script src="gadgets_server.lua" /><br />
<script src="gadgets_client.lua" type="client"/><br />
<script src="stealthmain_client.lua" type="client" validate="true"/><br />
<script src="noisebar.lua" type="client"/><br />
<script src="spycam.lua" type="client"/><br />
<script src="riemann_z_demonstration.lua" type="client" cache="false"/><br />
<br />
<map src="base.map" dimension="1"/><br />
<br />
<file src="riot_shield.txd" download="false" /><br />
<file src="riot_shield.dff" download="false" /><br />
<file src="riot_shield.col" download="false" /><br />
<file src="armor.png" /><br />
<file src="camera.png" /><br />
<file src="cloak.png" /><br />
<file src="goggles.png" /><br />
<file src="mine.png" /><br />
<file src="radar.png" /><br />
<file src="shield.png" /><br />
<br />
<include resource="scoreboard" /><br />
<include resource="killmessages" /><br />
<include resource="maplimits" /><br />
<br />
<config src="help.xml" type="client"/><br />
<br />
<export function="exampleExport1" type="server" /><br />
<export function="exampleExport2" type="client" /><br />
<export function="exampleExport3" type="shared" /><br />
<br />
<settings><br />
<setting name="roundlimit" value="[6]" /> <!-- round length in minutes --><br />
<setting name="teamdamage" value="[1]" /> <!-- 0 for team protection off, 1 for team protection on --><br />
<setting name="teambalance" value="[1]" /> <!-- difference limit of amount of players between teams --><br />
<setting name="isAllowedToShoot" value="true" /><br />
<setting name="admingroup" value="Admin,AdminPlus"<br />
friendlyname="Admin group list"<br />
group="_Advanced"<br />
accept="*"<br />
examples="Admin,Moderator,SuperModerator"<br />
desc="To use this resource, the player must belong to one of the groups listed."<br />
/> <!-- a setting example using all optional parameters --><br />
<setting name="spazammo" value="[25]" /> <!-- ammo amounts --><br />
<setting name="m4ammo" value="[100]" /><br />
<setting name="shotgunammo" value="[25]" /><br />
<setting name="sniperammo" value="[20]" /><br />
<setting name="ak47ammo" value="[120]" /><br />
<setting name="rifleammo" value="[40]" /><br />
<setting name="deserteagleammo" value="[45]" /><br />
<setting name="pistolammo" value="[132]" /><br />
<setting name="uziammo" value="[150]" /><br />
<setting name="tec9ammo" value="[150]" /><br />
<setting name="silencedammo" value="[65]" /><br />
<setting name="grenadeammo" value="[4]" /><br />
<setting name="satchelammo" value="[4]" /><br />
<setting name="teargasammo" value="[4]" /><br />
<setting name="molatovammo" value="[4]" /><br />
</settings><br />
<br />
<min_mta_version server="1.5.2-9.07903" client="1.5.2-9.07903" /><br />
<br />
<aclrequest><br />
<right name="function.startResource" access="true" /><br />
<right name="function.stopResource" access="true" /><br />
<right name="function.setPlayerMuted" access="true" /><br />
</aclrequest><br />
<br />
<sync_map_element_data>false</sync_map_element_data><br />
<br />
<oop>false</oop><br />
<br />
<download_priority_group>0</download_priority_group><br />
</meta><br />
|lang="xml"}}<br />
[[Category:Scripting Concepts]]<br />
[[hu:Meta.xml]]<br />
[[cs:Meta.xml]]<br />
[[de:Meta.xml]]<br />
[[es:Sobre el archivo "meta.xml"]]<br />
[[it:Meta.xml]]<br />
[[pl:Meta.xml]]<br />
[[ru:Meta.xml]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Client_Manual&diff=69579Client Manual2021-03-05T14:10:18Z<p>Botder: Switch to Windows 10 as recommended operating system</p>
<hr />
<div>==Before you start==<br />
Before you install Multi Theft Auto: San Andreas, first make sure that there are no modifications to GTA:SA installed. These will conflict with MTA. If you would like to keep your single-player mods, you can create two installations by reinstalling San Andreas to a second folder on your hard drive.<br />
<br />
Also, make sure that your machine is capable of running the game in single player. Note that if you are running single player on the absolute minimum requirements, you will experience slowdowns in MTA as it takes up extra processing power.<br />
{{Note| <br />
* MTA:SA will only work on GTA:SA '''v1.0'''. If you bought the game recently, it is likely that you have a later version.''' [[Known_Issues_-_FAQ#Does_MTASA_work_with_v1.01_or_v2.00_of_GTA_San_Andreas.3F| (More info)]]<br />
* If you have a Steam copy of GTA: San Andreas you should [[Known_Issues_-_FAQ#I_have_the_Steam_version_of_GTA_San_Andreas._How_can_I_play_MTASA.3F|read this first]].<br />
}}<br />
<br />
===System requirements===<br />
====Minimum system requirements====<br />
The minimum system requirements for Multi Theft Auto: San Andreas are '''slightly higher''' than the original minimum requirements for Grand Theft Auto: San Andreas:<br />
* Windows 7 or newer (Microsoft supported) operating system ([[Compatibility FAQ|XP and Vista do not work and are obsolete]])<br />
* Intel Pentium 4 or AMD Athlon XP<br />
* 1 GB RAM<br />
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)<br />
* 3.7GB of free hard disk space (3.6GB for a minimum Grand Theft Auto installation; remember that MTA caches files from the servers that you play on and require disk space)<br />
* Nvidia GeForce 4 series or ATI Radeon 8xxx series (64MB VRAM and DirectX 9.0 compatible)<br />
* DirectX 9.0 compatible sound card<br />
* Keyboard and mouse<br />
* Internet access<br />
<br />
====Recommended system requirements====<br />
* Windows 10 operating system<br />
* Intel Core 2 Duo Processor or AMD equivalent<br />
* 2 GB RAM<br />
* Clean installation of Grand Theft Auto: San Andreas, version 1.0 (American or European)<br />
* >5GB of free hard disk space (Remember that MTA caches files from the servers that you play on and require disk space)<br />
* Nvidia GeForce FX series or higher, ATI Radeon 9xxx series or higher, Pixel Shader 2.0 compatible<br />
* DirectX 9.0 compatible sound card<br />
* Keyboard and mouse<br />
* Broadband internet access (for smooth online play)<br />
<br />
====Notes====<br />
* The minimum system requirements are considered the bare minimum for MTA: San Andreas, the performance can depend on the game modes that are running and the player count.<br />
* For extra loading performance, more RAM is recommended.<br />
* Make sure Windows is fully up to date.<br />
* Make sure you head over to the [[Known_Issues_-_FAQ|Known Issues]] page if you have issues, or join us on IRC @ irc://irc.multitheftauto.com/mta or [https://mtasa.com/discord MTA discord] and do so in the #help-support channel.<br />
<br />
==Installing the game==<br />
# If you haven't already, download the MTA:SA client from the download page at [http://mtasa.com mtasa.com].<br />
# Run the installer, for Windows Vista and 7 it is required to run this with administrator rights. (The installer will ask.)<br />
# You need to accept the license that comes with MTA:SA (GPLv3).<br />
# You will be asked which components to install:<br />
#* '''Game Client''' interfaces with the game and is a required component.<br />
#* '''Dedicated Server''' enables you to host your own home-brew server.<br />
#** '''Core components''' and '''Game module''' are required components for the dedicated server.<br />
#** '''Core resources''' required resources for dedicated server.<br />
#** '''Optional resources''' additional resources for your dedicated server, gamemodes and maps.<br />
#** '''Editor''' is used to create new maps, this is an optional component.<br />
#* '''Development''' development tools.<br />
#** '''Module SDK''' development SDK for creating your own MTA server modules, this component requires C++ knowledge.<br />
#* '''Start menu group''' creates a start menu group for the installed components.<br />
#* '''Desktop icon''' creates a desktop icon for the client.<br />
# You are then asked for a folder in which to install the mod. This can by anywhere and doesn't have to be in you San Andreas directory.<br />
# Next, you will be asked for the directory where you have San Andreas installed. The default location is: '''C:\Program Files\Rockstar Games\GTA San Andreas\'''.<br />
# When the installation completes, you will be given the option to start MTA: San Andreas straight away. Choose your option and then press '''Finish'''.<br />
# You will be able to launch ''MTA San Andreas'' from your Start Menu if you wish to play.<br />
<br />
==Running the game==<br />
# Start Multi Theft Auto by clicking the icon located in your Start Menu under '''MTA:San Andreas'''.<br />
# GTA: San Andreas will start and once it is loaded, you will be presented with the MTA:SA main menu. Here you will find several options (you could also watch a how-to tutorial [http://www.youtube.com/watch?v=ShiqnOazNYw here]):<br />
<br />
{| border="0" align="center"<br />
<br />
| width="188" |<br />
[[Image:Server_Browser.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Browse servers''' – this allows you to receive a list of available servers to play on. </font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Host_Game.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Host game''' – this allows you to start a local server. </font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Menu_Settings.JPG|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Settings '''– this allows you to change your in-game nickname, customize controls and adjust display settings.</font><br />
<br />
<br /><br /><br />
|-<br />
| width="188" |<br />
[[Image:About_Menu.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''About '''– this gives you a list of contributors to the project.</font><br />
<br />
<br /><br />
|-<br />
| width="188" |<br />
[[Image:Map_Editor.jpg|280px]]<br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Map editor '''– this allows you to create your own maps, complete with checkpoints, ramps, pickups and other objects. These can then be uploaded onto a server so that you can play them with other people.</font><br />
<br />
<br /><br /><br />
|-<br />
| width="188" |<br />
<br><br />
| width="380" |<br />
<font size="-1" face="tahoma,helvetica,arial,sans-serif">'''Quit '''– this returns you back to your Windows desktop.</font><br />
<br />
<br /><br /><br />
|}<br />
<br />
The easiest way to play the game is to click '''Browse Servers''' on the menu. If servers have not appeared already, press the '''Refresh''' button and MTA will scan for servers, displaying them as a list.<br />
<br />
* Under the '''Name''' tab, each server's name is displayed.<br />
* Under the '''Players''' tab, the number of players and the maximum capacity of the server is displayed, in the format of [Used Slots] / [Maximum Slots].<br />
* The '''Ping''' tab displays the ping, or latency, between your machine and the server. Ping is a measure of the time it takes for "packets" of data to be received back from the server after sending them, so a higher ping means that you will experience more lag on that particular server. Generally, servers closest to your location should have the lowest pings.<br />
* The '''Host''' is the IP address of the server. You can use this address in future to connect to the same server via the Quick Connect option on the main menu.<br />
<br />
Each tab can be clicked to arrange the respective column in ascending or descending order.<br />
<br />
For optimal performance and gameplay, look for the best balance between players and ping.<br />
<br />
Once you have picked a server, select it and click the '''Connect''' button in the top right-hand corner of the dialog. If all goes well, you should connect to the server and automatically join the game.<br />
<br />
==How to Play==<br />
<br />
MTA:SA offers a comprehensive scripting system that allows map creators to customize many elements of the game in order to create their own innovative game modes. The game incorporates as many single player elements as possible but some aspects are different.<br />
<br />
The only other people on the map are your opponents, or allies if it is a team game. You can talk with them using the chatbox located in the left-hand corner of the screen by pressing '''T'''. To chat only to your team members, press '''Y'''.<br />
<br />
MTA's map editor allows map creators to add various GTA objects to their maps including roads, exploding barrels, ramps, buildings, hills and more. Not only this, but the objects can be scripted to move, change model and disappear. This offers a great deal of fun and variation to the gameplay. <br />
<br />
Holding Tab will display the scoreboard. By default, only names and pings are displayed, but scripts can add extra columns that are specific to the particular gamemode being played. For example, a deathmatch game mode would definitely have a column listing total kills, but the map creator may choose to add extra columns for the number of deaths you have and how long you have been playing for, in order to put your score into perspective.<br />
<br />
==Default Controls==<br />
<br />
===In-Game Keys===<br />
<br />
* F8 (or Tilde Key) - Console<br />
* F11 - Show SA map ''(the following list is for use when the map is up)''<br />
**numpad /- - Zoom in and out<br />
**numpad 4, 8, 6, 2 - move map left, up, right, down<br />
**numpad 0 - toggle between attach to local player (map follows player blip) and free move (map stays stationary) <br />
* F12 - Take a screenshot<br />
* T - Chat<br />
* Y - Team Chat<br />
<br />
===Resource Specific Keys===<br />
These keys depend on the scripts that are running on the server.<br />
<br />
* F9 - In-game help (Help manager resource)<br />
* Z - Push to talk, if voice is enabled on the server.<br />
* TAB - Player List (if [[Scoreboard]] resource is running on the server)<br />
<br />
==Console Commands==<br />
<br />
'''bind defaults''' Binds control defaults in the settings menu<br />
<br />
Press '''~ (tilde)''' or '''F8''' to access the console, then type a command followed by any necessary parameters (if applicable) then press Enter.<br />
<br />
;'''maps''' :This displays a list of all maps available on the server. <br />
<br />
;'''nick [nickname]''' :This changes your nickname whilst in-game to whatever you specify in the parameters.<br />
<br />
;'''msg [nickname] [message]''' or '''pm [nickname] [message]''' :This sends a private message to the person you specify in the [nickname] parameter. Only the person you specify can see the message. Both '''msg''' and '''pm''' perform the same function.<br />
<br />
;'''quit''' or '''exit''' :This disconnects you from the server and returns you to the Windows desktop. Performs the same function as the Quit button on the main menu.<br />
<br />
;'''ver''' :This displays the version number and copyright information for the software.<br />
<br />
;'''sver''' :This displays the version number of the server you are connected to.<br />
<br />
;'''time''' :This displays the current time.<br />
<br />
;'''disconnect''' :This disconnects you from the server and returns you to the main menu.<br />
<br />
;'''say [text]''' :This enables you to continue talking to people in the chat box whilst the console is open.<br />
<br />
;'''ignore [nickname]''' :This will not display any text typed by the player you wish to ignore. To stop ignoring a player, type '''ignore [nickname]''' again.<br />
{{Tip|You can use these commands in the chatbox by putting a / (forward slash) in front of them.}}<br />
<br />
A list of console commands can be seen by typing '''help''' into the console and pressing Enter. The current map may also have extra commands which can be accessed by typing '''commands''' into the console.<br />
<br />
For information on more commands see: [[Client Commands]]<br />
<br />
==Error codes and their meanings==<br />
=== Download errors ===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|0<br />
|UNKNOWN_ERROR<br />
|-<br />
|1<br />
|INVALID_FILE_DESCRIPTORS<br />
|-<br />
|2<br />
|INVALID_MAX_FILE_DESCRIPTOR<br />
|-<br />
|3<br />
|INVALID_SELECT_RETURN<br />
|-<br />
|4<br />
|INVALID_INITIAL_MULTI_PERFORM<br />
|-<br />
|5<br />
|INVALID_MULTI_PERFORM_CODE<br />
|-<br />
|6<br />
|INVALID_MULTI_PERFORM_CODE_NEW_DOWNLOADS<br />
|-<br />
|7<br />
|UNEXPECTED_CURL_MESSAGE<br />
|-<br />
|8<br />
|UNABLE_TO_CONNECT<br />
|-<br />
|9<br />
|UNABLE_TO_DOWNLOAD_FILE<br />
|-<br />
|10<br />
|FAILED_TO_INITIALIZE_DOWNLOAD<br />
|}<br />
===Fatal errors===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|1<br />
|no local player model on ingame event<br />
|-<br />
|2<br />
|no local player on ingame event<br />
|-<br />
|3<br />
|server downloads disabled<br />
|-<br />
|4<br />
|no local player model on player-list packet<br />
|-<br />
|5<br />
|no local player on player-list packet<br />
|-<br />
|6<br />
|invalid custom data length on entity-add packet<br />
|-<br />
|7<br />
|invalid bitstream data on entity-add packet<br />
|-<br />
|8<br />
|system entity on entity-add packet<br />
|-<br />
|9<br />
|failed to create object on entity-add packet<br />
|-<br />
|10<br />
|failed to create pickup on entity-add packet<br />
|-<br />
|11<br />
|failed to create vehicle on entity-add packet<br />
|-<br />
|12<br />
|invalid team-name length on entity-add packet<br />
|-<br />
|13<br />
|invalid lua-event name length in lua-event packet<br />
|-<br />
|14<br />
|invalid resource name length in resource-start packet<br />
|}<br />
<br />
==='Unable to enter vehicle' errors===<br />
:{| class="wikitable sortable" style="width: auto; table-layout: fixed;"<br />
|-<br />
!Code<br />
!scope="col" class="unsortable" | Meaning<br />
|-<br />
|1<br />
|script cancelled<br />
|-<br />
|2<br />
|script cancelled (jack)<br />
|-<br />
|3<br />
|current occupier is entering/exiting<br />
|-<br />
|4<br />
|invalid seat<br />
|-<br />
|5<br />
|not close enough<br />
|-<br />
|6<br />
|already in a vehicle<br />
|-<br />
|7<br />
|already entering/exiting<br />
|-<br />
|8<br />
|invalid vehicle (trailer)<br />
|}<br />
<br />
==Special: Playing MTA on Linux or macOS?==<br />
If you're one of those who use other precious systems, and want to have the client working on your computer,<br />
please read the [[Client on Linux Manual]] or [[Client on Mac OS X Manual]].<br />
<br />
[[cs:Client Manual]]<br />
[[de:MTA DM Client Anleitung]]<br />
[[en:Client Manual]]<br />
[[es:Manual Cliente Deathmatch]]<br />
[[fr:Manuel Client]]<br />
[[hu:Client Manual]]<br />
[[it:Manuale del Client]]<br />
[[nl:Deathmatch Client Manual]]<br />
[[pl:Client Manual]]<br />
[[pt-br:Manual do Cliente]]<br />
[[ru:Deathmatch Client Manual]]<br />
[[zh-cn:客户端手册]]<br />
<br />
[[Category:Support]]</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Main_Page&diff=68408Main Page2021-01-23T22:43:45Z<p>Botder: Added Discord dev server invite</p>
<hr />
<div><div style="display: flex; align-items: center; padding-left: 15px; padding-right: 15px;"><br />
[[File:Mtalogo.png||100px|link=https://wiki.multitheftauto.com/]]<br />
<div style="margin-left: .5em"><br />
'''Welcome to the [[Multi Theft Auto]] wiki.''' On this wiki you'll find a wealth of information on using Multi Theft Auto.<br />
<br />
There are many [[How you can help|things you can do to help us]] improve MTA - create a map, a gamemode, help document scripting functions, write example code, write tutorials or just play MTA and report the bugs you find.<br />
<br />
If you have any questions or problems related to scripting, feel free to get in touch with us on [[Places To Chat#Scripting Help|Discord or IRC]].<br />
<br />
<span style="margin-top: 1em; display: block;">[ Stop playing with yourself ]</span><br />
</div><br />
</div><br />
<br />
<div style="display: flex; flex-direction: row; flex-wrap: wrap;"><br />
<br />
<div style="flex-grow: 1"> <!-- left column start --><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;"><br />
<div style="float:right; width: 32px;">[[File:Input-gaming.png|link=]]</div><br />
<h3>Play</h3><br />
<div style="background: #FFEEAA; border: 1px solid #FFCD19;"><br />
[[File:Go-down.png|link=https://mtasa.com/]] ''' [https://mtasa.com/ Download Multi Theft Auto: San Andreas {{Current Version|full}}]'''</div><br />
* [[Where to buy GTASA]]<br />
* [[Client Manual]]<br />
<!-- * [[Changes_in_{{padleft:|3|{{Current Version|full}}}}| Changes in {{padleft:|3|{{Current Version|full}}}}]] --><br />
* [[Changes_in_{{padleft:|5|{{Current Version|full}}}}| Changes in {{padleft:|5|{{Current Version|full}}}}]]<br />
* [[Known_Issues_-_FAQ|Known Issues]]<br />
* [[Server Manual]]<br />
* [[Map manager|Map Manager]]<br />
<br />
<h3>Map Editor</h3><br />
*[[Resource:Editor|Manual]]<br />
*[[Resource:Editor/EDF|Editor Definition Format]]<br />
*[[Resource:Editor/Plugins|Plugins]]<br />
*[[Resource:Editor#FAQ|Frequently Asked Questions]]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Package-x-generic.png|link=]]</div><br />
<h3>Databases</h3><br />
This section outlines all the Lua capabilites MTA or resources provide.<br />
* [[:Category:Resource|Resource Catalogue]] - You must learn these to make proper scripts<br />
* [[Client side scripts]]<br />
* [[Modules]]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-development.png|link=]]</div><br />
<h3>Developing Multi Theft Auto</h3><br />
[[File:Go-down.png|link=https://nightly.mtasa.com/]] [https://nightly.mtasa.com/ Nightly builds]<br />
* [[Compiling_MTASA|Compiling MTASA on Windows]]<br />
<!--* [[Building_MTASA_Server_on_Mac_OS_X|Compiling MTASA on Mac OS X]]--><br />
* [[Building_MTASA_Server_on_GNU_Linux|Compiling MTASA on GNU/Linux]]<br />
* [[Coding guidelines]]<br />
* [https://github.com/multitheftauto/mtasa-blue Main GitHub repository]<br />
* [[Roadmap]]<br />
* [https://github.com/multitheftauto/mtasa-blue/issues Bugtracker]<br />
* [[Branches]]<br />
*[[Forks|Forks and anti cheat]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Applications-office.png|link=]]</div><br />
<h3>Wiki - How can you help</h3><br />
* Finish documentation for [[:Category:Incomplete|Incomplete functions]].<br />
* [[:Category:Needs_Example |Add examples to functions and events]].<br />
* Review and verify [[:Category:Needs Checking|pages that need checking]].<br />
* Write tutorials to help new people.<br />
* Translate wiki pages.<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Internet-group-chat.png|link=]]</div><br />
<h3>Community</h3><br />
* [https://forum.multitheftauto.com/ Forum]<br />
* Community Discord: [https://mtasa.com/discord Official MTA Discord server] ([https://mtasa.com/discord/post Forum post])<br />
* Development Discord: [https://discord.com/invite/GNN6PRtTnu Server invite link]<br />
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]<br />
* [https://community.mtasa.com/ MTA Community] - Share and download resources.<br />
* [https://twitter.com/#!/MTAQA/ Twitter] - [https://www.youtube.com/user/MTAQA YouTube] - [https://facebook.com/multitheftauto Facebook] - [https://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]<br />
</div><br />
</div> <!-- left column end --><br />
<br />
<div style="flex-grow: 1"> <!-- right column start --><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:Accessories-text-editor.png|link=]]</div><br />
<h3>Scripting</h3><br />
* [[Scripting Introduction|Introduction to Scripting]]<br />
* [[Introduction to Scripting the GUI]]<br />
* [[Debugging|Debugging Tutorial]] - How to find errors in your scripts<br />
* [[Resources|Introduction to Resources]]<br />
** [[Resource Web Access]] - How you can write websites with resources<br />
** [[CEF_Tutorial|CEF Tutorial]] - How you can use the in-game web browser in your resources<br />
** [[:Category:Resource|Resource Catalogue]]<br />
** [[Meta.xml]] - Behind every resource is a meta file that defines it<br />
** [[ACL]] - Access Control List, this is vital for complex scripts to work<br />
* [[Writing_Gamemodes|Writing Gamemodes]]<br />
Forum Links<br />
* [https://forum.mtasa.com/forum/71-scripting/ Scripting Sub-Forum], [https://forum.mtasa.com/forum/123-tutorials/ Scripting Tutorials Sub-Forum]<br />
* [https://forum.mtasa.com/topic/24702-mtasa-wiki-offline-copies-online-mirrors/ Offline Wiki Copies]<br />
<div style="float:right; width: 32px;">[[File:start-here.png|link=]]</div><br />
<h3>General Lua Help</h3><br />
Pages designed to aid your understanding of Lua<br />
*[http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]<br />
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]<br />
*[http://nixstaller.sourceforge.net/manual/0.5.1/nixstaller_10.html A general guide to Lua from Nixstaller]<br />
</div><br />
<br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;"><br />
<div style="float:right; width: 32px;">[[File:Preferences-system.png|link=]]</div><br />
<h3>Reference</h3><br />
* [[Client Scripting Functions|Client-side Functions]]<br />
* [[Client Scripting Events|Client-side Events]]<br />
* [[Server Scripting Functions|Server-side Functions]]<br />
* [[Server Scripting Events|Server-side Events]]<br />
* [[Useful Functions]]<br />
<!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --><br />
* [[MTA Classes]] - Detailed descriptions of all MTA custom types<br />
** [[Element|MTA Elements]] / [[Element tree]]<br />
</div><br />
<div style="border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;"><br />
<div style="float:right; width: 32px;">[[File:System-file-manager.png|link=]]</div><br />
<h3>[[Id|ID Lists]]</h3><br />
*[[Animations|Animations]]<br />
*[[Character Skins]]<br />
*[[CJ_Clothes|Clothing styles]]<br />
*[[Garage|Garage IDs]]<br />
*[[Interior IDs]]<br />
*[[Material IDs]]<br />
*[[Ped voices|Ped Voices]]<br />
*[[Projectiles]]<br />
*[[Radar Blips]]<br />
*[[Sounds]]<br />
*[[Vehicle IDs]]<br />
*[[Vehicle Colors]]<br />
*[[Vehicle Upgrades]]<br />
*[[Vehicle variants|Vehicle Variants]]<br />
*[[Vehicle component manipulation]]<br />
*[[Weapons|Weapons]]<br />
*[[Weather]]<br />
</div><br />
</div> <!-- right column end --><br />
</div> <!-- flex container close --><br />
<br />
<!-- Footer --><br />
<div style="display: flex; flex-wrap: wrap; align-items: center; padding-left: 15px; padding-right: 15px;" class="plainlinks"><br />
<span style="margin-right: 1em;">[[File:MTALogo_8ball.png||85px|link=Archive]]</span><br />
<br />
<div style="display: flex; flex-wrap: wrap;><br />
<div style="margin-right: 5em;"><br />
'''About [[Multi Theft Auto]]''' <br><br />
[[Archive]] <br><br />
[[Press Coverage]] <br><br />
[https://github.com/multitheftauto/mtasa-blue/graphs/contributors Developers]<br />
</div><br />
<br />
<div style="margin-right: 5em;"><br />
'''Multi Theft Auto 0.5''' <br><br />
[[Archive#Multi_Theft_Auto_0.5|Download]] <br><br />
[[MTA 0.5r2 Known Issues|Known Issues]]<br />
</div><br />
<br />
<div style="margin-right: 5em;"><br />
'''Wiki Stats''' <br><br />
{{NUMBEROFARTICLES}} Articles <br><br />
{{NUMBEROFPAGES}} Pages <br><br />
{{NUMBEROFUSERS}} Registered Users <br><br />
</div><br />
<br />
<div><br />
[[File:Osi symbol.png|75px|link=https://opensource.org/|left]]<br />
'''Multi Theft Auto''' is '''Open Source'''. <br />
<br/>This means anyone can contribute to making Multi Theft Auto even better!<br />
</div><br />
</div><br />
<br />
</div><br />
<br />
<br />
__NOTOC__<br />
__NOEDITSECTION__<br />
{{Languages list|en}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Client_resource_events&diff=68334Template:Client resource events2021-01-18T14:23:46Z<p>Botder: </p>
<hr />
<div>{{New items|3.0160|1.5.8|<br />
*[[onClientResourceFileDownload]]<br />
|20788}}<br />
*[[onClientResourceStart]]<br />
*[[onClientResourceStop]]<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Client_other_events&diff=68333Template:Client other events2021-01-18T14:22:47Z<p>Botder: </p>
<hr />
<div>*[[onClientChatMessage]]<br />
*[[onClientConsole]]<br />
*[[onClientDebugMessage]]<br />
*[[onClientExplosion]]<br />
*[[onClientFileDownloadComplete]]<br />
*[[onClientHUDRender]]<br />
*[[onClientMinimize]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientPedsProcessed]]<br />
|20704}}<br />
*[[onClientPlayerNetworkStatus]]<br />
*[[onClientPreRender]]<br />
*[[onClientRender]]<br />
*[[onClientRestore]]<br />
{{New items|3.0160|1.5.8|<br />
*[[onClientTransferBoxProgressChange]]<br />
*[[onClientTransferBoxVisibilityChange]]<br />
|20788}}<br />
{{New items|3.0157|1.5.6|<br />
*[[onClientWorldSound]]<br />
|14652}}<br />
<noinclude>[[Category:Events templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=IsTransferBoxVisible&diff=68332IsTransferBoxVisible2021-01-18T14:21:10Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0160|1.5.8|20788|Determines if the transfer box should be visible.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool isTransferBoxVisible()<br />
</syntaxhighlight><br />
<br />
===Returns===<br />
On '''server''' this returns a boolean, whether the transfer box should be visible during downloads or not.<br />
<br />
On '''client''' this returns a boolean, whether the transfer box should be visible or not at the time of invocation.<br />
<br />
==Examples==<br />
{{Needs Example}}<br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20788|1.5.8-9.20788|}}<br />
<br />
==See Also==<br />
{{Shared_server_functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=SetTransferBoxVisible&diff=68331SetTransferBoxVisible2021-01-18T14:19:30Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0160|1.5.8|20788|Determines whether or not the transferbox should appear to [[players]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setTransferBoxVisible ( bool visible )<br />
</syntaxhighlight><br />
<br />
===Required Arguments=== <br />
*'''visible:''' The new visibility state.<br />
<br />
===Returns===<br />
Returns ''true'' if the visibility was set successfully, ''false'' otherwise.<br />
<br />
==Examples==<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onResourceStart', resourceRoot, function()<br />
setTransferBoxVisible(false)<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20788|1.5.8-9.20788|}}<br />
<br />
==See Also==<br />
{{Shared_server_functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Shared_server_functions&diff=68330Template:Shared server functions2021-01-18T14:16:28Z<p>Botder: </p>
<hr />
<div>*[[getFPSLimit]]<br />
{{New items|3.0160|1.5.8|<br />
*[[isTransferBoxVisible]]<br />
*[[setTransferBoxVisible]]<br />
|20788}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=SetTransferBoxVisible&diff=68329SetTransferBoxVisible2021-01-18T14:14:27Z<p>Botder: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0160|1.5.8|20788|Determines whether or not the transferbox should appear to [[players]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setTransferBoxVisible ( bool visible )<br />
</syntaxhighlight><br />
<br />
===Required Arguments=== <br />
*'''visible:''' The new visibility state.<br />
<br />
===Returns===<br />
Returns ''true'' if the visibility was set successfully, ''false'' otherwise.<br />
<br />
==Examples==<br />
<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler('onResourceStart', resourceRoot, function()<br />
setTransferBoxVisible(false)<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==Requirements==<br />
{{Requirements|1.5.8-9.20788|1.5.8-9.20788|}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=68328Template:Client vehicle functions2021-01-18T14:12:58Z<p>Botder: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
{{New items|3.0158|1.5.7|<br />
*[[areVehicleLightsOn]]<br />
|19626}}<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getHeliBladeCollisionsEnabled]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getOriginalHandling]]<br />
*[[getTrainDirection]]<br />
*[[getTrainPosition]]<br />
*[[getTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[getTrainTrack]]<br />
|7485}}<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleComponentPosition]]<br />
*[[getVehicleComponentRotation]]<br />
*[[getVehicleComponentScale]]<br />
*[[getVehicleComponentVisible]]<br />
*[[getVehicleComponents]]<br />
*[[getVehicleController]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleDoorState]]<br />
{{New items|3.0160|1.5.8|<br />
*[[getVehicleDummyPosition]]<br />
|20797}}<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHandling]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
{{New items|3.0157|1.5.6|<br />
*[[getVehicleModelDummyPosition]]<br />
|14403}}<br />
{{New items|3.0160|1.5.8|<br />
*[[getVehicleModelDummyDefaultPosition]]<br />
|20797}}<br />
*[[getVehicleModelExhaustFumesPosition]]<br />
*[[getVehicleModelFromName]]<br />
{{New items|3.0158|1.5.7|<br />
*[[getVehicleModelWheelSize]]<br />
|20642}}<br />
*[[getVehicleName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleNitroCount]]<br />
*[[getVehicleNitroLevel]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleSirens]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleSirenParams]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
{{Deprecated items|3.0156|1.5.6|<br />
*[[getVehicleTurnVelocity]]<br />
}}<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleType]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleVariant]]<br />
{{New items|3.0158|1.5.7|<br />
*[[getVehicleWheelScale]]<br />
|20642}}<br />
*[[getVehicleWheelStates]]<br />
*[[isTrainChainEngine]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleNitroActivated]]<br />
*[[isVehicleNitroRecharging]]<br />
*[[isVehicleOnGround]]<br />
*[[isVehicleTaxiLightOn]]<br />
{{New items|3.0156|1.5.5|<br />
*[[isVehicleWheelOnGround]]<br />
|11854}}<br />
*[[isVehicleWindowOpen]]<br />
*[[removeVehicleUpgrade]]<br />
*[[resetVehicleComponentPosition]]<br />
*[[resetVehicleComponentRotation]]<br />
*[[resetVehicleComponentScale]]<br />
{{New items|3.0160|1.5.8|<br />
*[[resetVehicleDummyPositions]]<br />
|20797}}<br />
*[[setHeliBladeCollisionsEnabled]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainPosition]]<br />
*[[setTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[setTrainTrack]]<br />
|7485}}<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleComponentPosition]]<br />
*[[setVehicleComponentRotation]]<br />
*[[setVehicleComponentScale]]<br />
*[[setVehicleComponentVisible]]<br />
*[[setVehicleDamageProof]]<br />
{{New items|3.0160|1.5.8|<br />
*[[setVehicleDummyPosition]]<br />
|20797}}<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorOpenRatio]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleGravity]]<br />
{{New items|3.0156|1.5.5|<br />
*[[setVehicleHandling]]<br />
|12009}}<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
{{New items|3.0157|1.5.6|<br />
*[[setVehicleModelDummyPosition]]<br />
|14403}}<br />
*[[setVehicleModelExhaustFumesPosition]]<br />
{{New items|3.0158|1.5.7|<br />
*[[setVehicleModelWheelSize]]<br />
|20642}}<br />
*[[setVehicleNitroActivated]]<br />
*[[setVehicleNitroCount]]<br />
*[[setVehicleNitroLevel]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehiclePlateText]]<br />
*[[setVehicleSirens]]<br />
*[[setVehicleSirensOn]]<br />
*[[setVehicleTaxiLightOn]]<br />
{{Deprecated items|3.0156|1.5.6|<br />
*[[setVehicleTurnVelocity]]<br />
}}<br />
*[[setVehicleTurretPosition]]<br />
{{New items|3.0160|1.5.8|<br />
*[[setVehicleVariant]]<br />
|20693}}<br />
{{New items|3.0160|1.5.8|<br />
*[[getVehicleWheelFrictionState]]<br />
|20726}}<br />
{{New items|3.0158|1.5.7|<br />
*[[setVehicleWheelScale]]<br />
|20642}}<br />
*[[setVehicleWheelStates]]<br />
*[[setVehicleWindowOpen]]<br />
<br />
<noinclude>[[ru:Template:RU/Client_vehicle_functions]]<br />
[[Category:Functions templates]]</noinclude></div>Botderhttps://wiki.multitheftauto.com/index.php?title=ResetVehicleDummyPositions&diff=68324ResetVehicleDummyPositions2021-01-18T12:47:20Z<p>Botder: Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0160|1.5.8|20797| This function resets the vehicle dependent dummy positions to the vehicle's current model dummy positions..."</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
<br />
{{New feature/item|3.0160|1.5.8|20797|<br />
This function resets the vehicle dependent dummy positions to the vehicle's current model dummy positions.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool resetVehicleDummyPositions ( vehicle theVehicle )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:resetDummyPositions||}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] to reset<br />
<br />
===Returns===<br />
Returns ''true'' for success, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==Requirements==<br />
{{Requirements||1.5.8-9.20797|}}<br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=SetVehicleDummyPosition&diff=68323SetVehicleDummyPosition2021-01-18T12:44:32Z<p>Botder: Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0160|1.5.8|20797| This function sets the position of the dummy for the given vehicle.}} ==Syntax== <syntaxhighlight lang="..."</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
<br />
{{New feature/item|3.0160|1.5.8|20797|<br />
This function sets the position of the dummy for the given vehicle.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setVehicleDummyPosition ( vehicle theVehicle, string dummy, float x, float y, float z )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:setDummyPosition||getVehicleDummyPosition}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you want to set the dummy position for<br />
*'''dummy:''' The dummy whose position you want to set<br />
*'''x''', '''y''', '''z''' The new dummy position<br />
<br />
==Allowed dummies==<br />
{{VehicleDummies}}<br />
<br />
===Returns===<br />
Returns ''true'' for success, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==Requirements==<br />
{{Requirements||1.5.8-9.20797|}}<br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Botderhttps://wiki.multitheftauto.com/index.php?title=GetVehicleDummyPosition&diff=68322GetVehicleDummyPosition2021-01-18T12:41:20Z<p>Botder: Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0160|1.5.8|20797| This function returns the position of the dummy for the given vehicle.}} ==Syntax== <syntaxhighlight lan..."</p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
<br />
{{New feature/item|3.0160|1.5.8|20797|<br />
This function returns the position of the dummy for the given vehicle.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float, float, float getVehicleDummyPosition ( vehicle theVehicle, string dummy )<br />
</syntaxhighlight><br />
{{OOP||[[vehicle]]:getDummyPosition||setVehicleDummyPosition}}<br />
<br />
===Required Arguments=== <br />
*'''theVehicle:''' The [[vehicle]] you want to get the dummy positions from<br />
*'''dummy:''' The dummy whose position you want to get<br />
<br />
==Allowed dummies==<br />
{{VehicleDummies}}<br />
<br />
===Returns===<br />
Returns three floats indicating the position ''x'', ''y'' and ''z'' of the vehicle's dummy. It returns ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==Requirements==<br />
{{Requirements||1.5.8-9.20797|}}<br />
<br />
==See Also==<br />
{{Vehicle functions}}</div>Botder