https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=Necktrox&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-29T10:11:21ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=User:Necktrox&diff=54807User:Necktrox2018-04-25T23:32:58Z<p>Necktrox: </p>
<hr />
<div><pageclass class="#ff8800" subcaption="Necktrox&rsquo;s Profile"></pageclass><br />
<br />
== Download and install socket module ==<br />
You can read more about downloading and installing the sockets module here: [[Modules/Sockets]]<br />
<br />
== Compile socket module on Ubuntu 15.10 (or on any Debian distro?)==<br />
=== Install the necessary build tools, headers and libraries === <br />
<syntaxhighlight lang="lua"><br />
$ sudo apt-get install git build-essential automake libtool lib32z1-dev g++-multilib<br />
</syntaxhighlight><br />
<br />
=== Clone the '''multitheftauto/multitheftauto-modules''' repository to your disk === <br />
<syntaxhighlight lang="lua"><br />
$ git clone https://github.com/multitheftauto/multitheftauto-modules.git mta-modules<br />
</syntaxhighlight><br />
<br />
=== Change your directory to '''mta-modules/sockets''' === <br />
<syntaxhighlight lang="lua"><br />
$ cd mta-modules/sockets<br />
</syntaxhighlight><br />
<br />
=== Make the shell scripts executable, so they can be ran from terminal === <br />
<syntaxhighlight lang="lua"><br />
$ chmod a+x build-32.sh<br />
$ chmod a+x build-64.sh<br />
</syntaxhighlight><br />
<br />
=== Build the x32/x64 libraries === <br />
<syntaxhighlight lang="lua"><br />
$ ./build-32.sh<br />
$ ./build-64.sh<br />
</syntaxhighlight></div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=User:Botder&diff=54806User:Botder2018-04-25T23:32:33Z<p>Necktrox: Add contact</p>
<hr />
<div>== Contact ==<br />
*[https://github.com/Octalype GitHub Profile]<br />
*[https://forum.mtasa.com/profile/40389-octalype/ Forum Profile]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Help:Main_Page&diff=54641Help:Main Page2018-04-07T18:38:20Z<p>Necktrox: </p>
<hr />
<div></div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Template:DE/N%C3%BCtzliche_Funktionen&diff=54640Template:DE/Nützliche Funktionen2018-04-07T18:31:43Z<p>Necktrox: </p>
<hr />
<div>*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion erlaubt es jede clientseitige Funktion vom Server aus aufzurufen.</span><br />
<br />
*[[callServerFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion erlaubt es dir jede serverseitige Funktion vom Client aus aufzurufen.</span><br />
<br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion überprüft ob die Argumente vom richtigen Typ sind und ruft die Error-Funktion auf wenn nicht.</span><br />
<br />
*[[iterElements]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Spart Zeit beim schreiben von &nbsp;for Schleifen&nbsp;. Anstatt &nbsp;ipairs( getElementsByType( type))&nbsp; wird &nbsp;iterElements( type )&nbsp; benutzt.</span><br />
<br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Nimmt zwei Punkte und gibt die Richtung von Punkt A zu Punkt B aus.</span><br />
<br />
*[[FormatDate]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Formatiert ein Datum nach den Standards.</span><br />
<br />
*[[getAge]] <span style="color:gray; font-family:'Georgia', sans-serif; font-size:smaller;">» Diese Funktion kalkuliert ein Alter eines Geburtsdatums.</span><br />
<br />
*[[getPointFromDistanceRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Findet einen Punkt basierend auf dem Start-Punk, Richtung und Entfernung.</span><br />
<br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Mit dieser Funktion kann die [http://en.wikipedia.org/wiki/Unix_time UNIX Zeit] benutzt werden.</span><br />
<br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Gibt einen von zwei Werten, basierend auf einer boolean, aus.</span><br />
<br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Überprüft ob das gegebene Jahr ein Schaltjahr ist.</span><br />
<br />
*[[math.round]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Rundet eine Zahl auf die angegebenen Dezimalstellen und der Methode.</span><br />
<br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Schützt eine Tabelle und setzt sie zu "Read-Only".</span><br />
<br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese clientseitige Funktion setzt den Gravitations Punkt in drei, dreidimensionalen Koordinaten mit der Stärke fest.</span><br />
<br />
*[[string.explode]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion spaltet einen "String" an einem bestimmten Punkt und füg sie in eine Tabelle in Stücken ein.</span><br />
<br />
*[[table.copy]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion kopiert eine ganze Tabelle mit allen beinhaltenden Tabellen.</span><br />
<br />
*[[table.map]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion läuft durch eine Tabelle und ersetzt jedes Feld mit dem Rückgabewert der angegebenen Funktion, wobei der Wert des Feldes als erstes Argument übergeben wird und optional weitere Argumente übergeben werden können.</span><br />
<br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Findet die größe einer Tabelle.</span><br />
<br />
*[[var_dump]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">»Diese Funktion gibt Informationen über eine oder mehrere Variablen über &nbsp;outputConsole()&nbsp; aus. </span><br />
<br />
*[[RGBToHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion gibt einen "String" aus, der die Farbe in Hexadezimal enthält.</span><br />
<br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion gibt eine Tabelle mit den aktuell lebenden Spieler eines Teams aus.</span><br />
<br />
*[[getResourceSettings]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion gibt eine Tabelle mit den Ressourcen Informationen aus.</span><br />
<br />
*[[onVehicleWeaponFire]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Dieser Code implementiert ein Event das ausgelöst wird wenn ein Spieler die Waffe eines Fahrzeuges benutzt.</span><br />
<br />
*[[toHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion konvertiert eine Dezimalzahl zu einer Hexadezimalzahl, als Problem Behebung clientseitig.</span><br />
<br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion nimmt die Schnelligkeit eines Elements in kph(kilometers per hour) oder in mph(miles per hour).</span><br />
<br />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion setzt die Schnelligkeit eines Elements in kph(kilometers per hour) oder in mph(miles per hour).</span><br />
<br />
*[[centerWindow]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion zentriert ein Fenster in jeder Auflösung.</span><br />
<br />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Fix für Koroutine Fehler-Nachrichten</span><br />
<br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion nimmt den Spieler bei einem Teil seines Namens.</span><br />
<br />
*[[string.count]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Diese Funktion zählt euch auf, wie oft ein bestimmter String in einem anderen gegebenen String vorhanden ist.</span><br />
<br />
[[Category:Useful Functions]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=IterElements&diff=54639IterElements2018-04-07T18:31:22Z<p>Necktrox: Remove remark</p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle/><br />
__NOTOC__<br />
This function is useful for '''for''' loops. You don't have to type ''ipairs( getElementsByType( "player" ) )'' but simply ''iterElements( "player" )''. It's very useful if you have many for loops in your code.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">iterator iterElements( string elementType )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''elementType''': Type of the elements that you want to iterate through.<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
function iterElements( elementType )<br />
local i = 0;<br />
local tab = getElementsByType( elementType );<br />
return function( )<br />
i = i + 1;<br />
if tab[ i ] then<br />
return i, tab[ i ];<br />
end<br />
end<br />
end<br />
</syntaxhighlight><br />
<br />
<br />
==Example==<br />
This example will iterate through all players and vehicles. It will heal the players, give them $1000, send them a message informing them about the action and fix all vehicles when the resource starts.<br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onResourceStart", getResourceRootElement( ),<br />
function( )<br />
for _, plr in iterElements( "player" ) do<br />
setElementHealth( plr, 100 );<br />
givePlayerMoney( plr, 1000 );<br />
outputChatBox( "You've just been healed and given $1000!", plr );<br />
end<br />
<br />
for _, veh in iterElements( "vehicle" ) do<br />
fixVehicle( veh );<br />
end<br />
end<br />
)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Main_Page&diff=54638Main Page2018-04-07T18:26:27Z<p>Necktrox: Added ped voices</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=https://wiki.multitheftauto.com/]]'''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 our [[IRC Channel]].<br />
<br/><br/>[ Stop playing with yourself ]<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>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 />
* [[Upgrading_from_MTA:Race|Migrating from MTA:Race to MTA:SA {{padleft:|3|{{Current Version|full}}}}]]<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 />
<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://bugs.mtasa.com/ Bugtracker]<br />
* [[Branches]]<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 />
* Discord: [https://forum.mtasa.com/topic/95008-multi-theft-autos-official-discord-server/ Official MTA Discord server]<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://plus.google.com/102014133442331779727/ Google+] - [https://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>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 />
** [[: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 />
* [[Useful_Functions|Useful functions]]<br />
Forum Links<br />
* [https://forum.mtasa.com/forum/71-scripting/ Scripting Forum]<br />
* [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 />
<!-- 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 style="padding:4px 8px 8px 8px; margin:10px;"><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 />
|-<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>'''About [[Multi Theft Auto]]'''</li><br />
<li>[[Archive]]</li><br />
<li>[[Press Coverage]]</li><br />
<li>[https://github.com/multitheftauto/mtasa-blue/graphs/contributors Developers]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Multi Theft Auto 0.5'''</li><br />
<li>[[Archive#Multi_Theft_Auto_0.5|Download]]</li><br />
<li>[[MTA 0.5r2 Known Issues|Known Issues]]</li><br />
</ul><br />
<ul style="list-style: none; width: 200px; float: left;"><br />
<li>'''Wiki Stats'''</li><br />
<li>{{NUMBEROFARTICLES}} Articles</li><br />
<li>{{NUMBEROFPAGES}} Pages</li><br />
<li>{{NUMBEROFUSERS}} Registered Users</li><br />
</ul><br />
</div><br />
|}<br />
<br />
__NOTOC__<br />
__NOEDITSECTION__<br />
{{Languages list|en}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GetVehicleRPM&diff=54239GetVehicleRPM2018-03-29T13:54:05Z<p>Necktrox: Necktrox moved page Multi Theft Auto: Wiki:GetVehicleRPM to GetVehicleRPM without leaving a redirect</p>
<hr />
<div>__NOTOC__<br />
{{Useful Function}}<br />
This function returns a [[vehicle]] engine speed. You will also need a function to [[getElementSpeed]].<br />
==Syntax==<br />
<syntaxhighlight lang="lua">vehicle getVehicleRPM (vehicle)</syntaxhighlight><br />
<br />
===Returns===<br />
It returns a [[vehicle]] engine speed. If not, it returns ''0''.<br />
<br />
==Code==<br />
<syntaxhighlight lang="lua"><br />
function getVehicleRPM(vehicle)<br />
local vehicleRPM = 0<br />
if (vehicle) then <br />
if (getVehicleEngineState(vehicle) == true) then<br />
if getVehicleCurrentGear(vehicle) > 0 then <br />
vehicleRPM = math.floor(((getElementSpeed(vehicle, "kmh")/getVehicleCurrentGear(vehicle))*160) + 0.5) <br />
if (vehicleRPM < 650) then<br />
vehicleRPM = math.random(650, 750)<br />
elseif (vehicleRPM >= 9000) then<br />
vehicleRPM = math.random(9000, 9900)<br />
end<br />
else<br />
vehicleRPM = math.floor((getElementSpeed(vehicle, "kmh")*160) + 0.5)<br />
if (vehicleRPM < 650) then<br />
vehicleRPM = math.random(650, 750)<br />
elseif (vehicleRPM >= 9000) then<br />
vehicleRPM = math.random(9000, 9900)<br />
end<br />
end<br />
else<br />
vehicleRPM = 0<br />
end<br />
return tonumber(vehicleRPM)<br />
else<br />
return 0<br />
end<br />
end<br />
</syntaxhighlight><br />
'''Function made by''': nL~Enzo<br />
<br />
==Examples==<br />
<section name="Client example" class="client" show="true"><br />
This example get vehicle engine speed, and draw engine speed.<br />
<syntaxhighlight lang="lua"><br />
addEventHandler ("onClientRender", root, function()<br />
local veh = getPedOccupiedVehicle (localPlayer)<br />
if veh then<br />
local rpm = getVehicleRPM (veh)<br />
dxDrawText (rpm, 500, 500, 100, 100)<br />
end<br />
end)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See also==<br />
{{Useful Functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=DE/MTA_Scripting_Grundlagen&diff=54097DE/MTA Scripting Grundlagen2018-03-06T19:21:17Z<p>Necktrox: Reverted edits by N0pe (talk) to last revision by Jusonex</p>
<hr />
<div>==Vorwort==<br />
Nachdem ich bereits vor kurzer Zeit mein [[DE/Lua_Tutorial|Lua Tutorial]] fertiggestellt habe, folgt nun eine Einführung in die Grundlagen des MTA Scriptings, in der diesmal direkter Bezug auf MTA genommen wird.<br />
<br />
In Kürze wird es hier im Wiki einen blank Gamemode geben, den man sich herunterladen kann und als Basis für seinen eigenen verwenden kann. Die soll vor allem Anfängern den Einstieg in's MTA Scripting erleichtern.<br />
<br />
<br />
<br />
==Grundlagen==<br />
In diesem Tutorial wird häufig die Rede von Server und Client sein. Ein Client ist quasi ein Spieler, allgemein ist damit jedoch das Programm gemeint, was der Spieler auf dem Rechner installiert hat und mit dem er MTA spielen kann. Mit Server ist einfach der MTA Server gemeint.<br />
Die Hauptaufgabe des Servers besteht darin, Daten von allen Clients bezüglich Position usw. einzusammeln und gleichzeitig an jeweils alle anderen Clients zu verteilen. Im Gegensatz zum Client ist der Server nicht in der Lage physikalische oder graphische Effekte zu berechnen, weswegen viele Funktionen von MTA, die eines dieser beiden Bereiche beeinflussen, clientseitig sind.<br />
<br />
MTA unterscheidet zwischen zwei verschiedenen Ausführungsorten. D.h., dass es Scripts gibt, die vom Server ausgeführt und mit allen Clients synchronisiert werden und welche, die von jedem Client selbst ausgeführt werden und '''nicht''' mit allen anderen Clients synchronisiert werden.<br />
Clientseitig bedeutet, dass etwas nur vom Client ausgeführt wird/werden kann, serverseitig, dass es nur vom Server ausgeführt wird/werden kann. Die meisten Funktionen von MTA können jedoch auf beiden Seiten ausgeführt werden.<br />
Ziel ist es, diese Gegebenheit zu nutzen und den Server somit so gut wie möglich zu entlasten, was nicht immer einfach ist.<br />
<br />
Bei MTA spricht man übrigens nicht von Scripts oder Gamemodes, sondern allgemein von Ressourcen. Eine Ressource ist ein Verzeichnis mit einem oder mehreren Scripts. <br />
Beim Start des MTA Servers wird der ressources Ordner durchsucht und jedes Verzeichnis, dass eine gültige meta.xml enthält, der Liste der verfügbaren Ressourcen hinzugefügt.<br />
<br />
<br />
<br />
==Meta.xml==<br />
===Sinn und Zweck===<br />
Die meta.xml ist eine wichtige Datei, die in jedem Ressourcenordner vorhanden sein muss, damit diese vom MTA Server erkannt wird und ausgeführt werden kann.<br />
Sie definiert, aus welchen Dateien sich die Ressource zusammensetzt und unter anderem auch, welche dieser Dateien beim Connecten an den Client gesendet werden sollen.<br />
<br />
Alle Daten in der meta.xml sind im XML-Format. Ein sogenannter XML-Tag ist ein Datenset, was in etwa so aussieht:<br />
<tagname attribut="wert">inhalt</tagname> oder <tagname attribut="wert" />, wenn der Inhalt entfällt.<br />
Ein XML-Tag kann beliebig viele Attribute enthalten.<br />
<br />
Nähere Informationen zum Thema XML entnehmt ihr aber bitte dem [http://de.wikipedia.org/wiki/Xml Wikipedia-Artikel] darüber.<br />
<br />
<br />
===Mögliche Tags===<br />
<syntaxhighlight lang="xml"><info author="Autor" version="Version" name="Name" description="Beschreibung" type="Typ" /></syntaxhighlight><br />
*Jede Ressource sollte einen info-Tag in der meta.xml enthalten. Werte des info-Tags kann man übrigens mit [[getResourceInfo]] auslesen.<br />
**'''author''': Das ist normalerweise der Name desjenigen, der die Ressource erstellt hat.<br />
**'''version''': Die Version der vorliegenden Ressource. Für alle, die gerne mit wahllosen Versionsnummern um sich schmeißen.<br />
**'''name''': Der Name der Ressource.<br />
**'''description''': Eine kurze Beschreibung der Ressource.<br />
**'''type''': Typ der Ressource. Kann den Wert "gamemode", "script" oder "map" enthalten.<br />
<br />
<syntaxhighlight lang="xml"><script src="Dateipfad und -name" type="Typ" /></syntaxhighlight><br />
*Mit dem script-Tag werden Lua-Scriptdateien in die Ressource eingebunden. Das sind die wohl wichtigsten Dateien der meisten Ressourcen.<br />
**'''src''': Der Pfad zur Scriptdatei relativ zum Odner der jeweiligen Ressource mit dem Dateinamen natürlich.<br />
**'''type''': Typ des Scripts. Kann entweder "server" oder "client" sein. Bei ersterem wird das Script serverseitig ausgeführt, bei letzterem jedem Client beim Verbindungsaufbau gesendet und clientseitig ausgeführt.<br />
<br />
<syntaxhighlight lang="xml"><map src="Dateipfad und -name" /></syntaxhighlight><br />
*Mit dem map-Tag werden Mapdateien eingebunden, die automatisch beim Ressourcenstart geladen werden. Mit den [[Server_Scripting_Functions#Map_functions|Mapfunktionen]] kann man nachträglich noch Maps laden. Eine Map ist übrigens eine Karte, genauer ein Set von ObjektIDs mit Koordinaten und Rotationsangaben.<br />
**'''src''': Der Pfad zur Mapdatei relativ zum Odner der jeweiligen Ressource mit dem Dateinamen natürlich.<br />
<br />
<syntaxhighlight lang="xml"><file src="Dateipfad und -name" /></syntaxhighlight><br />
*Der file-Tag zeichnet eine beliebige Datei als clientseitig aus. Während Scripts vom Typ "client" automatisch heruntergeladen werden, werden es die darin enthaltenen Bilder, Models oder Texturen nicht. Alle Dateien, die im clientseitigen Script verwendet werden, müssen mit dem file-Tag als clientseitig ausgezeichnet werden.<br />
**'''src''': Der Pfad zur Datei relativ zum Odner der jeweiligen Ressource mit dem Dateinamen natürlich.<br />
<br />
<syntaxhighlight lang="xml"><include ressource="Ressourcenname" /></syntaxhighlight><br />
*Manchmal möchte man, dass eine Ressource beim Start automatisch andere Ressourcen mit startet. Dies kann man mit dem include-Tag erreichen.<br />
**'''ressource''': Der Name der Ressource, d.h. der Name des Ordners, in dem die Ressource sich befindet. (Muss sich im resources-Ordner befinden.)<br />
<br />
<syntaxhighlight lang="xml"><config src="Dateipfad und -name" type="Typ" /></syntaxhighlight><br />
*Konfigurationsdateien sind XML-Dateien, in denen bestimmte Einstellungen für einen Ressource vorgenommen werden können, auf die per Script zugegriffen werden kann. Unter den [[Server_Scripting_Functions#Resource_functions|Ressourcenfunktionen]] finden sich solche zum Auslesen und Ändern der Konfiguration.<br />
**'''src''': Der Pfad zur Konfigurationsdatei relativ zum Odner der jeweiligen Ressource mit dem Dateinamen natürlich.<br />
**'''type''': Typ der Konfiguration. Kann entweder "server" oder "client" sein. Bei ersterem wird die Konfigurationsdatei serverseitig eingebunden, bei letzterem jedem Client beim Verbindungsaufbau gesendet und clientseitig eingebunden.<br />
<br />
<syntaxhighlight lang="xml"><export function="Funktionsname" type="Typ" http="true/false" /></syntaxhighlight><br />
*Den export-Tag kann man benutzen, um eine Funktion aus der aktuellen Ressource in anderen laufenden Ressourcen verfügbar zu machen.<br />
**'''function''': Der Name der Funktion.<br />
**'''type''': Typ des Exports. Kann entweder "server" oder "client" sein. Bei ersterem wird die Funktion serverseitig exportiert, bei letzterem clientseitig.<br />
**'''http''': Legt fest, ob die exportierte Funktion auch via HTTP aufgerufen werden kann. Kann demnach entweder "true" (ja) oder "false" (nein) sein.<br />
<br />
<syntaxhighlight lang="xml"><html src="Dateipfad und -name" default="true/false" raw="true/false" /></syntaxhighlight><br />
*Wenn über MTAs eingebauten HTTP-Server Zugang zu einer im Ressourcenordner liegenden Datei ermöglichen will, so muss man diese mit dem html-Tag in der meta.xml einbinden.<br />
**'''src''': Der Pfad zur Datei relativ zum Odner der jeweiligen Ressource mit dem Dateinamen natürlich.<br />
**'''default''': Wenn das HTML-Dokument standardmäßig angezeigt werden soll, wenn über den Browser auf den Ressourcenordner zugegriffen wird, dann muss default="true" sein, ansonsten "false".<br />
**'''raw''': Wenn es sich um eine Datei im binären Format handelt, z.B. einem Bild, dann sollte raw auf "true" gesetzt werden.<br />
<br />
<syntaxhighlight lang="xml"><settings /></syntaxhighlight><br />
<br />
<br />
===Beispiel===<br />
<syntaxhighlight lang="xml"><meta><br />
<info author="Slothman" type="gamemode" name="Stealth" /><br />
<config src="help.xml" type="client"/><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"/><br />
<script src="noisebar.lua" type="client"/><br />
<script src="spycam.lua" type="client"/><br />
<br />
<file src="riot_shield.txd" /><br />
<file src="riot_shield.dff" /><br />
<file src="riot_shield.col" /><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 />
<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="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 />
</meta></syntaxhighlight><br />
<br />
<br />
<br />
==Elemente==<br />
===Was sind Elemente?===<br />
Ein Element in MTA kann alles sein. Sei es ein Spieler, ein Fahrzeug, ein Objekt, ein Marker, ein GUI-Element oder aber auch eine Ressource. Und das waren nicht mal alle möglichen Elementtypen.<br />
<br />
Im Script sind Elemente durch Userdata-Pointer vertreten. Man kann mit ihnen eigentlich nichts anderes machen, als sie speichern oder an MTA-Funktionen übergeben und sie haben auch keinen darstellbaren Wert.<br />
Wendet man tostring auf einen Userdata-Pointer an, so erhält man einen String in der Form "userdata: 0x090A34D". Die type-Funktion gibt "userdata" zurück, wenn man ihr ein Element übergibt.<br />
<br />
<br />
===Der Elementbaum===<br />
Den Elementbaum kann man sich wie einen Stammbaum vorstellen, nur dass der Ursprung bekannt ist.<br />
Der Ursprung des Elementbaumes ist die sogenannte root (engl. für Wurzel). Aus ihr entspringen alle Elemente des ganzen Servers.<br />
<br />
Bevor ich nun versuche, ein Bild zu beschreiben, wie man sich das vorstellen soll, zeige ich lieber ein Beispiel für einen MTA Elementbaum im XML-Format. Dieser ist jedoch an einigen Stellen stark vereinfacht, da er sonst den Rahmen sprengen würde, jedoch verschlechtert das die Verbildlichung nicht.<br />
<br />
<syntaxhighlight lang="xml"><root><br />
<console/><br />
<player dontRespawn="false"/><br />
<player dontRespawn="false" lastSpawnarea=""/><br />
<resource id="resourcebrowser"/><br />
<resource id="ajax"/><br />
<resource id="resourcemanager"/><br />
<resource id="spawnmanager"/><br />
<resource id="mapmanager"/><br />
<resource id="runcode"/><br />
<resource id="fr"><br />
<map id="dynamic"><br />
<vehicle/><br />
</map><br />
</resource><br />
<resource id="elementbrowser"/><br />
<resource id="assault"><br />
<map id="dynamic"><br />
<team/><br />
<team/><br />
<blip/><br />
<marker/><br />
<colshape/><br />
<blip/><br />
<blip/><br />
</map><br />
</resource><br />
<resource id="as-farm"><br />
<map id="dynamic"/><br />
<map id="as-farm.map"><br />
<meta><br />
<author/><br />
<version/><br />
<name/><br />
<description/><br />
</meta><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="-8.3976354598999" posX="20.182683944702" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="32.166355133057" posX="-46.90763092041" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="35.214984893799" posX="-33.486911773682" skins="9" ... /><br />
</spawngroup><br />
<spawngroup req="" type="attacker"><br />
<spawnarea posY="35.214984893799" posX="-33.486911773682" skins="9" ... /><br />
</spawngroup><br />
<objective id="first" type="checkpoint" description="Breach into the farm" ... /><br />
<pickup type="weapon" ... /><br />
</map><br />
</resource><br />
</root></syntaxhighlight><br />
<br />
Wie man in diesem Beispiel sehr schön sehen kann, sind alle Spieler, Ressourcen und die Konsole (das schwarze Serverfenster) direkte Kindelemente vom root-Element. Letzteres könnt ihr im Script übrigens mit [[getRootElement]] bekommen.<br />
Maps und Fahrzeuge wiederrum sind Kindelemente der jeweiligen Ressourcen und so weiter.<br />
<br />
<br />
===Elemente in MTA-Funktionen===<br />
Die meisten MTA-Funktionen verlangen ein oder mehrere Elemente als Parameter oder geben eines zurück. Wenn man ein Element übergibt, was Kindelemente enthält, z.B. das root-Element, dann wendet MTA die Funktion auf alle Kindelemente des übergebenen Elements an, die dem Elementtypen entsprechen, der von der Funktion erwartet wird.<br />
Der Typ eines Elements lässt sich mit [[getElementType]] herausfinden.<br />
<br />
<br />
<br />
==Events==<br />
===Beschreibung===<br />
Ein Event ist ein Ereignis. Das kann z.B. der Tod eines Spielers sein, aber auch das Beenden einer Ressource oder das Klicken auf einen Button.<br />
<br />
Ein Eventhandler ist eine Funktion, in unserem Fall eine Lua-Funktion, die aufgerufen wird, wenn ein bestimmtes Event stattfindet. Generell ist alles in MTA eventgesteuert und was nicht eventgesteuert ist, ist zeitgesteuert.<br />
<br />
Mit der Funktion [[addEventHandler]] kann man in MTA eine Eventhandlerfunktion hinzufügen. Im Wiki finden sich Listen mit vorhandenen [[Server_Scripting_Events|serverseitigen Events]] und auch [[Client_Scripting_Events|clientseitigen Events]].<br />
<br />
Wenn ein Event eintritt, dann werden alle dazugehörigen Eventhandlerfunktionen in einer Umgebung aufgerufen, die die Variable source definiert als den Pointer zu dem Element, welches das Event hervorgerufen hat.<br />
Das heißt im Klartext, dass in jeder Eventhandlerfunktion die Variable source das Element enthält, was das Ereignis herbeigeführt hat.<br />
<br />
Die Variablen root und resourceRoot sind in jeder Ressource vordefiniert, wobei root dem Rückgabewert von [[getRootElement]] und resourceRoot dem von [[getResourceRootElement]] entsprechen.<br />
<br />
===Serverseitiges Beispiel===<br />
<syntaxhighlight lang="lua">local gSpawnPosition = { 0, 0, 3 } -- Spawnposition<br />
<br />
function onPlayerJoin()<br />
spawnPlayer(source, unpack(gSpawnPosition)) -- spawne den Spieler<br />
setCameraTarget(source) -- setze das Ziel seiner Kamera auf sich selbst<br />
fadeCamera(source, true) -- blende die Umgebung ein<br />
<br />
outputChatBox(getPlayerNametagText(source).." hat den Server betreten.") -- sende Nachricht an alle Spieler<br />
end<br />
<br />
function onPlayerQuit(quitType)<br />
outputChatBox(getPlayerNametagText(source).." hat den Server verlassen. (Grund: "..quitType..")") -- sende Nachricht an alle Spieler<br />
end<br />
<br />
function onPlayerWasted()<br />
spawnPlayer(source, getElementPosition(source)) -- respawne den Spieler<br />
end<br />
<br />
function onResourceStart()<br />
for _, player in next, getElementsByType("player") do -- für jedes Spielerelement...<br />
spawnPlayer(player, unpack(gSpawnPosition)) -- ...spawne den Spieler<br />
fadeCamera(player, true) -- ...blende die Umgebung ein<br />
end<br />
end<br />
<br />
function onResourceStop()<br />
for _, player in next, getElementsByType("player") do-- für jedes Spielerelement...<br />
fadeCamera(player, false) -- ...blende die Umgebung aus<br />
end<br />
end<br />
<br />
-- füge die Eventhandler hinzu<br />
addEventHandler("onPlayerJoin", root, onPlayerJoin)<br />
addEventHandler("onPlayerQuit", root, onPlayerQuit)<br />
addEventHandler("onPlayerWasted", root, onPlayerWasted)<br />
addEventHandler("onResourceStart", resourceRoot, onResourceStart)<br />
addEventHandler("onResourceStop", resourceRoot, onResourceStop)</syntaxhighlight><br />
Man sollte immer bedenken, dass Spielerelemente auf dem gleichen Level sind wie Ressourcenelemente, d.h., dass Spieler auch ohne dass Ressourcen laufen auf dem Server sein können, also auch schon, wenn eine Ressource startet.<br />
<br />
<br />
<br />
==Commands==<br />
===Beschreibung===<br />
Commands sind Befehle, die der Spieler beginnend mit einem Schrägstrich (/) im Chat benutzen kann, um bestimmte Funktionen auszuführen.<br />
Aufgrund der großen Bandbreite von alternativen Eingabemethoden wie Klicken auf Elemente in der Spielwelt oder GUI-Elemente zählen Commands eher zu den veralteten und unbequemen Eingabemethoden.<br />
<br />
Der Ablauf ist ganz einfach: Der Spieler gibt einen Command ein, eventuell mit einem oder mehreren Parametern und MTA ruft eine Lua Funktion auf, der das Element des Spielers, der eingegebene Command sowie die übergebenen Parameter übermittelt werden.<br />
Bei der Eingabe werden die Parameter einfach durch Leerzeichen getrennt. Beispiel: /command param1 param2 param3<br />
<br />
Commandhandlerfunktionen werden in MTA mit der Funktion [[addCommandHandler]] hinzugefügt. Dazu nun einfach mal ein Beispiel für ein einfaches PM-System.<br />
<br />
<br />
===Serverseitiges Beispiel===<br />
<syntaxhighlight lang="lua">function cmdPrivateMessage(source, cmd, targetname, ...)<br />
--[[ da auch die eigentliche Nachricht an den Leerzeichen gespalten und als einzelne Parameter übergeben wird,<br />
muss man mit dem ...-Parameter eine nicht festgelegte Anzahl Parameter (jeder in diesem Fall ein Wort)<br />
entgegennehmen und diese wieder zusammenfügen ]]<br />
local message = table.concat({...}, " ")<br />
<br />
if (message == "") then -- wenn die Nachricht leer ist, wenn also kein Spielername und/oder keine Nachricht übergeben wurde<br />
outputChatBox("Syntax: /pm [str:Spielername] [str:Nachricht]", source, 240, 0, 0) -- Ausgabe der korrekten Syntax<br />
return -- Abbruch der Funktion<br />
end<br />
<br />
local target = getPlayerFromNick(targetname) -- suche nach einem Spielerelement mit dem gegebenen Namen<br />
if (not target) then -- wenn kein Spielerelement gefunden wurde<br />
outputChatBox(targetname.." existiert nicht oder ist offline.", source, 240, 0 , 0) -- Ausgabe einer Fehlermeldung<br />
return -- Abbruch der Funktion<br />
end<br />
<br />
-- ab hier ist gewährleistet, dass alle benötigten Daten vorhanden und gültig sind<br />
outputChatBox("PM an "..targetname..": "..message, source, 200, 60, 0) -- Ausgabe einer Nachricht an den Sender<br />
outputChatBox("PM von "..getPlayerNametagText(source)..": "..message, target, 240, 100, 0) -- Ausgabe einer Nachricht an den Empfänger<br />
end<br />
<br />
-- Hinzufügen des Commandhandlers<br />
addCommandHandler("pm", cmdPrivateMessage, false, false)</syntaxhighlight><br />
Commandparameter werden immer als strings übergeben.</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=FileCreate&diff=54090FileCreate2018-03-01T13:45:17Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
<br />
Creates a new file in a directory of a resource. If there already exists a file with the specified name, it is overwritten with an empty file.<br />
{{Note|To prevent memory leaks, ensure each successful call to [[fileCreate]] has a matching call to [[fileClose]]}}<br />
{{Note|The file functions should not be used to implement configuration files. It is encouraged to use the XML functions for this instead.}}<br />
{{Tip|If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [[filepath]] for more information)}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
file fileCreate ( string filePath )<br />
</syntaxhighlight><br />
{{OOP|This function is a static function underneath the File class.|[[File]].new}}<br />
<br />
{{New feature/item|9.0156|1.5.6|11865|<br />
{{OOP|This is a static function underneath the File class. Using '''File(...)''' to open a file will attempt to create the file, if it doesn't exist|[[File]].new}}<br />
}}<br />
<br />
===Required Arguments===<br />
*'''filePath:''' The [[filepath]] of the file to be created in the following format: '''":resourceName/path"'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.<br />
:For example, if you want to create a file named 'myfile.txt' in the resource 'mapcreator', it can be created from another resource this way: ''fileCreate(":mapcreator/myfile.txt")''.<br />
:If the file is in the current resource, only the file path is necessary, e.g. ''fileCreate("myfile.txt")''.<br />
<br />
===Returns===<br />
If successful, returns a file handle which can be used with other file functions ([[fileWrite]], [[fileClose]]...). Returns ''false'' if an error occured.<br />
<br />
==Example==<br />
This example creates a text file in the current resource and writes a string to it.<br />
<syntaxhighlight lang="lua"><br />
local newFile = fileCreate("test.txt") -- attempt to create a new file<br />
if (newFile) then -- check if the creation succeeded<br />
fileWrite(newFile, "This is a test file!") -- write a text line<br />
fileClose(newFile) -- close the file once you're done with it<br />
end<br />
</syntaxhighlight><br />
<br />
Notice that you can't simply do ''fileWrite("test.txt", "File content")''. Instead, file functions operate on a '''file handle''', which is a special object representing an open file. ''fileCreate'' creates a file, opens it, and returns the resulting handle.<br />
<br />
It is also important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.<br />
If the file already exists, a new file will be created on local.<br />
<br />
==See Also==<br />
{{File functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=FileOpen&diff=54089FileOpen2018-03-01T13:32:21Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
Opens an existing file for reading and writing.<br />
{{Note|To prevent memory leaks, ensure each successful call to [[fileOpen]] has a matching call to [[fileClose]].}}<br />
{{Tip|The file functions should not be used to implement configuration files. It is encouraged to use the XML functions for this instead.}}<br />
{{MessageBox|bordercolorhex=FFB2B2|bgcolorhex=FFE5E5|image=File:Dialog-warning.png|title=Warning:|message=As of 1.5.4 [https://buildinfo.mtasa.com/?Author=&Branch=&Revision=10413 r10413], this function will fail when trying to access a script file of another resource, even with ''general.ModifyOtherObjects'' rights granted, which uses a ''mysql'' connection through [[dbConnect]] when [[Server_mtaserver.conf#database_credentials_protection|''database_credentials_protection'']] is enabled in the server configuration. Additionally, meta.xml will be un-writable and will always open in read-only mode.}} <!-- The {Warning} template didn't want to work with an external link to buildinfo, so I had to use the {MessageBox} template --><br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
file fileOpen ( string filePath [, bool readOnly = false ])<br />
</syntaxhighlight><br />
{{OOP|The function will only attempt to open the file, it won't create it.|[[File]]}}<br />
<br />
{{New feature/item|9.0156|1.5.6|11865|<br />
{{OOP|This is a static function underneath the File class. Using '''File(...)''' to open a file will attempt to create the file, if it doesn't exist|[[File]].open}}<br />
}}<br />
<br />
===Required Arguments===<br />
*'''filePath:''' The [[filepath]] of the file in the following format: '''":resourceName/path"'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.<br />
:For example, if there is a file named 'coolObjects.txt' in the resource 'objectSearch', it can be opened from another resource this way: ''fileOpen(":objectSearch/coolObjects.txt")''.<br />
:If the file is in the current resource, only the file path is necessary, e.g. ''fileOpen("coolObjects.txt")''.<br />
<br />
===Optional Arguments===<br />
*'''readOnly:''' By default, the file is opened with reading and writing access. You can specify ''true'' for this parameter if you only need reading access.<br />
<br />
===Returns===<br />
If successful, returns a file handle for the file. Otherwise returns ''false'' (f.e. if the file doesn't exist).<br />
<br />
==Example==<br />
This example opens the file test.txt that is in the root of the current resource, and outputs its contents to the console.<br />
<syntaxhighlight lang="lua"><br />
local hFile = fileOpen("test.txt", true) -- attempt to open the file (read only)<br />
if hFile then -- check if it was successfully opened<br />
local buffer<br />
while not fileIsEOF(hFile) do -- as long as we're not at the end of the file...<br />
buffer = fileRead(hFile, 500) -- ... read the next 500 bytes...<br />
outputConsole(buffer) -- ... and output them to the console<br />
end<br />
fileClose(hFile) -- close the file once we're done with it<br />
else<br />
outputConsole("Unable to open test.txt")<br />
end<br />
</syntaxhighlight><br />
<br />
This example show how to append data to an existing file:<br />
<syntaxhighlight lang="lua"><br />
local hFile = fileOpen("test.txt") -- attempt to open the file (read and write mode)<br />
if hFile then -- check if it was successfully opened<br />
fileSetPos( hFile, fileGetSize( hFile ) ) -- move position to the end of the file<br />
fileWrite(hFile, "hello" ) -- append data<br />
fileFlush(hFile) -- Flush the appended data into the file.<br />
fileClose(hFile) -- close the file once we're done with it<br />
else<br />
outputConsole("Unable to open test.txt")<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{File functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GetObjectScale&diff=54087GetObjectScale2018-02-26T14:16:32Z<p>Necktrox: Function actually returns 3 floats for x, y, z</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function returns the visible size of an object.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
float, float, float getObjectScale ( object theObject )<br />
</syntaxhighlight><br />
{{OOP||[[object]]:getScale|scale|setObjectScale}}<br />
===Required Arguments===<br />
*'''theObject''': the [[object]] you wish to return the scale of.<br />
<br />
===Returns===<br />
* Three [[float]] values indicating the scale of the object on the x, y, and z axis, if successful.<br />
* ''false'' otherwise.<br />
<br />
==Example==<br />
<section name="Client" class="client" show="true"><br />
This example adds a command ''get_scale'' which create object and prints out a scale of the object.<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler( 'get_scale',<br />
function( )<br />
local uObject = createObject( 1337, getElementPosition( localPlayer ) )<br />
outputChatBox( string.format( 'Object scale is %s !', getObjectScale( uObject ) ) )<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Object_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetObjectScale&diff=54086SetObjectScale2018-02-26T14:14:45Z<p>Necktrox: Added default parameter values</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
This function changes the visible size of an object.<br />
{{Note|setObjectScale '''does not''' affect the collision models for the object, as such is unsuitable for use for interaction with players, vehicles or other objects.}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setObjectScale ( object theObject, float scale [, float scaleY = scale, float scaleZ = scale ] )<br />
</syntaxhighlight><br />
{{OOP||[[object]]:setScale|scale|getObjectScale}}<br />
===Required Arguments===<br />
*'''theObject''': the [[object]] you wish to change the scale of.<br />
*'''scale''': a float containing the new scale. 1.0 is the standard scale, with 0.5 being half the size and 2.0 being twice the size. If the scaleY is set, this will be scaleX.<br />
<br />
===Optional Arguments===<br />
*'''scaleY''': a float containing the new scale on the Y axis<br />
*'''scaleZ''': a float containing the new scale on the Z axis<br />
<br />
===Returns===<br />
* ''true'' if the scale was set properly.<br />
* ''false'' otherwise.<br />
<br />
==Example==<br />
This example creates an antenna, and changes the size of it.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
-- get the position of the player<br />
local x, y, z = getElementPosition(getLocalPlayer())<br />
-- create the object<br />
antenna = createObject (1595, x + 2, y, z )<br />
if ( antenna ) then -- if it was created<br />
-- set the scale to half the normal scale<br />
setObjectScale ( antenna, 0.5)<br />
-- remove the collision<br />
setElementCollisionsEnabled (antenna, false)<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Client_object_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetPlayerSkin&diff=54083SetPlayerSkin2018-02-24T20:21:09Z<p>Necktrox: Reverted edits by XSrJulianProHG (talk) to last revision by Arran Fortuna</p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
{{Deprecated}}<br />
<br />
Please use [[setElementModel]]<br />
<br />
This function changes the skin of a player.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool setPlayerSkin ( player thePlayer, int skinID )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''thePlayer:''' The [[player]] whose model will be changed.<br />
*'''skinID:''' A GTASA player model (skin) ID. See [[Character Skins]].<br />
<br />
==Example== <br />
This example sets you a police skin when you type the command /law.<br />
<syntaxhighlight lang="lua"> <br />
function enterTheLaw(playerSource)<br />
if (getPlayerSkin(playerSource) == 280) then<br />
outputChatBox("You are already in the law!", playerSource)<br />
else<br />
setPlayerSkin(playerSource, 280)<br />
outputChatBox("Welcome to the law, protect the innocents.", playerSource)<br />
end<br />
end<br />
<br />
addCommandHandler("law", enterTheLaw)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Player functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&diff=54025SetWorldSoundEnabled2018-02-21T16:29:29Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New items|3.0131|1.3.1|<br />
This function allows you to disable world sounds. A world sound is a sound effect which has '''''not''''' been caused by [[playSound]] or [[playSound3D]].<br />
<br />
{{Note|The values for ''group'' and ''index'' can be determined by using the client command [[Client_Commands#showsound|showsound]] in conjunction with [[setDevelopmentMode]]}}<br />
<br />
{{Note|Note: This function does not affect sounds which are already playing, such as the wind sound that can only be stopped by entering an interior.}}<br />
}}<br />
<br />
{{Note box|See Also: [[setAmbientSoundEnabled]]}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable [, bool immediate = false ] )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''group :''' An integer representing the [[World sound groups|world sound group]]<br />
*'''enable :''' Set ''false'' to disable, ''true'' to enable<br />
<br />
===OptionalArguments=== <br />
*'''index :''' An integer representing an individual sound within the group<br />
{{New feature/item|9.0156|1.5.6|11860|<br />
*'''immediate:''' Boolean if set to true will cancel the sound if it's already playing. This parameter only works for stopping the sound.<br />
}}<br />
<br />
===Returns===<br />
Returns ''true'' if the world sound was correctly enabled/disabled, ''false'' if invalid values were passed.<br />
<br />
==Example== <br />
This is a simplified example that lets the client toggle their weapon sounds.<br />
<syntaxhighlight lang="lua"><br />
function toggleWeaponSounds_f ( )<br />
local enabled = isWorldSoundEnabled ( 5 ) -- We place this variable here for checking.<br />
enabled = not enabled -- And here we invert (toggle) the variable, so if it's false, it becomes true, if it's true, it becomes false.<br />
-- Used for the chat declaration:<br />
local state = "enabled"<br />
<br />
if ( not enabled ) then<br />
state = "disabled"<br />
end<br />
--<br />
<br />
setWorldSoundEnabled ( 5, enabled ) -- And here the toggling happens.<br />
outputChatBox ( "Weapon sounds " .. state )<br />
end<br />
addCommandHandler ( "toggleweaponsounds", toggleWeaponSounds_f )<br />
</syntaxhighlight><br />
<br />
{{New feature/item|9.0156|1.5.6|11860|<br />
This example disables the wind sound effect immediately without changing the interior afterwards.<br />
<syntaxhighlight lang="lua"><br />
setWorldSoundEnabled(0, 0, false, true)<br />
setWorldSoundEnabled(0, 29, false, true)<br />
setWorldSoundEnabled(0, 30, false, true)<br />
</syntaxhighlight><br />
}}<br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.3.0-9.04134|}}<br />
<br />
==See Also==<br />
{{Client world functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=IsPedReloadingWeapon&diff=53989IsPedReloadingWeapon2018-02-20T12:07:51Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New items|3.0160|1.6|<br />
This function is used to determine whether or not a ped is currently reloading their weapon. Useful to stop certain quick reload exploits.<br />
|11856}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool isPedReloadingWeapon ( ped thePed )<br />
</syntaxhighlight><br />
{{OOP||[[ped]]:isReloadingWeapon|reloadingWeapon}}<br />
<br />
===Required Arguments===<br />
*'''thePed:''' The [[ped]] you are checking.<br />
<br />
===Returns===<br />
Returns ''true'' if the ped is currently reloading a weapon, ''false'' otherwise.<br />
<br />
==Example==<br />
<section name="Client" class="client" show="true"><br />
This example checks if the player who enters the 'amireloading' command is reloading and outputs a message.<br />
<syntaxhighlight lang="lua"><br />
function isHeReloading()<br />
if isPedReloadingWeapon ( localPlayer) then<br />
outputChatBox ( "No, you're not reloading a weapon" )<br />
else<br />
outputChatBox ( "You are reloading a weapon" )<br />
end<br />
end<br />
addCommandHandler ( "amireloading", isHeReloading)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Ped_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=AddDebugHook&diff=53986AddDebugHook2018-02-19T09:44:16Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature/item|3.0136|1.3|5939|<br />
This function allows tracing of MTA functions and events. It should only be used when debugging scripts as it may degrade script performance.<br />
<br />
Debug hooks are not recursive, so functions and events triggered inside the hook callback will not be traced.<br />
}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool addDebugHook( string hookType, function callbackFunction[, table nameList ] )<br />
</syntaxhighlight><br />
<br />
===Required Arguments=== <br />
*'''hookType:''' The type of hook to add. This can be:<br />
** preEvent<br />
** postEvent<br />
** preFunction<br />
** postFunction<br />
{{New feature/item|9.0160|1.6|11856|<br />
* preEventFunction<br />
* postEventFunction<br />
}}<br />
*'''callbackFunction :''' The function to call<br />
{{New feature/item|9.0152|1.5.2|7967|<br />
* Returning the string "skip" from the callback function will cause the original function/event to be skipped<br />
}}<br />
<br />
===Optional Arguments=== <br />
*'''nameList:''' Table of strings for restricting which functions and events the hook will be triggered on<br />
{{New feature/item|9.0152|1.5.2|7967|<br />
* addDebugHook and removeDebugHook will only be hooked if they are specified in the name list<br />
}}<br />
<br />
===Returns===<br />
Returns ''true'' if the hook was successfully added, or ''false'' otherwise.<br />
<br />
==Callback parameters==<br />
<syntaxhighlight lang="lua"><br />
string preFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, ...functionArguments )<br />
postFunction( resource sourceResource, string functionName, bool isAllowedByACL, string luaFilename, int luaLineNumber, ...functionArguments )<br />
string preEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, ...eventArguments )<br />
postEvent( resource sourceResource, string eventName, element eventSource, element eventClient, string luaFilename, int luaLineNumber, ...eventArguments )<br />
</syntaxhighlight><br />
{{New feature/item|3.0160|1.6|11856|<br />
<syntaxhighlight lang="lua"><br />
string preEventFunction ( resource eventResource, string eventName, element eventSource, element eventClient, string eventFilename, int eventLineNumber, resource functionResource, string functionFilename, int functionLineNumber, ...eventArgs )<br />
postEventFunction ( resource eventResource, string eventName, element eventSource, element eventClient, string eventFilename, int eventLineNumber, resource functionResource, string functionFilename, int functionLineNumber, ...eventArgs )<br />
</syntaxhighlight><br />
}}<br />
<br />
==Example==<br />
This example will dump info about all triggered events:<br />
<syntaxhighlight lang="lua"><br />
function onPreEvent( sourceResource, eventName, eventSource, eventClient, luaFilename, luaLineNumber, ... )<br />
local args = { ... }<br />
local srctype = eventSource and getElementType(eventSource)<br />
local resname = sourceResource and getResourceName(sourceResource)<br />
local plrname = eventClient and getPlayerName(eventClient)<br />
outputDebugString( "preEvent"<br />
.. " " .. tostring(resname)<br />
.. " " .. tostring(eventName)<br />
.. " source:" .. tostring(srctype)<br />
.. " player:" .. tostring(plrname)<br />
.. " file:" .. tostring(luaFilename)<br />
.. "(" .. tostring(luaLineNumber) .. ")"<br />
.. " numArgs:" .. tostring(#args)<br />
.. " arg1:" .. tostring(args[1])<br />
)<br />
end<br />
addDebugHook( "preEvent", onPreEvent )<br />
</syntaxhighlight><br />
This example will dump info about all called MTA functions:<br />
<syntaxhighlight lang="lua"><br />
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )<br />
local args = { ... }<br />
local resname = sourceResource and getResourceName(sourceResource)<br />
outputDebugString( "preFunction"<br />
.. " " .. tostring(resname)<br />
.. " " .. tostring(functionName)<br />
.. " allowed:" .. tostring(isAllowedByACL)<br />
.. " file:" .. tostring(luaFilename)<br />
.. "(" .. tostring(luaLineNumber) .. ")"<br />
.. " numArgs:" .. tostring(#args)<br />
.. " arg1:" .. tostring(args[1])<br />
)<br />
end<br />
addDebugHook( "preFunction", onPreFunction)<br />
</syntaxhighlight><br />
<br />
This example adds a hook which will only be triggered for the named functions<br />
<syntaxhighlight lang="lua"><br />
addDebugHook( "preFunction", onPreFunction, {"setElementPosition","loadstring"} )<br />
</syntaxhighlight><br />
<br />
<br />
{{New feature/item|9.0152|1.5.2|7967|<br />
This example shows how to disable addDebugHook<br />
<syntaxhighlight lang="lua"><br />
addDebugHook( "preFunction", onPreFunction, {"addDebugHook"} )<br />
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )<br />
return "skip"<br />
end<br />
</syntaxhighlight><br />
}}<br />
==Changelog==<br />
{{ChangelogHeader}}<br />
{{ChangelogItem|1.3.5-9.06054|Added clientside}}<br />
{{ChangelogItem|1.3.5-9.06142|Added option to restrict to specified functions and events }}<br />
{{ChangelogItem|1.5.2-9.07957|Added option to skip original function/event <br/>Added ability to hook addDebugHook and removeDebugHook }}<br />
{{ChangelogItem|1.5.5-9.11856|Added pre/postEventFunction hooks }}<br />
==Requirements==<br />
{{Requirements|1.3.4-9.05939|1.3.5-9.06054}}<br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Server_Commands&diff=53978Server Commands2018-02-18T13:56:13Z<p>Necktrox: </p>
<hr />
<div>This page lists all built in commands that the server can process. All these commands can be entered via the server console or the client console depending upon permissions unless otherwise stated.<br />
<br />
<br />
==Resource commands==<br />
====check====<br />
:<ins>Server console only</ins><br />
:Usage: check [ ''all'' | ''<resource-name>'' ]<br><br />
:Checks which files would be changed with [[Server_Commands#upgrade|upgrade]] command. Does not modify anything.<br />
====info====<br />
:<ins>Server console only</ins><br />
:Usage: info ''<resource-name>''<br><br />
:Get info for a resource eg: info admin<br />
====list====<br />
:<ins>Server console only</ins><br />
:Shows a list of resources<br />
<br />
====refresh====<br />
:Refresh resource list to find new resources<br />
====refreshall====<br />
:Refresh resources and restart any changed resources<br />
====restart====<br />
:Usage: info ''<resource-name>''<br><br />
:Restarts a running resource eg: restart admin<br />
====start====<br />
:Usage: start ''<resource-name>''<br><br />
:Start a loaded resource eg: start admin<br />
====stop====<br />
:Usage: stop ''<resource-name>''<br><br />
:Stop a resource eg: stop admin<br />
====stopall====<br />
:Stop all running resources<br />
====upgrade====<br />
:<ins>Server console only</ins><br />
:Usage: upgrade [ ''all'' | ''<resource-name>'' ]<br><br />
:Perform a basic upgrade of all resources. The [[Server_Commands#check|check]] command shows the list of changes this command will make.<br />
<br />
====aclrequest====<br />
:Usage: aclrequest [ ''list'' | ''allow'' | ''deny'' ] ''<resource-name>'' [ ''<right>'' | ''all'' ]<br><br />
:Manage ACL requests from resources implementing <aclrequest> in their [[meta.xml]]<br />
<br />
====reloadacl====<br />
:Perform a simple ACL reload.<br />
<br />
==Account commands==<br />
====aexec====<br />
:Usage: aexec ''<nick>'' ''<command>''<br><br />
:Force a player to execute a command eg: aexec playername say hello<br />
<br />
====addaccount====<br />
:Usage: addaccount ''<accountname>'' ''<password>''<br><br />
:Add an account eg: addaccount accountname password<br />
<br />
====chgpass====<br />
:Usage: chgpass ''<accountname>'' ''<password>''<br><br />
:Change an accounts password eg: chgpass account newpw<br />
====delaccount====<br />
:Usage: delaccount ''<accountname>''<br><br />
:Delete an account eg: delaccount accountname<br />
<br />
<br />
==Server commands==<br />
====ase====<br />
:<ins>Server console only</ins><br />
:See the amount of master server list queries<br />
====debugdb====<br />
:Usage: debugdb ''<''0-2''>''<br><br />
:<ins>Server console only</ins><br />
:Set logging level for database functions. [0-Off &nbsp;1-Errors only &nbsp;2-All]<br />
:By default, logging output is written to the file '''logs/db.log''' unless another file is declared in the [[Mtaserver.conf#dbfile|<dbfile> section of mtaserver.conf]]<br />
====help====<br />
:<ins>Server console only</ins><br />
:Displays these list of commands<br />
====loadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: loadmodule ''<module-filename>''<br><br />
:Load a module eg: loadmodule ml_sockets.dll<br />
====unloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: unloadmodule ''<module-filename>''<br><br />
:Unload a module eg: unloadmodule ml_sockets.dll<br />
====reloadmodule====<br />
:<ins>Server console only</ins><br />
:Usage: reloadmodule ''<module-filename>''<br><br />
:Reload a module eg: reloadmodule ml_sockets.dll<br />
====openports====<br />
:<ins>Server console only</ins><br />
:Test if server ports are open<br />
====sfakelag====<br />
{{Main|Command fakelag}}<br />
:Usage: sfakelag ''<packet loss>'' ''<extra ping>'' ''<ping variance>'' [''<KBPS limit>'']<br />
:'''Only available if enabled in the [[mtaserver.conf]] file.'''<br />
:Adds artificial packet loss, ping, jitter and bandwidth limits to the server-client connections.<br />
====shutdown====<br />
:Usage: shutdown ''<reason>''<br><br />
:Shutdown the server eg: shutdown put reason here<br />
====sver====<br />
:Get the server MTA version<br />
<br />
<br />
==Other commands==<br />
====say====<br />
:Usage: say ''<text>''<br><br />
:Show a message to all players on the server eg: say hello<br />
====whois====<br />
:Usage: whois ''<nick>''<br><br />
:Get the IP of a player currently connected (use whowas for IP/serial/version)<br />
====whowas====<br />
:Usage: whowas ''<nick>''<br><br />
:Get IP/Serial/username of a player that was previously connected to the server<br />
====ver====<br />
:Get the MTA version<br />
<br />
<br />
==Client relevant only==<br />
====chgmypass====<br />
:<ins>Client only</ins><br />
:Usage: chgmypass ''<oldpass>'' ''<newpass>''<br><br />
:Change your password eg: chgmypass oldpw newpw<br />
====debugscript====<br />
:<ins>Client only</ins><br />
:Usage: debugscript ''<''0-3''>''<br><br />
:Remove (This does not work "Incorrect client type for this command")<br />
====login====<br />
:<ins>Client only</ins><br />
:Usage: login ''<accountname>'' ''<password>''<br><br />
:Login to an account eg: login accountname password<br />
<br />
====logout====<br />
:<ins>Client only</ins><br />
:Log out of the current account<br />
====me====<br />
:<ins>Client only</ins><br />
:Usage: me ''<text>''<br><br />
:Show a message to all players on the server, with your nick prepended<br />
====msg====<br />
:<ins>Client only</ins><br />
:Usage: msg ''<nick>'' ''<text>''<br><br />
:Send a message to a player eg: msg playername hello<br />
====nick====<br />
:<ins>Client only</ins><br />
:Usage: nick ''<old-nick>'' ''<new-nick>''<br><br />
:Change your ingame nickname<br />
====teamsay====<br />
:<ins>Client only</ins><br />
:Usage: teamsay ''<test>''<br><br />
:Send a message to all players on the same team<br />
<br />
[[Category: Support]]<br />
[[ru:Server Commands]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Template:Client_vehicle_functions&diff=53977Template:Client vehicle functions2018-02-18T13:52:42Z<p>Necktrox: </p>
<hr />
<div>*[[addVehicleUpgrade]]<br />
*[[attachTrailerToVehicle]]<br />
*[[blowVehicle]]<br />
*[[createVehicle]]<br />
*[[detachTrailerFromVehicle]]<br />
*[[fixVehicle]]<br />
*[[getHeliBladeCollisionsEnabled]]<br />
*[[getHelicopterRotorSpeed]]<br />
*[[getOriginalHandling]]<br />
*[[getTrainDirection]]<br />
*[[getTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[getTrainTrack]]<br />
|7485}}<br />
{{New items|3.0153|1.5.3|<br />
*[[getTrainPosition]]<br />
|7485}}<br />
*[[getVehicleAdjustableProperty]]<br />
*[[getVehicleColor]]<br />
*[[getVehicleCompatibleUpgrades]]<br />
*[[getVehicleComponents]]<br />
*[[getVehicleComponentPosition]]<br />
*[[getVehicleComponentRotation]]<br />
*[[getVehicleComponentVisible]]<br />
*[[getVehicleController]]<br />
*[[getVehicleDoorOpenRatio]]<br />
*[[getVehicleDoorState]]<br />
*[[getVehicleEngineState]]<br />
*[[getVehicleGravity]]<br />
*[[getVehicleHandling]]<br />
*[[getVehicleHeadLightColor]]<br />
*[[getVehicleLandingGearDown]]<br />
*[[getVehicleLightState]]<br />
*[[getVehicleMaxPassengers]]<br />
*[[getVehicleModelExhaustFumesPosition]]<br />
*[[getVehicleModelFromName]]<br />
*[[getVehicleName]]<br />
*[[getVehicleNameFromModel]]<br />
*[[getVehicleNitroCount]]<br />
*[[getVehicleNitroLevel]]<br />
*[[getVehicleOccupant]]<br />
*[[getVehicleOccupants]]<br />
*[[getVehicleCurrentGear]]<br />
*[[getVehicleOverrideLights]]<br />
*[[getVehiclePaintjob]]<br />
*[[getVehiclePanelState]]<br />
*[[getVehiclePlateText]]<br />
*[[getVehicleSirens]]<br />
*[[getVehicleSirensOn]]<br />
*[[getVehicleSirenParams]]<br />
*[[getVehicleTowedByVehicle]]<br />
*[[getVehicleTowingVehicle]]<br />
*[[getVehicleTurnVelocity]]<br />
*[[getVehicleTurretPosition]]<br />
*[[getVehicleType]]<br />
*[[getVehicleUpgradeOnSlot]]<br />
*[[getVehicleUpgrades]]<br />
*[[getVehicleUpgradeSlotName]]<br />
*[[getVehicleVariant]]<br />
*[[getVehicleWheelStates]]<br />
*[[isTrainChainEngine]]<br />
*[[isTrainDerailable]]<br />
*[[isTrainDerailed]]<br />
*[[isVehicleBlown]]<br />
*[[isVehicleDamageProof]]<br />
*[[isVehicleFuelTankExplodable]]<br />
*[[isVehicleLocked]]<br />
*[[isVehicleNitroRecharging]]<br />
*[[isVehicleNitroActivated]]<br />
*[[isVehicleOnGround]]<br />
*[[isVehicleTaxiLightOn]]<br />
{{New items|3.0160|1.6|<br />
*[[isVehicleWheelCollided]]<br />
|11854}}<br />
{{New items|3.0153|1.5.3|<br />
*[[isVehicleWindowOpen]]<br />
|7405}}<br />
*[[removeVehicleUpgrade]]<br />
*[[resetVehicleComponentPosition]]<br />
*[[resetVehicleComponentRotation]]<br />
*[[setHeliBladeCollisionsEnabled]]<br />
*[[setHelicopterRotorSpeed]]<br />
*[[setVehicleAdjustableProperty]]<br />
*[[setVehicleColor]]<br />
*[[setVehicleComponentPosition]]<br />
*[[setVehicleComponentRotation]]<br />
*[[setVehicleComponentVisible]]<br />
*[[setVehicleDamageProof]]<br />
*[[setVehicleDirtLevel]]<br />
*[[setVehicleDoorOpenRatio]]<br />
*[[setVehicleDoorState]]<br />
*[[setVehicleDoorsUndamageable]]<br />
*[[setVehicleEngineState]]<br />
*[[setVehicleFuelTankExplodable]]<br />
*[[setVehicleGravity]]<br />
*[[setVehicleHeadLightColor]]<br />
*[[setVehicleLandingGearDown]]<br />
*[[setVehicleLightState]]<br />
*[[setVehicleLocked]]<br />
*[[setVehicleModelExhaustFumesPosition]]<br />
*[[setVehicleNitroActivated]]<br />
*[[setVehicleNitroCount]]<br />
*[[setVehicleNitroLevel]]<br />
*[[setVehicleOverrideLights]]<br />
*[[setVehiclePaintjob]]<br />
*[[setVehiclePanelState]]<br />
*[[setVehiclePlateText]]<br />
*[[setVehicleSirens]]<br />
*[[setVehicleSirensOn]]<br />
*[[setVehicleTurretPosition]]<br />
*[[setVehicleTaxiLightOn]]<br />
*[[setVehicleTurnVelocity]]<br />
*[[setVehicleWheelStates]]<br />
{{New items|3.0153|1.5.3|<br />
*[[setVehicleWindowOpen]]<br />
|7405}}<br />
*[[setTrainDerailable]]<br />
*[[setTrainDerailed]]<br />
*[[setTrainDirection]]<br />
*[[setTrainSpeed]]<br />
{{New items|3.0160|1.6|<br />
*[[setTrainTrack]]<br />
|7485}}<br />
{{New items|3.0153|1.5.3|<br />
*[[setTrainPosition]]<br />
|7485}}<br />
<noinclude>[[ru:Template:RU/Client_vehicle_functions]]<br />
[[Category:Functions templates]]</noinclude></div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=IsVehicleWheelOnGround&diff=53976IsVehicleWheelOnGround2018-02-18T13:50:37Z<p>Necktrox: Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.6.0|11854| This function returns a boolean whether the vehicle's wheel is on ground (true) or in air (false). }}..."</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0160|1.6.0|11854|<br />
This function returns a boolean whether the [[vehicle]]'s wheel is on ground (true) or in air (false).<br />
}}<br />
{{Note|In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - <code>"front_left"</code> and <code>"rear_left"</code>}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua">bool isVehicleWheelCollided ( vehicle theVehicle, string|number wheel )</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theVehicle''' The [[vehicle]], which you want to check.<br />
*'''wheel''' The wheel name or number, see list below:<br />
** <code>"front_left"</code> or 0<br />
** <code>"rear_left"</code> or 1<br />
** <code>"front_right"</code> or 2<br />
** <code>"rear_right"</code> or 3<br />
<br />
===Returns===<br />
Returns ''true'' if the vehicle wheel is on ground/collided, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==See Also==<br />
{{Client_vehicle_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Template:Utility_functions&diff=53975Template:Utility functions2018-02-18T13:33:58Z<p>Necktrox: </p>
<hr />
<div>{{New items|3.0160|1.6.0 r11849|<br />
* [[encodeString]]<br />
* [[decodeString]]<br />
}}<br />
{{New items|3.0153|1.5.3|<br />
*[[iprint]]<br />
*[[inspect]]<br />
|9768}}<br />
*[[getColorFromString]]<br />
*[[getDistanceBetweenPoints2D]]<br />
*[[getDistanceBetweenPoints3D]]<br />
*[[getEasingValue]]<br />
*[[interpolateBetween]]<br />
*[[getPerformanceStats]]<br />
*[[getNetworkStats]]<br />
*[[getNetworkUsageData]]<br />
*[[getServerConfigSetting]]<br />
*[[setServerConfigSetting]]<br />
*[[getRealTime]]<br />
*[[getTickCount]]<br />
*[[getTimerDetails]]<br />
*[[getTimers]]<br />
*[[gettok]]<br />
{{New items|3.0153|1.5.3|<br />
*[[getUserdataType]]<br />
|9768}}<br />
{{New items|3.0140|1.4 r6791|<br />
*[[hash]]<br />
}}<br />
*[[killTimer]]<br />
*[[resetTimer]]<br />
*[[setTimer]]<br />
*[[split]]<br />
{{New items|3.0141|1.4.1|<br />
*[[isOOPEnabled]]<br />
}}<br />
*[[isTimer]]<br />
*[[md5]]<br />
*[[sha256]]<br />
*[[teaEncode]]<br />
*[[teaDecode]]<br />
*[[base64Encode]]<br />
*[[base64Decode]]<br />
{{New items|3.0110|1.1|<br />
* [[utfChar]]<br />
* [[utfCode]]<br />
* [[utfLen]]<br />
* [[utfSeek]]<br />
* [[utfSub]]<br />
}}<br />
{{New items|3.0154|1.5.4 r11277|<br />
* [[passwordHash]]<br />
* [[passwordVerify]]<br />
}}<br />
{{New items|3.0135|1.3.5 r6056|<br />
* [[pregFind]]<br />
* [[pregReplace]]<br />
* [[pregMatch]]<br />
}}<br />
{{Bit_functions}}<br />
{{New items|3.0135|1.3.5 r6054|<br />
* [[addDebugHook]]<br />
* [[removeDebugHook]]<br />
}}<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=EncodeString&diff=53974EncodeString2018-02-18T13:30:55Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0160|1.6|11849|<br />
This function encodes a string using a specified algorithm.<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string|false encodeString ( string algorithm, string input, table options ) <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 neccessary data for the algorithm, as detailed below<br />
<br />
===Options for each algorithm===<br />
* ''tea'':<br />
** ''key'' (string) A key to tea-encode the input with<br />
<br />
===Returns===<br />
Returns the encoded string if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=DecodeString&diff=53973DecodeString2018-02-18T13:30:42Z<p>Necktrox: decodeString</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0160|1.6|11849|<br />
This function decodes a data string using a specified algorithm.<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string|false decodeString ( string algorithm, string input, table options ) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''algorithm:''' The algorithm to use.<br />
*'''input:''' The input to decode.<br />
*'''options :''' A table with options and other neccessary data for the algorithm, as detailed below<br />
<br />
===Options for each algorithm===<br />
* ''tea'':<br />
** ''key'' (string) A key to tea-decode the input with<br />
<br />
===Returns===<br />
Returns the decoded string if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=EncodeString&diff=53972EncodeString2018-02-18T13:29:35Z<p>Necktrox: encodeString</p>
<hr />
<div>__NOTOC__<br />
{{Shared function}}<br />
{{New feature/item|3.0160|1.6|11849|<br />
This function encodes a string using a specified algorithm.<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
string|false encodeString ( string algorithm, string input, table options ) <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 neccessary data for the algorithm, as detailed below<br />
<br />
===Options for each algorithm===<br />
* ''tea'':<br />
** ''key'' (string) A key to tea-encode the input with<br />
<br />
===Returns===<br />
Returns the encoded string if hashing was successful, ''false'' otherwise.<br />
<br />
==Example==<br />
{{Needs Example}}<br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=OnClientChatMessage&diff=53971OnClientChatMessage2018-02-18T13:14:41Z<p>Necktrox: </p>
<hr />
<div>{{Client event}}<br />
__NOTOC__ <br />
This event is triggered when any text is output to chatbox, including MTA's hardcoded messages.<br />
<br />
==Parameters== <br />
<syntaxhighlight lang="lua"><br />
string text, int r, int g, int b<br />
</syntaxhighlight><br />
*'''text:''' The text that was output to chatbox<br />
*'''r:''' The amount of red in the color of the text.<br />
*'''g:''' The amount of green in the color of the text.<br />
*'''b:''' The amount of blue in the color of the text.<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is either a [[player]] element or the [[root]] element.<br />
<br />
==Cancel effect==<br />
AS OF 1.3.2<br />
If this event is [[Event system#Canceling|canceled]], the game's chat system won't deliver the posts. You may use [[outputChatBox]] to send the messages then.<br />
<br />
==Example==<br />
This example doesn't output anything to chatbox if it consists only of numbers<br />
<syntaxhighlight lang="lua"><br />
function onClientChatMessageHandler(text)<br />
if string.match(text,"%d+") --[[string.match searches for pattern "%d+", means decimals]] == text then -- if string.match and text itself are the same<br />
cancelEvent() -- don't output it<br />
end<br />
end<br />
addEventHandler("onClientChatMessage", getRootElement(), onClientChatMessageHandler)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
<br />
===Client other events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Predefined_variables_list&diff=53915Predefined variables list2018-02-11T11:04:09Z<p>Necktrox: Fix layout</p>
<hr />
<div>== Lua Predefined variables ==<br />
<syntaxhighlight lang="lua"><br />
_G -- returns a table of all global variables<br />
coroutine -- returns a table containing functions for threads<br />
debug -- returns a table containing debug functions<br />
math -- returns a table that contains mathematical functions<br />
string -- returns a table containing functions for strings<br />
table -- returns a table that contains functions for tables<br />
_VERSION -- returns a string of the version of lua in format "Lua 5.1"<br />
self -- used in methods<br />
arg -- used in functions which use '...' as an argument (https://www.lua.org/pil/5.2.html)<br />
</syntaxhighlight><br />
<br />
<br />
<br />
== MTA Predefined variables ==<br />
=== Global ===<br />
<section name="Shared" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
exports -- returns a table of resource names containing all export functions<br />
resource -- returns a resource element of the resource the snippet was executed in<br />
resourceRoot -- returns a resource root element of the resource the snippet was executed in<br />
root -- returns the root element of the server<br />
</syntaxhighlight><br />
<br />
</section><br />
<section name="Client only" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
guiRoot -- returns the root element of all GUI elements.<br />
localPlayer -- returns the player element of the local player.<br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
=== Event Handlers ===<br />
[https://wiki.multitheftauto.com/wiki/AddEventHandler More details about hidden variables in functions and events]<br />
<br />
<section name="Shared" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
source -- The player or element the event was attached to<br />
this -- Element, which was attached function-handler.<br />
eventName -- the name of the event ("onResourceStart", "onPlayerWasted" etc.)<br />
</syntaxhighlight><br />
</section><br />
<br />
<section name="Server only" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
client -- the client that called the event<br />
sourceResourceRoot -- the root of the resource that called the event<br />
sourceResource -- the resource that called the event <br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
=== Timer Callbacks ===<br />
<section name="Shared" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
sourceTimer -- current timer in callback function.<br />
</syntaxhighlight><br />
</section><br />
<br />
<br />
=== HTTP ===<br />
List Predefined variables available in the HTTP files [https://wiki.multitheftauto.com/wiki/Resource_Web_Access (more info about it)]:<br />
<syntaxhighlight lang="lua">[php]<br />
requestHeaders -- table, contains all HTTP headlines current page.<br />
form -- table, contains all POST and GET settings, transferred current page.<br />
cookies -- table, contains all COOKIE, transferred current page.<br />
hostname -- string, contains IP or name host, which requested current page.<br />
url -- string, URL current page.<br />
user -- element, account user, which requested current page.<br />
</syntaxhighlight><br />
<br />
<br />
== See Also ==<br />
[[Element_tree|Element Tree]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetTimer&diff=53913SetTimer2018-02-11T10:49:57Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.<br />
<br />
Once a timer has finished repeating, it no longer exists.<br />
<br />
'''The minimum accepted interval is 50ms.'''<br />
<br />
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. <br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )<br />
</syntaxhighlight> <br />
{{OOP||[[Timer]]}}<br />
===Required Arguments=== <br />
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)<br />
{{Note|The hidden global variable '''sourceTimer''' contains the currently executing timer userdata}}<br />
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50; 1000 milliseconds = 1 second)<br />
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.<br />
<br />
===Optional Arguments=== <br />
{{OptionalArg}} <br />
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables and functions/function references in that passed table will get lost. Also changes you make in the original table before the function gets called won't get transferred.<br />
<br />
===Returns===<br />
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.<br />
<br />
==Examples==<br />
This example will output some text after a small delay.<br />
<br />
<syntaxhighlight lang="lua"><br />
-- define function to be called<br />
function delayedChat ( text )<br />
outputChatBox ( "Delayed text: " .. text )<br />
end<br />
<br />
-- set a timer so the function is called after 1 second<br />
setTimer ( delayedChat, 1000, 1, "Hello, World!" )<br />
</syntaxhighlight><br />
<br />
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.<br />
<br />
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.<br />
<br />
<syntaxhighlight lang="lua"><br />
function mainFunction()<br />
outputChatBox ("Instant text!")<br />
setTimer ( function()<br />
outputChatBox ( "5 second delay text!" )<br />
end, 5000, 1 )<br />
end<br />
<br />
mainFunction() --call function<br />
</syntaxhighlight><br />
<br />
This example outputs some random text to the chat every 300000 milliseconds (5 minutes).<br />
<syntaxhighlight lang="lua"><br />
setTimer(function()<br />
outputChatBox("Text " .. math.random(1,4))<br />
end, 300000, 0)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetTimer&diff=53912SetTimer2018-02-11T10:46:04Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.<br />
<br />
Once a timer has finished repeating, it no longer exists.<br />
<br />
'''The minimum accepted interval is 50ms.'''<br />
<br />
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. <br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )<br />
</syntaxhighlight> <br />
{{OOP||[[Timer]]}}<br />
===Required Arguments=== <br />
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)<br />
{{Note|Added '''sourceTimer''' global variable to timer's callback function}}<br />
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50; 1000 milliseconds = 1 second)<br />
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.<br />
<br />
===Optional Arguments=== <br />
{{OptionalArg}} <br />
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables and functions/function references in that passed table will get lost. Also changes you make in the original table before the function gets called won't get transferred.<br />
<br />
===Returns===<br />
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.<br />
<br />
==Examples==<br />
This example will output some text after a small delay.<br />
<br />
<syntaxhighlight lang="lua"><br />
-- define function to be called<br />
function delayedChat ( text )<br />
outputChatBox ( "Delayed text: " .. text )<br />
end<br />
<br />
-- set a timer so the function is called after 1 second<br />
setTimer ( delayedChat, 1000, 1, "Hello, World!" )<br />
</syntaxhighlight><br />
<br />
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.<br />
<br />
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.<br />
<br />
<syntaxhighlight lang="lua"><br />
function mainFunction()<br />
outputChatBox ("Instant text!")<br />
setTimer ( function()<br />
outputChatBox ( "5 second delay text!" )<br />
end, 5000, 1 )<br />
end<br />
<br />
mainFunction() --call function<br />
</syntaxhighlight><br />
<br />
This example outputs some random text to the chat every 300000 milliseconds (5 minutes).<br />
<syntaxhighlight lang="lua"><br />
setTimer(function()<br />
outputChatBox("Text " .. math.random(1,4))<br />
end, 300000, 0)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Utility functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GetResourceExportedFunctions&diff=53854GetResourceExportedFunctions2018-01-29T20:03:50Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
Returns a table containing the names of the functions that a resource exports. It will return the exports of the current resource if there is no argument passed in.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
table|false getResourceExportedFunctions ( [ resource res ] )<br />
</syntaxhighlight><br />
<br />
===Optional Arguments===<br />
*'''res:''' the resource of which you want to know the exported functions.<br />
<br />
===Returns===<br />
Returns a table of function names if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
This simple example will output the names of the functions that the "scoreboard" resource exports.<br />
<syntaxhighlight lang="lua"><br />
local res = getResourceFromName ( "scoreboard" )<br />
if res then<br />
local functionNames = getResourceExportedFunctions ( res )<br />
outputConsole ( "The scoreboard resource exports " .. #functionNames .. " functions:" )<br />
for i, name in ipairs ( functionNames ) do<br />
outputConsole ( name )<br />
end<br />
else<br />
outputConsole ( "Unable to find the scoreboard resource." )<br />
end<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Resource functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=OnElementModelChange&diff=53259OnElementModelChange2018-01-02T12:00:52Z<p>Necktrox: The code still provides the newModel as argument to the event handler</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
This event is triggered when the model of an [[element]] is changed using [[setElementModel]].<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
int oldModel, int newModel<br />
</syntaxhighlight> <br />
<br />
* '''oldModel:''' The model of the element beforehand.<br />
* '''newModel:''' The new model of the element.<br />
<br />
==Source==<br />
The source of this event is the element that changed its model<br />
<br />
==Cancel Effect==<br />
This event doesn't support [[Event system#Canceling|cancellation]]. Use setElementModel with the old value to reverse.<br />
<br />
==Example== <br />
This example sends a message to players when their model changes telling them what the model ID is and was.<br />
<syntaxhighlight lang="lua"><br />
function informPlayerOnModelChange(oldModel, newModel)<br />
if ( getElementType(source) == "player" ) then -- Make sure the element is a player<br />
outputChatBox("Model ID changing from: "..oldModel.." to: ".. newModel, source, 0, 255, 0) -- Message for player<br />
end<br />
end<br />
addEventHandler("onElementModelChange", root, informPlayerOnModelChange) -- Bind the event to every element<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===Element events===<br />
{{Element_events}}<br />
===Event functions===<br />
{{Event_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetWorldSpecialPropertyEnabled&diff=53222SetWorldSpecialPropertyEnabled2017-12-29T14:28:26Z<p>Necktrox: Reverted edits by Sephus (talk) to last revision by AlexTMjugador</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
Enables or disables a special world property.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">bool setWorldSpecialPropertyEnabled ( string propname, bool enable )</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''propname:''' the name of the property to set. Possible values are:<br />
**'''hovercars''' - equivalent of the JBGVNB cheat, and allows cars to drive on water.<br />
**'''aircars''' - equivalent of the RIPAZHA cheat, and allows cars to fly.<br />
**'''extrabunny''' - equivalent of the CJPHONEHOME or JHJOECW cheat, and allows you to bunny hop on bicycles much higher.<br />
**'''extrajump''' - equivalent of the KANGAROO cheat, and allows you to jump on foot much higher.<br />
**'''randomfoliage''' - toggle randomly generated foliage on the GTA:SA map (default: true)<br />
**'''snipermoon''' - toggle the GTA:SA easter egg, which increases the size of the moon every time you shoot it with a sniper rifle (default: false)<br />
**'''extraairresistance''' - toggle the vehicle speed limit on cross-country roads (default: true)<br />
*'''enable:''' whether or not to enable the property.<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
Function which allow cars to fly.<br />
<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientResourceStart", resourceRoot,<br />
function()<br />
setWorldSpecialPropertyEnabled("aircars", true)<br />
end<br />
)<br />
</syntaxhighlight><br />
</section><br />
<br />
'''Example 2:''' <br />
Allow cars to drive on water.<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
addEventHandler( "onClientResourceStart", resourceRoot,<br />
function()<br />
setWorldSpecialPropertyEnabled("hovercars", true)<br />
end<br />
)</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Client world functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Version_History&diff=52929Version History2017-11-29T13:15:13Z<p>Necktrox: Added 1.5.5 to list of versions</p>
<hr />
<div>{{note|If you just want to download [[Multi Theft Auto]] go here:<br />
* [http://mtasa.com Download MTA: San Andreas {{Current Version|full}}]<br />
* [[Archive|Download Multi Theft Auto 0.5r2 (GTA3 and Vice City)]]<br />
}}<br />
An overview of the (released) MTA versions.<br />
<br />
== List of (released) versions ==<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ List of Multi Theft Auto Versions<br />
|-<br />
! Release<br />
! Version<br />
! Date<br />
! GTA: III<br />
! GTA: Vice City<br />
! GTA: San Andreas<br />
! License<br />
|-<br />
! GTA3:AM<br />
| 0.1<br />
| 2003-02-09<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="2" | GTA3:MTA<br />
| 0.2a<br />
| 2003-02-28<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3b<br />
| 2003-05-29<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="4" | MTA:VC<br />
| 0.1<br />
| 2003-08-02<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.2<br />
| 2003-09-20<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3<br />
| 2003-12-25<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3r2<br />
| 2004-01-01<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="6" | MTA<br />
| 0.4<br />
| 2004-07-27<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.4.1<br />
| [https://forum.mtasa.com/topic/6678-mta-041-released/ 2004-07-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.5<br />
| [https://forum.mtasa.com/topic/8285-multitheftauto-05-server-released/ 2005-01-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| style="background: #FFD6BF;" | [http://files.mtasa.com/web/mta_0.5_launch/051.htm 0.5.1 (2005)]<br />
| {{n/a}}<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
| style="background: #FFEC99;" | [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336938 0.5r2]<br />
| [https://forum.mtasa.com/topic/26397-release-mta-05r2-for-gta3vc/ 2011-01-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| style="background: #B2BDFF;" | [http://www.projectredivivus.com/ 0.5.1 (2013)]<br />
| {{n/a}}<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
! rowspan="1" | MTA:VC<br />
| style="background: #FFD6BF;" | [http://files.mtasa.com/web/mtablue.info/ Blue]<br />
| {{n/a}}<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
! rowspan="4" | MTA:SA Race<br />
| 1.0<br />
| [https://forum.mtasa.com/topic/11489-mtasa-released/ 2006-01-22]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1<br />
| [https://forum.mtasa.com/topic/12604-news-mtasa-r11-has-been-released-16032006-by-ijs/ 2006-03-16]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1.1<br />
| [https://forum.mtasa.com/topic/12652-news-amp-blog-mtasa-race-111-released-by-eai/ 2006-03-18]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1.2<br />
| 2008-05-18<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
! rowspan="5" | MTA:SA Deathmatch<br />
| 1.0 DP1.0<br />
| 2008-01-03<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.0<br />
| 2008-01-10<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.1<br />
| 2008-05-23<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.2<br />
| 2008-08-04<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.3<br />
| 2008-08-06<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
! rowspan="23" | MTA:SA<br />
| [[Changes in 1.0|1.0]]<br />
| 2009-08-21<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.1|1.0.1]]<br />
| 2009-10-02<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.2|1.0.2]]<br />
| [https://forum.mtasa.com/topic/21312-point-release-v102-and-upcoming-projects/ 2009-10-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.3|1.0.3]]<br />
| [https://forum.mtasa.com/topic/21682-mtasa-103-is-out/ 2009-12-18]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.4|1.0.4]]<br />
| [https://forum.mtasa.com/topic/23387-104-released-faster-and-more-reliable/ 2010-06-09]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.5|1.0.5]]<br />
| [https://forum.mtasa.com/topic/27103-multi-theft-auto-san-andreas-105-is-out/ 2011-03-28]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.1|1.1]]<br />
| [https://forum.mtasa.com/topic/29718-mtasa-11-released-harder-better-stronger-faster/ 2011-08-25]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.1.1|1.1.1]]<br />
| [https://forum.mtasa.com/topic/30393-mtasa-111-released/ 2011-09-19]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.2|1.2]]<br />
| [https://forum.mtasa.com/topic/32175-mtasa-12-released/ 2011-12-17]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.0|1.3]]<br />
| [https://forum.mtasa.com/topic/33297-multi-theft-auto-san-andreas-13-released/ 2012-01-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.1|1.3.1]]<br />
| [https://forum.mtasa.com/topic/40578-multi-theft-auto-san-andreas-131-released/ 2012-09-03]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.2|1.3.2]]<br />
| [https://forum.mtasa.com/topic/49546-multi-theft-auto-san-andreas-132-released/ 2013-05-05]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.3|1.3.3]]<br />
| [https://forum.mtasa.com/topic/52078-multi-theft-auto-san-andreas-133-released/ 2013-07-02]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.4|1.3.4]]<br />
| [https://forum.mtasa.com/topic/54914-multi-theft-auto-san-andreas-134-released/ 2013-09-07]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.5|1.3.5]]<br />
| [https://forum.mtasa.com/topic/60847-multi-theft-auto-san-andreas-135-released/ 2014-02-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.4|1.4]]<br />
| [https://forum.mtasa.com/topic/66859-multi-theft-auto-san-andreas-14-released/ 2014-07-30]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.4.1|1.4.1]]<br />
| [https://forum.mtasa.com/topic/72290-multi-theft-auto-san-andreas-141-released/ 2015-01-31]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.0|1.5]]<br />
| [https://forum.mtasa.com/topic/77212-multi-theft-auto-san-andreas-15-released/ 2015-07-15]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.1|1.5.1]]<br />
| [https://forum.mtasa.com/topic/80806-multi-theft-auto-san-andreas-151-released/ 2015-11-05]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.2|1.5.2]]<br />
| [https://forum.mtasa.com/topic/82591-multi-theft-auto-san-andreas-152-released/ 2016-01-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.3|1.5.3]]<br />
| [https://forum.mtasa.com/topic/89984-multi-theft-auto-san-andreas-153-released/ 2016-10-20]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.4|1.5.4]]<br />
| [https://forum.mtasa.com/topic/95022-multi-theft-auto-san-andreas-154-released/ 2017-04-17]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| style="background: #99FF99;" | [[Changes in 1.5.5|1.5.5]]<br />
| [https://forum.mtasa.com/topic/100216-multi-theft-auto-san-andreas-155-released/ 2017-08-07]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|-<br />
| width="20px;" | &nbsp;<br />
| Previous Version, Unsupported<br />
|-<br />
| width="20px;" style="background: #99FF99;" | &nbsp;<br />
| Current Version, Supported<br />
|-<br />
| width="20px;" style="background: #B2BDFF;" | &nbsp;<br />
| In Development / Future Release<br />
|-<br />
| width="20px;" style="background: #FFEC99;" | &nbsp;<br />
| Released by Community<br />
|-<br />
| width="20px;" style="background: #FFD6BF;" | &nbsp;<br />
| Never Released<br />
|-<br />
|}<br />
* Date format: YYYY-MM-DD<br />
* AM = Alternative Multiplayer<br />
* DP = Developer Preview<br />
** MTA:San Andreas 1.0 was also known as Developer Preview 3.0, this was later dropped because the 'new' 1.0 was a major release.<br />
<br />
{{Comparison of Versions}}<br />
<br />
== MTA 0.5 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto 0.5|<br />
image = [[File:Clientwelcome_nick.jpg|MTA 0.5 Client|center|230px]]|<br />
status = Supported by community|<br />
release = 2005-01-31|<br />
core = 0.3|<br />
license = Freeware|<br />
}}<br />
The latest stable release for GTA III and GTA: Vice City bundled in one client and server. This release was also the first version that had a server browser build in the client.<br />
[[File:800px-Robber.jpg|Spawnscreen in Vice City at Robbers spawn|right|thumb|230px]]<br />
<br />
=== Gamemodes ===<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|-<br />
! GTA<br />
! Gamemode Name<br />
! Uses Spawnscreen<br />
|-<br />
! rowspan="2" |GTA: Vice City<br />
| [[MTA:VC Deathmatch Gamemode|Deathmatch]]<br />
| {{Yes}}<br />
|-<br />
| [[MTA:VC Stunt Gamemode|Stunt]]<br />
| {{Yes}}<br />
|-<br />
! rowspan="3" |GTA III<br />
| [[GTA3 Portland|Portland]]<br />
| {{No}}<br />
|-<br />
|[[GTA3 SSV|Shoreside Vale]]<br />
| {{Yes}}<br />
|-<br />
|[[GTA3 Staunton|Staunton]]<br />
| {{No}}<br />
|}<br />
<br />
==== Spawns ====<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ MTA:Vice City Deathmatch<br />
|-<br />
! Team/Spawn Name/Mode<br />
! Spawn Location<br />
|-<br />
| Robbers<br />
| Phil's Place - Little Haiti<br />
|-<br />
| Mexicans<br />
| Escobar International Airport's terminal<br />
|-<br />
| Sailors<br />
| Vice City Docks - Vice Port<br />
|-<br />
| Vice City Crusader<br />
| Random Location in Vice City<br />
|-<br />
| Secret Service<br />
| Under a shelter - Ocean Beach<br />
|-<br />
| Cops<br />
| Police Stations in Vice City<br />
|-<br />
| &nbsp;<br />
| &nbsp;<br />
|-<br />
| Spectator<br />
| Allows to watch other players<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ colspan="2" | MTA:Vice City Stunt<br />
|-<br />
! Team/Spawn Name/Mode<br />
! Spawn Location<br />
|-<br />
| Yuppies<br />
| Spawn inside the multistory parking garage in Ocean Beach<br />
|-<br />
| Dirt Racers<br />
| Spawn outside of the Stadium<br />
|-<br />
| Bikers<br />
| Spawn in the parking lot behind the Malibu club<br />
|-<br />
| Speeders<br />
| Spawn at the parking lot near the Escobar International Airport<br />
|-<br />
| Packer Driver<br />
| Spawn at Downtown in the large parking lot near the Biker Bar<br />
|-<br />
| Fun House Dept.<br />
| Spawns at North Point Mall's multistory parking garage<br />
|-<br />
| Heli Pilot<br />
| Spawn at the Escobar International Airport runway<br />
|-<br />
| &nbsp;<br />
| &nbsp;<br />
|-<br />
| Spectator<br />
| Allows to watch other players<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ GTA3:MTA Shoreside Vale<br />
|-<br />
! Team/Spawn Name<br />
! Spawn Location<br />
|-<br />
| Yakuza<br />
| Pike Creek<br />
|-<br />
| Southside Hoods<br />
| Witchita Gardens<br />
|-<br />
| Columbians<br />
| Cedar Grove<br />
|-<br />
| Cops<br />
| Pike Creek<br />
|}<br />
<br />
=== Features ===<br />
* Huge increase in stability. Using the errors reported to us using the Error Report Tool, we've managed to fix a large number of the common crashes.<br />
* New Staunton Island map available for GTA3, which includes a race mode and deathmatch.<br />
* New Shoreside Vale map available for GTA3, which includes several gamemodes. <br />
* Lots of changes to the existing maps.<br />
* A server browser has been added to the client along with an area to store your favourites and a list of servers you've played on recently (History). <br />
* New Client design - The client has been redesigned to make it easier to use. Error messages are now more self explanatory and checks are added to help users ensure their game is set up correctly. <br />
* Added an in-client server that allows you to quickly configure and host a server straight from the MTA Client.<br />
* Integrated the MTA Protocol handler - now mta:// links will work for all MTA 0.5 users.<br />
* Redesigned MTA Admin Tool to make it easier and more logical to use. <br />
* In client global MOTD so that you can hear about news from MTA immediately.<br />
* A rich text welcome message that the server can show to players when they join. This can contain much more information than the normal Message of the Day and is visible in the client the entire time the user is on the server.<br />
* New installation and configuration scripts for easy setup for Linux dedicated servers. <br />
* More platforms supported for the dedicated server, including FreeBSD and OpenBSD. <br />
* Improved error report tool is now installed by default (though optionally).<br />
* Chat box in the client now scrolls properly, as most chat programs do (scroll up to stop auto-scroll). <br />
<br />
=== Minor Updates ===<br />
<br />
* '''Patch 1''': A server [http://forum.multitheftauto.com/viewtopic.php?f=31&t=13923#p198981 patch] was released; the Message of The Day feature could be exploited.<br />
* '''0.5.1 (2005)''': In February 2005 MTA 0.5.1 [http://files.mtasa.com/web/mta_0.5_launch/051.htm preview] was shown to the public, addressing known issues and adding new features. 0.5.1 was never released.<br />
* '''0.5r2''': Members of the MTA community released a minor update called 0.5r2 for 0.5, this also includes a new (external) server browser, the included server browser in 0.5 client is non-functional since 2008.<br />
** [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336938 Download]<br />
** [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336939 Changelog for 0.5r2]<br />
* '''0.5.1 (2013)''': In 2013 members of the MTA community called ''Project Redivivus'' are developing a minor update for 0.5 with major changes. This is likely to become open source. <br />
** [http://www.projectredivivus.com/ Website]<br />
<br />
=== Archived Wiki pages ===<br />
* [[MTA_0.5_EULA|EULA]]<br />
* [[MTA_0.5_Installation|Installation]]<br />
* [[MTA_0.5_Known_Issues|Known Issues]]<br />
* [[MTA:VC_0.5|0.5 Vice City]]<br />
* [[MTA:VC_Deathmatch_Gamemode|Vice City Deathmatch Gamemode]]<br />
* [[MTA:VC_Stunt_Gamemode|Vice City Stunt Gamemode]]<br />
* [[MTA:mA]]<br />
* [[Using_A_0.5_Server_With_Screen|Using the server with screen utility]]<br />
<br />
=== See Also ===<br />
*[[MTA Vault]]<br />
<br />
== MTA:San Andreas Race ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas Race|<br />
image = [[File:MTASA-Race-Mainmenu.png|Multi Theft Auto± San Andreas Race Main Menu|center|230px]]|<br />
status = Unsupported/Obsolete|<br />
release = 2008-05-18|<br />
core = Blue|<br />
license = Freeware|<br />
}}<br />
MTA:SA Race is the first release that was made with the blue framework, a new approach to control the game (GTA). The sync was also better over the previous releases and the client is in game not an external application. Notice the blue GUI in the screenshot.<br />
<br />
A new slogan was introduced: "Stop Playing With Yourself."<br />
[[File:Mtavcbluelaunching.png|MTA Loading screen with the new slogan: "Stop Playing With Yourself."|thumb|230px]]<br />
<br />
=== Gamemodes ===<br />
As the name suggests it is only race (you cannot get out of your vehicle).<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
!Gamemode<br />
!Notes<br />
|-<br />
|Race<br />
|-<br />
|Freeroam<br />
|-<br />
|Destruction Derby<br />
|The goal is to survive, last player that is still alive wins.<br />
|}<br />
<br />
=== Features ===<br />
[[File:MTASA-Race-Racing.jpg|Racing in MTA:SA|right|thumb|230px]]<br />
* In game client.<br />
* Map Editor to create a map in game.<br />
* Optimised netcode results in reduced lag.<br />
* Blue loads a DLL with the game instead of injecting code into its memory process. This improves stability and means that custom SCM files do not have to be moved to the game's directory when it is started. <br />
* Full integration means that Blue's server list is directly integrated into GTA's GUI.<br />
* Fewer glitches. This is achieved by synchronizing every animation, implementing a custom pause menu so that people can't pause to escape death, and forcing the frame limiter on so that everyone's game runs at the same maximum speed. <br />
* Greater synchronization, this means that MTA players can finally use boats.<br />
* Anti cheat. <br />
<br />
=== Minor Updates ===<br />
* '''1.1'''<br />
** New mappack<br />
** New map nomination voting system<br />
** Respawning during map<br />
** Map timelimit added in map files and server config<br />
** New player animation sync<br />
** Admins can PM players from remote admin<br />
** The 255 map limit has been fixed<br />
** Fixed various admin stability issues<br />
* '''1.1.1'''<br />
** Fixed: Freezes that occurred frequently for some users (and not at all for others)<br />
** Fixed: Nothing would happen after the splash screen appeared for some users<br />
** Fixed: All players getting kicked from a server with a "protocol error 92" message<br />
** Fixed: Players getting stuck in "You will respawn in 1 second" mode, if a race starts before they join completely<br />
** Fixed: Issue where error reporter would sometimes fail to find core dump<br />
** Fixed: Occasional crash when connecting to a server through the server browser<br />
** Fixes: Various other crashes<br />
** Added: An error message is now displayed if you try to use the ′order checkpoints′ option in the map editor if you have no checkpoints in your map<br />
** Added: DefaultMapDuration and DefaultRespawnTime to server config<br />
* '''1.1.2'''<br />
** All-Seeing Eye server-browser has been removed in favour of a more reliable and faster replacement<br />
** Removed redundant "MTA Center" references<br />
** Removed support for built-in error reporter<br />
<br />
No more releases for MTA:SA Race, the new MTA release made the race version obsolete, a new resource called 'race' which could read the race maps replaced it.<br />
<br />
=== Archived Wiki pages ===<br />
*[[MTA:SA Race FAQ]]<br />
*[[Blue]]<br />
*[[MTA:SA R1]]<br />
*[[MTA:SA Race-Windows Server Guide]]<br />
*[[MTA General FAQ]]<br />
*[[MTA R1 remote administration_protocol]]<br />
<br />
=== See Also ===<br />
* [[Upgrading from MTA:Race]]<br />
<br />
== MTA:San Andreas (Deathmatch) 1.0.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas (Deathmatch) 1.0.x|<br />
image = [[File:MTA_Main_Menu_1.0.x.png|Multi Theft Auto: San Andreas (Deathmatch) Main Menu|center|230px]]|<br />
status = Unsupported|<br />
release = 2011-03-28|<br />
core = Blue|<br />
license = Freeware (Until DP2.3) GPLv3 (since 1.0 (August 21, 2009))|<br />
}}<br />
MTA:San Andreas Deathmatch Developer Preview 1 was the first release that featured on-foot synchronization for San Andreas. The name deathmatch refers to the ability to shoot with weapons and get on-foot unlike the race version. The tag deathmatch has been dropped in later releases because this version allowed customized gamemodes with LUA scripting and confused players. While the first 5 releases were called 'Developer Preview' it was very popular. In August 21, 2009 version 1.0.x was released with the GPLv3 license this allowed to work with more people on the next release when it became open source.<br />
<br />
=== Gamemodes ===<br />
This was the first released that allowed to create customized gamemodes with the LUA scripting language. No static gamemodes. <br />
Scripted gamemodes and utilities packed together are called resources.<br />
<br />
=== Features ===<br />
* On-foot synchronization.<br />
* Improved vehicle synchronization.<br />
* LUA scripting.<br />
* New map editor with EDF (Editor Definition File) allowed to edit custom gamemodes created with LUA.<br />
* Included web server in server side for remote administration or statistics.<br />
* Client side scripting with LUA, allowing to transfer files to the client which can be used to create GUI on the client for example.<br />
* ...<br />
<br />
=== Minor Updates ===<br />
* 1.0.1<br />
* 1.0.2<br />
* 1.0.3<br />
* 1.0.4<br />
* 1.0.5<br />
<br />
=== See Also ===<br />
* [[Changes in 1.0]]<br />
* [http://code.google.com/p/mtasa-blue/ Subversion on Google Code]<br />
* [[Scripting Introduction]]<br />
* [http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
<br />
== MTA:San Andreas 1.1.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas 1.1.x|<br />
image = [[File:MTA_Main_Menu_1.1.x.png|Multi Theft Auto: San Andreas 1.1.x Main Menu|center|230px]]|<br />
status = Unsupported|<br />
release = 2011-09-19|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Vehicle handling can be modified by servers<br />
* Custom fonts<br />
* Special skins<br />
* Improved server browser<br />
* Voice chat (on servers that support it)<br />
* Improved sound support, including streaming audio<br />
* Increased maximum player count<br />
* Custom shaders<br />
* Cars can now have any color you want, not just the ones GTA has normally<br />
* GUI Skin switching<br />
<br />
=== Minor Updates ===<br />
* 1.1.1<br />
<br />
=== See Also ===<br />
* [[Changes in 1.1]]<br />
<br />
== MTA:San Andreas 1.2.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.2.x|<br />
status = Unsupported|<br />
release = 2011-12-17|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Major bandwidth usage reductions<br />
* Ability to replace ped models<br />
* Ability to replace weapon models<br />
* Threaded database access functions<br />
* Custom weapon stats<br />
* Synced and controllable vehicle variants<br />
* Improved bullet accuracy synchronization<br />
<br />
=== Minor Updates ===<br />
* None<br />
<br />
=== See Also ===<br />
* [[Changes in 1.2]]<br />
<br />
== MTA:San Andreas 1.3.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.3.x|<br />
status = Unsupported|<br />
release = 2014-02-07|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
This version was released quickly because 1.2 had several network related issues, that were fixed in this release.<br />
<br />
=== Features ===<br />
* Fixes for various network problems which occured in 1.1 and 1.2 series. (including a fix for "Map download breaking often on large transfers" issue)<br />
* Added new scripting functions for removal of default GTASA map objects. (including breakable ones)<br />
* Introduced a new scripting event. - [[onClientVehicleCollision]]<br />
* Implemented a new scripting function. - [[takePlayerScreenShot]]<br />
* Fixes for various crashes and issues. (including "warp glitch", inaccurate heat seekers sync, createProjectile() velocity desync between clients, custom models texture crash, "white models" when using custom models and more)<br />
* Added functionality to protect client-side scripts which pre-compiles them before being sent and stops resources from being saved on disk. This is configurable in the resource's meta.xml.<br />
* Added pixel manipulation functionality.<br />
* Introduced new client-side scripting functions - [[setBirdsEnabled]] and [[getBirdsEnabled]]<br />
* Included a new gui skin - [http://forum.mtasa.com/viewtopic.php?f=139&t=36010#p371815 Lighter black] - contributed by Aibo<br />
<br />
=== Minor Updates ===<br />
* 1.3.1<br />
* 1.3.2<br />
* 1.3.3<br />
* 1.3.4<br />
* 1.3.5<br />
<br />
=== See Also ===<br />
* [[Changes in 1.3]]<br />
* [[Changes in 1.3.1]]<br />
* [[Changes in 1.3.2]]<br />
* [[Changes in 1.3.3]]<br />
* [[Changes in 1.3.4]]<br />
* [[Changes in 1.3.5]]<br />
<br />
== MTA:San Andreas 1.4 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.4|<br />
status = Unsupported|<br />
release = 2014-07-30|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Localization of MTA's Menu<br />
* Introduced [[OOP]]<br />
* Introduced Matrices and Vectors<br />
<br />
=== See Also ===<br />
* [[Changes in 1.4]]<br />
* [[Changes in 1.4.1]]<br />
<br />
== MTA:San Andreas 1.5 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.5|<br />
status = Supported|<br />
release = 2017-04-17|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Added a built-in web browser into MTA (CEF) which can be controlled by scripts using a new browser element.<br />
* Added light functions<br />
<br />
=== See Also ===<br />
* [[Changes in 1.5]]<br />
* [[Changes in 1.5.1]]<br />
* [[Changes in 1.5.2]]<br />
* [[Changes in 1.5.3]]<br />
* [[Changes in 1.5.4]]<br />
* [[Changes in 1.5.5]]<br />
<br />
== See Also ==<br />
* [https://code.google.com/p/mtasa-blue/source/browse/trunk/CHANGELOG Changelog] - Overview of all the changes since MTA: San Andreas 1.0dp1.<br />
* [[MTA Vault]] - Overview of releases before MTA 0.5.<br />
* [[Archive]] - Multi Theft Auto Archive.<br />
<br />
[[Category: Historical]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Version_History&diff=52928Version History2017-11-28T17:23:52Z<p>Necktrox: Added link to Changes in 1.5.5</p>
<hr />
<div>{{note|If you just want to download [[Multi Theft Auto]] go here:<br />
* [http://mtasa.com Download MTA: San Andreas {{Current Version|full}}]<br />
* [[Archive|Download Multi Theft Auto 0.5r2 (GTA3 and Vice City)]]<br />
}}<br />
An overview of the (released) MTA versions.<br />
<br />
== List of (released) versions ==<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ List of Multi Theft Auto Versions<br />
|-<br />
! Release<br />
! Version<br />
! Date<br />
! GTA: III<br />
! GTA: Vice City<br />
! GTA: San Andreas<br />
! License<br />
|-<br />
! GTA3:AM<br />
| 0.1<br />
| 2003-02-09<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="2" | GTA3:MTA<br />
| 0.2a<br />
| 2003-02-28<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3b<br />
| 2003-05-29<br />
| {{yes}}<br />
| {{No}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="4" | MTA:VC<br />
| 0.1<br />
| 2003-08-02<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.2<br />
| 2003-09-20<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3<br />
| 2003-12-25<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.3r2<br />
| 2004-01-01<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
! rowspan="6" | MTA<br />
| 0.4<br />
| 2004-07-27<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.4.1<br />
| [https://forum.mtasa.com/topic/6678-mta-041-released/ 2004-07-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| 0.5<br />
| [https://forum.mtasa.com/topic/8285-multitheftauto-05-server-released/ 2005-01-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| style="background: #FFD6BF;" | [http://files.mtasa.com/web/mta_0.5_launch/051.htm 0.5.1 (2005)]<br />
| {{n/a}}<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
| style="background: #FFEC99;" | [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336938 0.5r2]<br />
| [https://forum.mtasa.com/topic/26397-release-mta-05r2-for-gta3vc/ 2011-01-31]<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| Freeware<br />
|-<br />
| style="background: #B2BDFF;" | [http://www.projectredivivus.com/ 0.5.1 (2013)]<br />
| {{n/a}}<br />
| {{Yes}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
! rowspan="1" | MTA:VC<br />
| style="background: #FFD6BF;" | [http://files.mtasa.com/web/mtablue.info/ Blue]<br />
| {{n/a}}<br />
| {{No}}<br />
| {{Yes}}<br />
| {{No}}<br />
| {{n/a}}<br />
|-<br />
! rowspan="4" | MTA:SA Race<br />
| 1.0<br />
| [https://forum.mtasa.com/topic/11489-mtasa-released/ 2006-01-22]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1<br />
| [https://forum.mtasa.com/topic/12604-news-mtasa-r11-has-been-released-16032006-by-ijs/ 2006-03-16]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1.1<br />
| [https://forum.mtasa.com/topic/12652-news-amp-blog-mtasa-race-111-released-by-eai/ 2006-03-18]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.1.2<br />
| 2008-05-18<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
! rowspan="5" | MTA:SA Deathmatch<br />
| 1.0 DP1.0<br />
| 2008-01-03<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.0<br />
| 2008-01-10<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.1<br />
| 2008-05-23<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.2<br />
| 2008-08-04<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
| 1.0 DP2.3<br />
| 2008-08-06<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| Freeware<br />
|-<br />
! rowspan="22" | MTA:SA<br />
| [[Changes in 1.0|1.0]]<br />
| 2009-08-21<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.1|1.0.1]]<br />
| 2009-10-02<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.2|1.0.2]]<br />
| [https://forum.mtasa.com/topic/21312-point-release-v102-and-upcoming-projects/ 2009-10-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.3|1.0.3]]<br />
| [https://forum.mtasa.com/topic/21682-mtasa-103-is-out/ 2009-12-18]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.4|1.0.4]]<br />
| [https://forum.mtasa.com/topic/23387-104-released-faster-and-more-reliable/ 2010-06-09]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.0.5|1.0.5]]<br />
| [https://forum.mtasa.com/topic/27103-multi-theft-auto-san-andreas-105-is-out/ 2011-03-28]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.1|1.1]]<br />
| [https://forum.mtasa.com/topic/29718-mtasa-11-released-harder-better-stronger-faster/ 2011-08-25]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.1.1|1.1.1]]<br />
| [https://forum.mtasa.com/topic/30393-mtasa-111-released/ 2011-09-19]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.2|1.2]]<br />
| [https://forum.mtasa.com/topic/32175-mtasa-12-released/ 2011-12-17]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.0|1.3]]<br />
| [https://forum.mtasa.com/topic/33297-multi-theft-auto-san-andreas-13-released/ 2012-01-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.1|1.3.1]]<br />
| [https://forum.mtasa.com/topic/40578-multi-theft-auto-san-andreas-131-released/ 2012-09-03]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.2|1.3.2]]<br />
| [https://forum.mtasa.com/topic/49546-multi-theft-auto-san-andreas-132-released/ 2013-05-05]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.3|1.3.3]]<br />
| [https://forum.mtasa.com/topic/52078-multi-theft-auto-san-andreas-133-released/ 2013-07-02]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.4|1.3.4]]<br />
| [https://forum.mtasa.com/topic/54914-multi-theft-auto-san-andreas-134-released/ 2013-09-07]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.3.5|1.3.5]]<br />
| [https://forum.mtasa.com/topic/60847-multi-theft-auto-san-andreas-135-released/ 2014-02-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.4|1.4]]<br />
| [https://forum.mtasa.com/topic/66859-multi-theft-auto-san-andreas-14-released/ 2014-07-30]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.4.1|1.4.1]]<br />
| [https://forum.mtasa.com/topic/72290-multi-theft-auto-san-andreas-141-released/ 2015-01-31]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.0|1.5]]<br />
| [https://forum.mtasa.com/topic/77212-multi-theft-auto-san-andreas-15-released/ 2015-07-15]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.1|1.5.1]]<br />
| [https://forum.mtasa.com/topic/80806-multi-theft-auto-san-andreas-151-released/ 2015-11-05]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.2|1.5.2]]<br />
| [https://forum.mtasa.com/topic/82591-multi-theft-auto-san-andreas-152-released/ 2016-01-24]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| [[Changes in 1.5.3|1.5.3]]<br />
| [https://forum.mtasa.com/topic/89984-multi-theft-auto-san-andreas-153-released/ 2016-10-20]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
| style="background: #99FF99;" | [[Changes in 1.5.4|1.5.4]]<br />
| [https://forum.mtasa.com/topic/95022-multi-theft-auto-san-andreas-154-released/ 2017-04-17]<br />
| {{No}}<br />
| {{No}}<br />
| {{Yes}}<br />
| GPLv3<br />
|-<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|-<br />
| width="20px;" | &nbsp;<br />
| Previous Version, Unsupported<br />
|-<br />
| width="20px;" style="background: #99FF99;" | &nbsp;<br />
| Current Version, Supported<br />
|-<br />
| width="20px;" style="background: #B2BDFF;" | &nbsp;<br />
| In Development / Future Release<br />
|-<br />
| width="20px;" style="background: #FFEC99;" | &nbsp;<br />
| Released by Community<br />
|-<br />
| width="20px;" style="background: #FFD6BF;" | &nbsp;<br />
| Never Released<br />
|-<br />
|}<br />
* Date format: YYYY-MM-DD<br />
* AM = Alternative Multiplayer<br />
* DP = Developer Preview<br />
** MTA:San Andreas 1.0 was also known as Developer Preview 3.0, this was later dropped because the 'new' 1.0 was a major release.<br />
<br />
{{Comparison of Versions}}<br />
<br />
== MTA 0.5 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto 0.5|<br />
image = [[File:Clientwelcome_nick.jpg|MTA 0.5 Client|center|230px]]|<br />
status = Supported by community|<br />
release = 2005-01-31|<br />
core = 0.3|<br />
license = Freeware|<br />
}}<br />
The latest stable release for GTA III and GTA: Vice City bundled in one client and server. This release was also the first version that had a server browser build in the client.<br />
[[File:800px-Robber.jpg|Spawnscreen in Vice City at Robbers spawn|right|thumb|230px]]<br />
<br />
=== Gamemodes ===<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|-<br />
! GTA<br />
! Gamemode Name<br />
! Uses Spawnscreen<br />
|-<br />
! rowspan="2" |GTA: Vice City<br />
| [[MTA:VC Deathmatch Gamemode|Deathmatch]]<br />
| {{Yes}}<br />
|-<br />
| [[MTA:VC Stunt Gamemode|Stunt]]<br />
| {{Yes}}<br />
|-<br />
! rowspan="3" |GTA III<br />
| [[GTA3 Portland|Portland]]<br />
| {{No}}<br />
|-<br />
|[[GTA3 SSV|Shoreside Vale]]<br />
| {{Yes}}<br />
|-<br />
|[[GTA3 Staunton|Staunton]]<br />
| {{No}}<br />
|}<br />
<br />
==== Spawns ====<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ MTA:Vice City Deathmatch<br />
|-<br />
! Team/Spawn Name/Mode<br />
! Spawn Location<br />
|-<br />
| Robbers<br />
| Phil's Place - Little Haiti<br />
|-<br />
| Mexicans<br />
| Escobar International Airport's terminal<br />
|-<br />
| Sailors<br />
| Vice City Docks - Vice Port<br />
|-<br />
| Vice City Crusader<br />
| Random Location in Vice City<br />
|-<br />
| Secret Service<br />
| Under a shelter - Ocean Beach<br />
|-<br />
| Cops<br />
| Police Stations in Vice City<br />
|-<br />
| &nbsp;<br />
| &nbsp;<br />
|-<br />
| Spectator<br />
| Allows to watch other players<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ colspan="2" | MTA:Vice City Stunt<br />
|-<br />
! Team/Spawn Name/Mode<br />
! Spawn Location<br />
|-<br />
| Yuppies<br />
| Spawn inside the multistory parking garage in Ocean Beach<br />
|-<br />
| Dirt Racers<br />
| Spawn outside of the Stadium<br />
|-<br />
| Bikers<br />
| Spawn in the parking lot behind the Malibu club<br />
|-<br />
| Speeders<br />
| Spawn at the parking lot near the Escobar International Airport<br />
|-<br />
| Packer Driver<br />
| Spawn at Downtown in the large parking lot near the Biker Bar<br />
|-<br />
| Fun House Dept.<br />
| Spawns at North Point Mall's multistory parking garage<br />
|-<br />
| Heli Pilot<br />
| Spawn at the Escobar International Airport runway<br />
|-<br />
| &nbsp;<br />
| &nbsp;<br />
|-<br />
| Spectator<br />
| Allows to watch other players<br />
|}<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
|+ GTA3:MTA Shoreside Vale<br />
|-<br />
! Team/Spawn Name<br />
! Spawn Location<br />
|-<br />
| Yakuza<br />
| Pike Creek<br />
|-<br />
| Southside Hoods<br />
| Witchita Gardens<br />
|-<br />
| Columbians<br />
| Cedar Grove<br />
|-<br />
| Cops<br />
| Pike Creek<br />
|}<br />
<br />
=== Features ===<br />
* Huge increase in stability. Using the errors reported to us using the Error Report Tool, we've managed to fix a large number of the common crashes.<br />
* New Staunton Island map available for GTA3, which includes a race mode and deathmatch.<br />
* New Shoreside Vale map available for GTA3, which includes several gamemodes. <br />
* Lots of changes to the existing maps.<br />
* A server browser has been added to the client along with an area to store your favourites and a list of servers you've played on recently (History). <br />
* New Client design - The client has been redesigned to make it easier to use. Error messages are now more self explanatory and checks are added to help users ensure their game is set up correctly. <br />
* Added an in-client server that allows you to quickly configure and host a server straight from the MTA Client.<br />
* Integrated the MTA Protocol handler - now mta:// links will work for all MTA 0.5 users.<br />
* Redesigned MTA Admin Tool to make it easier and more logical to use. <br />
* In client global MOTD so that you can hear about news from MTA immediately.<br />
* A rich text welcome message that the server can show to players when they join. This can contain much more information than the normal Message of the Day and is visible in the client the entire time the user is on the server.<br />
* New installation and configuration scripts for easy setup for Linux dedicated servers. <br />
* More platforms supported for the dedicated server, including FreeBSD and OpenBSD. <br />
* Improved error report tool is now installed by default (though optionally).<br />
* Chat box in the client now scrolls properly, as most chat programs do (scroll up to stop auto-scroll). <br />
<br />
=== Minor Updates ===<br />
<br />
* '''Patch 1''': A server [http://forum.multitheftauto.com/viewtopic.php?f=31&t=13923#p198981 patch] was released; the Message of The Day feature could be exploited.<br />
* '''0.5.1 (2005)''': In February 2005 MTA 0.5.1 [http://files.mtasa.com/web/mta_0.5_launch/051.htm preview] was shown to the public, addressing known issues and adding new features. 0.5.1 was never released.<br />
* '''0.5r2''': Members of the MTA community released a minor update called 0.5r2 for 0.5, this also includes a new (external) server browser, the included server browser in 0.5 client is non-functional since 2008.<br />
** [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336938 Download]<br />
** [http://forum.mtasa.com/viewtopic.php?f=31&t=31692#p336939 Changelog for 0.5r2]<br />
* '''0.5.1 (2013)''': In 2013 members of the MTA community called ''Project Redivivus'' are developing a minor update for 0.5 with major changes. This is likely to become open source. <br />
** [http://www.projectredivivus.com/ Website]<br />
<br />
=== Archived Wiki pages ===<br />
* [[MTA_0.5_EULA|EULA]]<br />
* [[MTA_0.5_Installation|Installation]]<br />
* [[MTA_0.5_Known_Issues|Known Issues]]<br />
* [[MTA:VC_0.5|0.5 Vice City]]<br />
* [[MTA:VC_Deathmatch_Gamemode|Vice City Deathmatch Gamemode]]<br />
* [[MTA:VC_Stunt_Gamemode|Vice City Stunt Gamemode]]<br />
* [[MTA:mA]]<br />
* [[Using_A_0.5_Server_With_Screen|Using the server with screen utility]]<br />
<br />
=== See Also ===<br />
*[[MTA Vault]]<br />
<br />
== MTA:San Andreas Race ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas Race|<br />
image = [[File:MTASA-Race-Mainmenu.png|Multi Theft Auto± San Andreas Race Main Menu|center|230px]]|<br />
status = Unsupported/Obsolete|<br />
release = 2008-05-18|<br />
core = Blue|<br />
license = Freeware|<br />
}}<br />
MTA:SA Race is the first release that was made with the blue framework, a new approach to control the game (GTA). The sync was also better over the previous releases and the client is in game not an external application. Notice the blue GUI in the screenshot.<br />
<br />
A new slogan was introduced: "Stop Playing With Yourself."<br />
[[File:Mtavcbluelaunching.png|MTA Loading screen with the new slogan: "Stop Playing With Yourself."|thumb|230px]]<br />
<br />
=== Gamemodes ===<br />
As the name suggests it is only race (you cannot get out of your vehicle).<br />
<br />
{| class="wikitable" style="width: auto; text-align: center; table-layout: fixed;"<br />
!Gamemode<br />
!Notes<br />
|-<br />
|Race<br />
|-<br />
|Freeroam<br />
|-<br />
|Destruction Derby<br />
|The goal is to survive, last player that is still alive wins.<br />
|}<br />
<br />
=== Features ===<br />
[[File:MTASA-Race-Racing.jpg|Racing in MTA:SA|right|thumb|230px]]<br />
* In game client.<br />
* Map Editor to create a map in game.<br />
* Optimised netcode results in reduced lag.<br />
* Blue loads a DLL with the game instead of injecting code into its memory process. This improves stability and means that custom SCM files do not have to be moved to the game's directory when it is started. <br />
* Full integration means that Blue's server list is directly integrated into GTA's GUI.<br />
* Fewer glitches. This is achieved by synchronizing every animation, implementing a custom pause menu so that people can't pause to escape death, and forcing the frame limiter on so that everyone's game runs at the same maximum speed. <br />
* Greater synchronization, this means that MTA players can finally use boats.<br />
* Anti cheat. <br />
<br />
=== Minor Updates ===<br />
* '''1.1'''<br />
** New mappack<br />
** New map nomination voting system<br />
** Respawning during map<br />
** Map timelimit added in map files and server config<br />
** New player animation sync<br />
** Admins can PM players from remote admin<br />
** The 255 map limit has been fixed<br />
** Fixed various admin stability issues<br />
* '''1.1.1'''<br />
** Fixed: Freezes that occurred frequently for some users (and not at all for others)<br />
** Fixed: Nothing would happen after the splash screen appeared for some users<br />
** Fixed: All players getting kicked from a server with a "protocol error 92" message<br />
** Fixed: Players getting stuck in "You will respawn in 1 second" mode, if a race starts before they join completely<br />
** Fixed: Issue where error reporter would sometimes fail to find core dump<br />
** Fixed: Occasional crash when connecting to a server through the server browser<br />
** Fixes: Various other crashes<br />
** Added: An error message is now displayed if you try to use the ′order checkpoints′ option in the map editor if you have no checkpoints in your map<br />
** Added: DefaultMapDuration and DefaultRespawnTime to server config<br />
* '''1.1.2'''<br />
** All-Seeing Eye server-browser has been removed in favour of a more reliable and faster replacement<br />
** Removed redundant "MTA Center" references<br />
** Removed support for built-in error reporter<br />
<br />
No more releases for MTA:SA Race, the new MTA release made the race version obsolete, a new resource called 'race' which could read the race maps replaced it.<br />
<br />
=== Archived Wiki pages ===<br />
*[[MTA:SA Race FAQ]]<br />
*[[Blue]]<br />
*[[MTA:SA R1]]<br />
*[[MTA:SA Race-Windows Server Guide]]<br />
*[[MTA General FAQ]]<br />
*[[MTA R1 remote administration_protocol]]<br />
<br />
=== See Also ===<br />
* [[Upgrading from MTA:Race]]<br />
<br />
== MTA:San Andreas (Deathmatch) 1.0.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas (Deathmatch) 1.0.x|<br />
image = [[File:MTA_Main_Menu_1.0.x.png|Multi Theft Auto: San Andreas (Deathmatch) Main Menu|center|230px]]|<br />
status = Unsupported|<br />
release = 2011-03-28|<br />
core = Blue|<br />
license = Freeware (Until DP2.3) GPLv3 (since 1.0 (August 21, 2009))|<br />
}}<br />
MTA:San Andreas Deathmatch Developer Preview 1 was the first release that featured on-foot synchronization for San Andreas. The name deathmatch refers to the ability to shoot with weapons and get on-foot unlike the race version. The tag deathmatch has been dropped in later releases because this version allowed customized gamemodes with LUA scripting and confused players. While the first 5 releases were called 'Developer Preview' it was very popular. In August 21, 2009 version 1.0.x was released with the GPLv3 license this allowed to work with more people on the next release when it became open source.<br />
<br />
=== Gamemodes ===<br />
This was the first released that allowed to create customized gamemodes with the LUA scripting language. No static gamemodes. <br />
Scripted gamemodes and utilities packed together are called resources.<br />
<br />
=== Features ===<br />
* On-foot synchronization.<br />
* Improved vehicle synchronization.<br />
* LUA scripting.<br />
* New map editor with EDF (Editor Definition File) allowed to edit custom gamemodes created with LUA.<br />
* Included web server in server side for remote administration or statistics.<br />
* Client side scripting with LUA, allowing to transfer files to the client which can be used to create GUI on the client for example.<br />
* ...<br />
<br />
=== Minor Updates ===<br />
* 1.0.1<br />
* 1.0.2<br />
* 1.0.3<br />
* 1.0.4<br />
* 1.0.5<br />
<br />
=== See Also ===<br />
* [[Changes in 1.0]]<br />
* [http://code.google.com/p/mtasa-blue/ Subversion on Google Code]<br />
* [[Scripting Introduction]]<br />
* [http://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
<br />
== MTA:San Andreas 1.1.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto: San Andreas 1.1.x|<br />
image = [[File:MTA_Main_Menu_1.1.x.png|Multi Theft Auto: San Andreas 1.1.x Main Menu|center|230px]]|<br />
status = Unsupported|<br />
release = 2011-09-19|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Vehicle handling can be modified by servers<br />
* Custom fonts<br />
* Special skins<br />
* Improved server browser<br />
* Voice chat (on servers that support it)<br />
* Improved sound support, including streaming audio<br />
* Increased maximum player count<br />
* Custom shaders<br />
* Cars can now have any color you want, not just the ones GTA has normally<br />
* GUI Skin switching<br />
<br />
=== Minor Updates ===<br />
* 1.1.1<br />
<br />
=== See Also ===<br />
* [[Changes in 1.1]]<br />
<br />
== MTA:San Andreas 1.2.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.2.x|<br />
status = Unsupported|<br />
release = 2011-12-17|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Major bandwidth usage reductions<br />
* Ability to replace ped models<br />
* Ability to replace weapon models<br />
* Threaded database access functions<br />
* Custom weapon stats<br />
* Synced and controllable vehicle variants<br />
* Improved bullet accuracy synchronization<br />
<br />
=== Minor Updates ===<br />
* None<br />
<br />
=== See Also ===<br />
* [[Changes in 1.2]]<br />
<br />
== MTA:San Andreas 1.3.x ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.3.x|<br />
status = Unsupported|<br />
release = 2014-02-07|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
This version was released quickly because 1.2 had several network related issues, that were fixed in this release.<br />
<br />
=== Features ===<br />
* Fixes for various network problems which occured in 1.1 and 1.2 series. (including a fix for "Map download breaking often on large transfers" issue)<br />
* Added new scripting functions for removal of default GTASA map objects. (including breakable ones)<br />
* Introduced a new scripting event. - [[onClientVehicleCollision]]<br />
* Implemented a new scripting function. - [[takePlayerScreenShot]]<br />
* Fixes for various crashes and issues. (including "warp glitch", inaccurate heat seekers sync, createProjectile() velocity desync between clients, custom models texture crash, "white models" when using custom models and more)<br />
* Added functionality to protect client-side scripts which pre-compiles them before being sent and stops resources from being saved on disk. This is configurable in the resource's meta.xml.<br />
* Added pixel manipulation functionality.<br />
* Introduced new client-side scripting functions - [[setBirdsEnabled]] and [[getBirdsEnabled]]<br />
* Included a new gui skin - [http://forum.mtasa.com/viewtopic.php?f=139&t=36010#p371815 Lighter black] - contributed by Aibo<br />
<br />
=== Minor Updates ===<br />
* 1.3.1<br />
* 1.3.2<br />
* 1.3.3<br />
* 1.3.4<br />
* 1.3.5<br />
<br />
=== See Also ===<br />
* [[Changes in 1.3]]<br />
* [[Changes in 1.3.1]]<br />
* [[Changes in 1.3.2]]<br />
* [[Changes in 1.3.3]]<br />
* [[Changes in 1.3.4]]<br />
* [[Changes in 1.3.5]]<br />
<br />
== MTA:San Andreas 1.4 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.4|<br />
status = Unsupported|<br />
release = 2014-07-30|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Localization of MTA's Menu<br />
* Introduced [[OOP]]<br />
* Introduced Matrices and Vectors<br />
<br />
=== See Also ===<br />
* [[Changes in 1.4]]<br />
* [[Changes in 1.4.1]]<br />
<br />
== MTA:San Andreas 1.5 ==<br />
{{versionbox|<br />
versionname = Multi Theft Auto:San Andreas 1.5|<br />
status = Supported|<br />
release = 2017-04-17|<br />
core = Blue|<br />
license = GPLv3|<br />
}}<br />
=== Features ===<br />
* Added a built-in web browser into MTA (CEF) which can be controlled by scripts using a new browser element.<br />
* Added light functions<br />
<br />
=== See Also ===<br />
* [[Changes in 1.5]]<br />
* [[Changes in 1.5.1]]<br />
* [[Changes in 1.5.2]]<br />
* [[Changes in 1.5.3]]<br />
* [[Changes in 1.5.4]]<br />
* [[Changes in 1.5.5]]<br />
<br />
== See Also ==<br />
* [https://code.google.com/p/mtasa-blue/source/browse/trunk/CHANGELOG Changelog] - Overview of all the changes since MTA: San Andreas 1.0dp1.<br />
* [[MTA Vault]] - Overview of releases before MTA 0.5.<br />
* [[Archive]] - Multi Theft Auto Archive.<br />
<br />
[[Category: Historical]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=SetPlayerBlurLevel&diff=52901SetPlayerBlurLevel2017-11-18T22:05:09Z<p>Necktrox: Reverted edits by Pirulax (talk) to last revision by Qaisjp</p>
<hr />
<div>{{Server client function}}<br />
__NOTOC__<br />
Sets the motion blur level on the clients screen. Accepts a value between 0 and 255.<br />
<br />
==Syntax==<br />
<section name="Server" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
bool setPlayerBlurLevel ( player thePlayer, int level )<br />
</syntaxhighlight><br />
{{OOP||[[player]]:setBlurLevel|blurLevel|getPlayerBlurLevel}}<br />
===Required Arguments=== <br />
*'''thePlayer:''' The [[player]] whose blur level will be changed.<br />
*'''level:''' The level to set the blur to (default: 36)<br />
</section><br />
<br />
<section name="Client" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
bool setBlurLevel ( int level )<br />
</syntaxhighlight><br />
{{OOP||[[Player]].setBlurLevel||getPlayerBlurLevel}}<br />
===Required Arguments=== <br />
*'''level:''' The level to set the blur to (default: 36)<br />
</section><br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This example allows the player to set their blur level via a command<br />
<syntaxhighlight lang="lua"> <br />
function changeBlurLevel ( playerSource, command, blur )<br />
blur = tonumber(blur)<br />
if not blur or blur > 255 or blur < 0 then<br />
outputChatBox ( "Enter a value between 0 - 255.", playerSource )<br />
else<br />
setPlayerBlurLevel ( playerSource, blur )<br />
outputChatBox ( "Blur level set to: " .. blur, playerSource )<br />
end<br />
end<br />
<br />
addCommandHandler("blur", changeBlurLevel)<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Player functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Changes_in_1.3.2&diff=52769Changes in 1.3.22017-11-04T08:55:03Z<p>Necktrox: http -> https</p>
<hr />
<div>{{Changelogs}}<br />
== Main Additions / Changes ==<br />
<br />
=== Client ===<br />
<br />
----<br />
<br />
==== New Functions ====<br />
* Added [[isPlayerHudComponentVisible]]<br />
* Added [[setPlayerHudComponentVisible]] (alias of [[showPlayerHudComponent]])<br />
* Added [[guiLabelGetColor]]<br />
* Added [[isVoiceEnabled]]<br />
* Added [[getPedOxygenLevel]] <br />
* Added [[setPedOxygenLevel]]<br />
* Added [[getVehicleComponentPosition]]<br />
* Added [[getVehicleComponentRotation]] <br />
* Added [[getVehicleComponentVisible]]<br />
* Added [[resetVehicleComponentPosition]]<br />
* Added [[resetVehicleComponentRotation]]<br />
* Added [[setVehicleComponentPosition]]<br />
* Added [[setVehicleComponentRotation]]<br />
* Added [[setVehicleComponentVisible]]<br />
* Added [[getVehicleComponents]]<br />
* Added [[engineGetModelLODDistance]]<br />
* Added [[sha256]]<br />
* Added [[setPedWalkingStyle]]<br />
* Added [[guiGridListSetColumnTitle]]<br />
* Added [[guiGridListGetColumnTitle]]<br />
* Added [[guiGridListGetVerticalScrollPosition]]<br />
* Added [[guiGridListSetVerticalScrollPosition]]<br />
* Added [[guiGridListGetHorizontalScrollPosition]]<br />
* Added [[guiGridListSetHorizontalScrollPosition]]<br />
* Added [[toggleObjectRespawn]]<br />
* Added [[breakObject]]<br />
* Added [[respawnObject]]<br />
* Added [[isVehicleNitroRecharging]]<br />
* Added [[isVehicleNitroActivated]]<br />
* Added [[getVehicleNitroCount]]<br />
* Added [[getVehicleNitroLevel]]<br />
* Added [[setVehicleNitroActivated]]<br />
* Added [[setVehicleNitroCount]]<br />
* Added [[setVehicleNitroLevel]]<br />
* Added [[setAircraftMaxVelocity]]<br />
* Added [[getAircraftMaxVelocity]]<br />
* Added [[getMoonSize]]<br />
* Added [[setMoonSize]]<br />
* Added [[resetMoonSize]]<br />
* Added [[guiStaticImageGetNativeSize]] <br />
* Added [[getObjectMass]]<br />
* Added [[setObjectMass]]<br />
* Added [[setCursorAlpha]]<br />
* Added [[getCursorAlpha]]<br />
* Added [[fetchRemote]]<br />
* Added [[bitAnd]]<br />
* Added [[bitNot]]<br />
* Added [[bitOr]]<br />
* Added [[bitXor]]<br />
* Added [[bitTest]]<br />
* Added [[bitLRotate]]<br />
* Added [[bitRRotate]]<br />
* Added [[bitLShift]]<br />
* Added [[bitRShift]]<br />
* Added [[bitArShift]] <br />
* Added [[bitExtract]] <br />
* Added [[bitReplace]] <br />
* Added [[setFPSLimit]]<br />
* Added [[setSoundPan]]<br />
* Added [[getSoundPan]] <br />
<br />
==== New Events ====<br />
* Added [[onClientVehicleNitroStateChange]]<br />
* Added [[onClientObjectBreak]]<br />
* Added [[onClientObjectDamage]]<br />
* Added [[onClientWeaponFire]]<br />
* Added [[onClientVehicleDrown]]<br />
* Added [[onClientPlayerVoicePause]]<br />
* Added [[onClientPlayerVoiceResumed]]<br />
<br />
==== Changes / Bug Fixes ====<br />
* Fixed [[setElementFrozen]] killing players from falls<br />
* Fixed textures disappearing and flickering at certain camera angles<br />
* Fixed high CPU usage when minimized and not connected<br />
* Integrated downgrader/patcher into the MTA installer<br />
* More fixes for engineless NRG-500<br />
* Fixed crashes on disconnect / reconnect <br />
* Fixed crashes when using [[setFarClipDistance]]<br />
* Fixed chinese characters in chat freezing the game<br />
* Fixed FarClipDistance reseting each respawn<br />
* Fixed [[setFarClipDistance]] messing with water drawing<br />
* Added an interior argument (optional) to [[removeWorldModel]] and [[restoreWorldModel]]<br />
* Fixed an issue when ped rotation while in air goes opposite direction by adding ''conformPedAirRotation'' argument to [[setElementRotation]]<br />
* Added work around to prevent server nitro adds cutting off recent client nitro adds<br />
* Fixed blank lines in the client console sometimes<br />
* Fixed launching issues with Steam<br />
* Added heat haze setting<br />
* Fixed crashes when getting combobox item text sometimes<br />
* Made [[onClientChatMessage]] cancelable<br />
* Fixed owning resource for client peds and water<br />
* Fixed custom collisions preventing normal collisions of other models from loading correctly<br />
* Fixed a bug when double-clicking on another server from server browser list while connecting to a server makes the game exit to desktop<br />
* Fixed crash when destroying the source of [[onClientColShapeHit]] event<br />
* Fixed an error with [[setVehicleSirens]]<br />
* Conformed client console log date format to ISO 8601<br />
* Fixed custom dx-fonts not working on Windows 8<br />
* Prevented loading splash disappearing too early<br />
* Fixed readable depth buffer not working with anti-aliasing<br />
* Improved performance of readable depth buffer/AA fix - Details: [[DepthBuffer|Depth buffer]]<br />
* Added more settings to [[dxGetStatus]]<br />
* Reduced chance of message boxes being obscured by other windows<br />
* Fixed not working crouching with vehicle extrapolation<br />
* Fixed startup issue with an exe version that someone gave support desk<br />
* Fixed stuck voice problem<br />
* Fixed [[onClientPlayerVoiceStop]] not working properly<br />
* Fixed occasional invalid return value from [[getEasingValue]]<br />
* Added color coded argument to [[dxGetTextWidth]]<br />
* Main menu items 'Map Editor'/'Host Game' now will ask if player want to disconnect from current server<br />
* Added proper axis support on controllers<br />
* Fixed ''hitElement'' parameter working incorrectly with shotgun in [[onClientPlayerWeaponFire]]<br />
* Fixed and re-enabled [[setPedWalkingStyle]]<br />
* Added ped vertex [[shader]] support<br />
* Fixed [[engineGetModelTextureNames]] for CJ model<br />
* Small memory optimization for the server browser<br />
* Fixed [[guiGetEnabled]] and [[guiGetVisible]] for tabs<br />
* Fixed binds that were attached directly to controls getting reset when loading default binds in settings<br />
* Fixed [[getVehicleType]] with trailers returning empty string client-side<br />
* Fixed chat messages not updating while a map download is in progress<br />
* Fixed server browser disabled tab option<br />
* Added cached info for server browser favourites<br />
* Fixed startup issues<br />
* Make [[setObjectScale]] accept 1 scale value for each axis<br />
* Fixed not properly working client's console logging<br />
* Fixed readable depth buffer not working on some graphic cards<br />
* Fixed object scale crash<br />
* Refixed scaled objects not being rendered when the unscaled bounding box goes off-screen<br />
* Made it able to set velocity on (dynamic) objects<br />
* Fixed radararea not functioning when using negative numbers for dimensions<br />
* Improved frozen process detection<br />
* Fixed client quit issue<br />
* Fixed quit crash when connection history drop-down is visible<br />
* Fixed input settings inconsistencies<br />
* Added vertical aim sensitivity setting<br />
* Fixed [[guiGetSelectedTab]] crash after removing a tab<br />
* Added target position as alternative to [[setCameraTarget]]<br />
* Added process priority setting<br />
* Improved installer<br />
* Fixed PNG files with alpha channel sometimes being all black<br />
* Added car number plates, road sign text, CJ body parts and unnamed textures to [[engineApplyShaderToWorldTexture]]<br />
* Added some BASS API functions to voice - Details: [http://code.google.com/p/mtasa-blue/source/detail?r=5247 Google Code]<br />
* Added clothing component textures to [[engineImportTXD]]<br />
* Reduced stutter/lags on big maps<br />
* Fixed [[depthBuffer|depth buffer]] [[Shader|shaders]] not working right with mirrors<br />
* Fixed client crash after login and spawn<br />
* Added ability to turn off sounds when MTA:SA is minimized<br />
* Sped up deletion of certain client element types<br />
* Enhanced quality on usage of non-power of two image sizes for [[dxDrawImage]]<br />
* Added bitwise operator functions<br />
* Added a record for when a player connects to a server<br />
* Added ''alphaTransparency'' argument to [[engineReplaceModel]]<br />
* Fixed a server browser crash<br />
* Added 'showframegraph' command for displaying frame timings<br />
* Added 'sinfo' command to output server info<br />
* Fixed freeze on connect<br />
* Fixed [[isObjectBreakable]] returning wrong values sometimes<br />
* Added the model id as an alternative parameter to [[isObjectBreakable]]<br />
* Fixed vehicles losing velocity on race respawn<br />
<br />
=== Server ===<br />
<br />
----<br />
<br />
==== New Functions ====<br />
* Added [[setPlayerHudComponentVisible]]<br />
* Added [[sha256]]<br />
* Added [[getMoonSize]]<br />
* Added [[setMoonSize]]<br />
* Added [[resetMoonSize]]<br />
* Added [[bitAnd]]<br />
* Added [[bitNot]]<br />
* Added [[bitOr]]<br />
* Added [[bitXor]]<br />
* Added [[bitTest]]<br />
* Added [[bitLRotate]]<br />
* Added [[bitRRotate]]<br />
* Added [[bitLShift]]<br />
* Added [[bitRShift]]<br />
* Added [[bitArShift]] <br />
* Added [[bitExtract]] <br />
* Added [[bitReplace]]<br />
<br />
==== New Events ====<br />
* ''None yet''<br />
<br />
==== Changes / Bug Fixes ====<br />
* Added crash handler for Linux (It outputs log files in dumps/)<br />
* Added account name to [[Server_Commands#whowas|whowas]] command<br />
* Added an interior argument (optional) to [[removeWorldModel]] and [[restoreWorldModel]]<br />
* Fixed an issue when ped rotation while in air goes opposite direction by adding ''conformPedAirRotation'' argument to [[setElementRotation]]<br />
* Added auto generation of correct [[meta.xml#<min_mta_version />|min_mta_version]] to 'upgrade' command<br />
* Changed [[Server_Commands#upgrade|'upgrade']] and [[Server_Commands#check|'check']] commands to also work on single resources<br />
* Fixed file download not working on some servers<br />
* Added network filter option<br />
* Fixed server crash when deleting element in [[onResourceStop]]<br />
* Same serial now can't be banned more than once<br />
* Fixed [[fixdb]] problems<br />
* Fixed an error with [[setVehicleSirens]]<br />
* Fixed [[getVehicleSirensOn]] returning a nil value<br />
* Fixed double collisions when changing marker type<br />
* Added 3 new special detections - Details: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|mtaserver.conf -> enablesd]]<br />
* Fixed 'suppress' option in [[dbConnect]]<br />
* Added access to a couple of [[dbConnect]] logging settings<br />
* Tweaked ASE port usage<br />
* Added cpu core stats for Linux server<br />
* Changed account passwords to use salted sha256<br />
* Fixed issue when element is destroyed client sided when created and parent set in different resource than the parent<br />
* Sped up accounts upgrade<br />
* Fixed target range, accuracy and weapon range<br />
* Fixed [[setRuleValue]] crash<br />
* Fixed the client-side scripts "protected" attribute not working on Linux servers<br />
* Fixed occasional crash when empty filename used for some functions<br />
* Fixed a problem where [[onResourceStart]] is not triggered for the root element when using [[startResource]] from inside a (root attached) event handler<br />
* Added resource name and bandwidth usage to function performance stats<br />
* Added [[mtaserver.conf#latency_reduction|latency_reduction]] option to [[mtaserver.conf]]<br />
* Fixed and re-enabled [[setPedWalkingStyle]]<br />
* Fixed [[setElementDimension]] not working on children<br />
* Added "shared" script type to [[meta.xml]]<br />
* Decreased CPU usage by speeding up event lookups<br />
* Fixed ''visibleTo'' argument not checking for errors in [[outputChatBox]]<br />
* Tidied ASE functionality<br />
* Fixed Windows server HTTP download compression (for [[fetchRemote]])<br />
* Fixed client using HTTP download compression<br />
* Fixed vehicle extrapolation camera smoothness when viewing remote vehicles<br />
* Updated server performance stats <br />
* Fixed Linux core number in stats<br />
* Slightly sped up server startup<br />
* Fixed trailers desync <br />
* Fixed train desync<br />
* Synchronized ped traffic light<br />
* Fixed markers created by .map-files having wrong colshapes<br />
* Added process memory to performance stats<br />
* Fixed server 'per player entity' crash<br />
* Fixed [[warpPedIntoVehicle]] after [[cancelEvent]] of [[onVehicleStartEnter]] causing network trouble<br />
* Added 'hitanim' glitch to [[setGlitchEnabled]] (shot hit animation)<br />
* Added server setting to change syncer distances<br />
* Added server multiple IP support<br />
* Fixed [[xmlFindChild]] after [[xmlSetNodeValue]] causing a crash<br />
* Fixed [[getPedTotalAmmo]] not returning the correct values<br />
<br />
=== Resources ===<br />
* ['''fallout'''] Fixed freecam locks<br />
* ['''scoreboard'''] Added support for data to be drawn as image - Details: [http://code.google.com/p/mtasa-resources/source/detail?r=882 Google Code]<br />
* ['''voice'''] Added 'mutevoice' and 'unmutevoice' commands for players to mute other players permanently - Details: [http://code.google.com/p/mtasa-resources/source/detail?r=882 Google Code]<br />
* ['''admin'''] Added custom ban duration when banning player via GUI<br />
* ['''admin'''] Added ability to delete resource in 'Resources' tab (new [https://wiki.multitheftauto.com/wiki/ACL ACL] right 'command.delete')<br />
* ['''admin'''] Added ability to stop all resources in 'Resources' tab<br />
* ['''admin'''] More informations about resources now showing in 'Resources' tab<br />
* ['''admin'''] Added ability to shutdown the server in 'Server' tab<br />
* ['''admin'''] Changing vehicle's color now supports new RGB system, color is picked using color picker<br />
* ['''admin'''] Vehicle's lights color can now be changed<br />
* ['''admin'''] Server FPS Limit can now be changed in 'Server' tab<br />
* ['''webadmin'''] Added 'Players' tab where you can kick/ban players on server<br />
* ['''ipb'''] Added Ingame Performance Browser - Details: [http://code.google.com/p/mtasa-resources/source/detail?r=896 Google Code]<br />
* ['''votemanager'''] Fixed an error when votemanager can't start votekick, votekill or voteban, if the player, who we want to vote, name contains 1 character<br />
* ['''race'''] Added editor visualization of checkpoint connections<br />
* ['''admin'''] Added ability to view players' screen <br />
<br />
=== Editor ===<br />
* Fixed 'Locked Time' option resetting<br />
* Reduced the size of map files<br />
* Fixed some settings not resetting when you start a new map after working in another<br />
* Fixed weapon model changes to 1337 after saving/loading some times<br />
* Fixed problem with invalid editor_dump<br />
* Fixed not loading objects properly when a vehicle position attribute isn't saved<br />
* Added ability to remove world objects in editor<br />
* Added ability to include low LOD models for some objects<br />
* Map Editor won't remove script lines in meta.xml<br />
<br />
==Extra information==<br />
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and Google Code repositories:<br />
:* MTA:SA: from [http://code.google.com/p/mtasa-blue/source/list?num=25&start=4605 r4600] and [http://code.google.com/p/mtasa-blue/source/list above]<br />
:* Resources: from [http://code.google.com/p/mtasa-resources/source/list?num=25&start=883 r875] and [http://code.google.com/p/mtasa-resources/source/list above]<br />
<br />
<br />
[[Category:Changes in 1.3]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Predefined_variables_list&diff=52768Predefined variables list2017-11-04T08:53:56Z<p>Necktrox: http -> https</p>
<hr />
<div>'''Lua Predefined variables'''<br />
<syntaxhighlight lang="lua"><br />
_G -- returns a table of all global variables<br />
coroutine -- returns a table containing functions for threads<br />
debug -- returns a table containing debug functions<br />
math -- returns a table that contains mathematical functions<br />
string -- returns a table containing functions for strings<br />
table -- returns a table that contains functions for tables<br />
_VERSION -- returns a string of the version of lua in format "Lua 5.1"<br />
self -- used in methods<br />
arg -- used in functions which use '...' as an argument (https://www.lua.org/pil/5.2.html)<br />
</syntaxhighlight><br />
<br />
<br />
<br />
'''MTA Predefined variables'''<br />
<section name="Shared" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
exports -- returns a table of resource names containing all export functions<br />
resource -- returns a resource element of the resource the snippet was executed in<br />
resourceRoot -- returns a resource root element of the resource the snippet was executed in<br />
root -- returns the root element of the server<br />
</syntaxhighlight><br />
<br />
</section><br />
<section name="Client only" class="client" show="true"><br />
<syntaxhighlight lang="lua"><br />
guiRoot -- returns the root element of all GUI elements.<br />
localPlayer -- returns the player element of the local player.<br />
</syntaxhighlight><br />
</section><br />
The list of hidden variables, that can be found in functions - handlers:<br />
<section name="Shared" class="both" show="true"><br />
<syntaxhighlight lang="lua"><br />
source -- The player or element the event was attached to<br />
this -- Element, which was attached function-handler.<br />
eventName -- the name of the event ("onResourceStart", "onPlayerWasted" etc.)<br />
</syntaxhighlight><br />
</section><br />
<br />
<section name="Server only" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
client -- the client that called the event <br />
</syntaxhighlight><br />
<!-- mom, it's broken<br />
sourceResourceRoot -- the root of the resource that called the event<br />
sourceResource -- the resource that called the event<br />
--><br />
</section><br />
<br />
<br />
[https://wiki.multitheftauto.com/wiki/AddEventHandler More details about hidden variables in functions and events]<br />
<br />
[[Element_tree]]<br />
<br />
List Predefined variables available in the HTTP files:<br />
<syntaxhighlight lang="lua">[php]<br />
requestHeaders -- table, contains all HTTP headlines current page.<br />
form -- table, contains all POST and GET settings, transferred current page.<br />
cookies -- table, contains all COOKIE, transferred current page.<br />
hostname -- string, contains IP or name host, which requested current page.<br />
url -- string, URL current page.<br />
user -- element, account user, which requested current page.<br />
</syntaxhighlight><br />
<br />
[https://wiki.multitheftauto.com/wiki/Resource_Web_Access More info about it]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Element/Shader&diff=52767Element/Shader2017-11-04T08:51:55Z<p>Necktrox: http -> https</p>
<hr />
<div>The shader class represents a Microsoft HLSL Effect File(.fx) loaded by the client, which can be used instead of a texture when calling [[dxDrawImage]]<br />
<br />
The element type of this class is '''"shader"'''.<br />
<br />
==How HLSL Effect Files file integrate into MTA:SA==<br />
<br />
Note: This page assumes you know what an Effect File and HLSL is. If not, you better do some research first.<br />
<br />
You can use this [[shadertest resource]] to try the examples below. Copy the effect source from the code boxes into '''shadertest/clientshader.fx''' and (re)start shadertest to see the output.<br />
<br />
After you've done all that, (or maybe before if glancing below is making you panic), visit [[Shader examples|some more shader resource examples]].<br />
<br />
===Techniques===<br />
Effect Files usually contain several techniques, but for simplicity, MTA will only use the first technique that will run correctly on the clients hardware. So, for any given Effect File, put your high end techniques first, and the simplest ones last. That way, players with good hardware get the best technique applied, and players with older hardware get at least something.<br />
<br />
===Simplest===<br />
Here is the contents of an Effect File with one technique which should work on all hardware:<br />
<syntaxhighlight lang="lua"><br />
//-- Declare the textures. These are set using dxSetShaderValue( shader, "Tex0", texture )<br />
texture Tex0;<br />
texture Tex1;<br />
<br />
//-- Very simple technique<br />
technique simple<br />
{<br />
pass P0<br />
{<br />
//-- Set up texture stage 0<br />
Texture[0] = Tex0;<br />
ColorOp[0] = SelectArg1;<br />
ColorArg1[0] = Texture;<br />
AlphaOp[0] = SelectArg1;<br />
AlphaArg1[0] = Texture;<br />
<br />
//-- Disable texture stage 1<br />
ColorOp[1] = Disable;<br />
AlphaOp[1] = Disable;<br />
}<br />
}<br />
</syntaxhighlight><br />
It doesn't use vertex or pixel shaders, only standard D3D render states.<br />
Confusing reference of all the states you can set is here: https://msdn.microsoft.com/en-us/library/bb173347%28v=VS.85%29.aspx<br />
<br />
===Not so simple===<br />
Here is an Effect File containing a vertex and pixel shader:<br />
<syntaxhighlight lang="lua"><br />
//-- Declare the textures. These are set using dxSetShaderValue( shader, "Tex0", texture )<br />
texture Tex0;<br />
texture Tex1;<br />
<br />
//-- Declare a user variable. This can be set using dxSetShaderValue( shader, "PositionOfCheese", 1, 2, 3 )<br />
float3 PositionOfCheese;<br />
<br />
//-- These variables are set automatically by MTA<br />
float4x4 World;<br />
float4x4 View;<br />
float4x4 Projection;<br />
float4x4 WorldViewProjection;<br />
float Time;<br />
<br />
<br />
//---------------------------------------------------------------------<br />
//-- Sampler for the main texture (needed for pixel shaders)<br />
//---------------------------------------------------------------------<br />
sampler Sampler0 = sampler_state<br />
{<br />
Texture = (Tex0);<br />
};<br />
<br />
<br />
//---------------------------------------------------------------------<br />
//-- Structure of data sent to the vertex shader<br />
//---------------------------------------------------------------------<br />
struct VSInput<br />
{<br />
float3 Position : POSITION;<br />
float4 Diffuse : COLOR0;<br />
float2 TexCoord : TEXCOORD0;<br />
};<br />
<br />
//---------------------------------------------------------------------<br />
//-- Structure of data sent to the pixel shader ( from the vertex shader )<br />
//---------------------------------------------------------------------<br />
struct PSInput<br />
{<br />
float4 Position : POSITION0;<br />
float4 Diffuse : COLOR0;<br />
float2 TexCoord : TEXCOORD0;<br />
};<br />
<br />
<br />
//-----------------------------------------------------------------------------<br />
//-- VertexShaderExample<br />
//-- 1. Read from VS structure<br />
//-- 2. Process<br />
//-- 3. Write to PS structure<br />
//-----------------------------------------------------------------------------<br />
PSInput VertexShaderExample(VSInput VS)<br />
{<br />
PSInput PS = (PSInput)0;<br />
<br />
//-- Transform vertex position (You nearly always have to do something like this)<br />
PS.Position = mul(float4(VS.Position, 1), WorldViewProjection);<br />
<br />
//-- Copy the color and texture coords so the pixel shader can use them<br />
PS.Diffuse = VS.Diffuse;<br />
PS.TexCoord = VS.TexCoord;<br />
<br />
return PS;<br />
}<br />
<br />
<br />
//-----------------------------------------------------------------------------<br />
//-- PixelShaderExample<br />
//-- 1. Read from PS structure<br />
//-- 2. Process<br />
//-- 3. Return pixel color<br />
//-----------------------------------------------------------------------------<br />
float4 PixelShaderExample(PSInput PS) : COLOR0<br />
{<br />
//-- Modify the texture coord to make the image look all wobbly<br />
PS.TexCoord.y += sin(PS.TexCoord.y * 100 + Time * 10) * 0.03;<br />
<br />
//-- Grab the pixel from the texture<br />
float4 finalColor = tex2D(Sampler0, PS.TexCoord);<br />
<br />
//-- Apply color tint<br />
finalColor = finalColor * PS.Diffuse;<br />
<br />
return finalColor;<br />
}<br />
<br />
<br />
//-----------------------------------------------------------------------------<br />
//-- Techniques<br />
//-----------------------------------------------------------------------------<br />
<br />
//--<br />
//-- MTA will try this technique first:<br />
//--<br />
technique complercated<br />
{<br />
pass P0<br />
{<br />
VertexShader = compile vs_2_0 VertexShaderExample();<br />
PixelShader = compile ps_2_0 PixelShaderExample();<br />
}<br />
}<br />
<br />
//--<br />
//-- And if the preceding technique will not validate on<br />
//-- the players computer, MTA will try this one:<br />
//--<br />
technique simple<br />
{<br />
pass P0<br />
{<br />
//-- Set up texture stage 0<br />
Texture[0] = Tex0;<br />
ColorOp[0] = SelectArg1;<br />
ColorArg1[0] = Texture;<br />
AlphaOp[0] = SelectArg1;<br />
AlphaArg1[0] = Texture;<br />
<br />
//-- Disable texture stage 1<br />
ColorOp[1] = Disable;<br />
AlphaOp[1] = Disable;<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
Technique 'complercated' will be used if the computer supports Shader Model 2, otherwise technique 'simple' will be used. Comments in the source explain what MTA does and where.<br />
<br />
===Misc===<br />
Points to remember when switching between editing lua and .fx files:<br />
*HLSL statements often end with a ; (semi-colon)<br />
*HLSL indices start from 0 (where as Lua usually starts from 1)<br />
*HLSL compile errors can be viewed by typing 'debugscript 3' into the client console<br />
<br />
<br />
==Shaders for world textures==<br />
Here are a couple of examples of shaders to use when replacing world textures with [[engineApplyShaderToWorldTexture]]<br />
<br />
===Simple===<br />
This shader just replaces the texture and allows GTA to control all the render states.<br />
<syntaxhighlight lang="lua"><br />
//-- Declare the texture. These are set using dxSetShaderValue( shader, "Tex0", texture )<br />
texture Tex0;<br />
<br />
technique simple<br />
{<br />
pass P0<br />
{<br />
//-- Set up texture stage 0<br />
Texture[0] = Tex0;<br />
<br />
//-- Leave the rest of the states to the default settings<br />
}<br />
}<br />
</syntaxhighlight><br><br />
===Not so simple===<br />
This shader can be used as a base for replacing a world texture if you intend to add some fancy effect.<br />
It uses [[https://nightly.mtasa.com/files/shaders/mta-helper.fx mta-helper.fx]] to handle consistent naming of the preset shader settings (gWorld, gTexture0 etc.)<br><br />
'''''mta-helper.fx''''' also contains some helpful functions which calculate GTA lighting.<br />
<syntaxhighlight lang="lua"><br />
//-----------------------------------------------------------------------<br />
//-- Settings<br />
//-----------------------------------------------------------------------<br />
texture Tex0; //-- Replacement texture<br />
<br />
<br />
//---------------------------------------------------------------------<br />
// Include some common stuff<br />
//---------------------------------------------------------------------<br />
#include "mta-helper.fx"<br />
<br />
<br />
//-----------------------------------------------------------------------<br />
//-- Sampler for the new texture<br />
//-----------------------------------------------------------------------<br />
sampler Sampler0 = sampler_state<br />
{<br />
Texture = (Tex0);<br />
};<br />
<br />
<br />
//-----------------------------------------------------------------------<br />
//-- Structure of data sent to the vertex shader<br />
//-----------------------------------------------------------------------<br />
struct VSInput<br />
{<br />
float3 Position : POSITION0;<br />
float3 Normal : NORMAL0;<br />
float4 Diffuse : COLOR0;<br />
float2 TexCoord : TEXCOORD0;<br />
};<br />
<br />
//-----------------------------------------------------------------------<br />
//-- Structure of data sent to the pixel shader ( from the vertex shader )<br />
//-----------------------------------------------------------------------<br />
struct PSInput<br />
{<br />
float4 Position : POSITION0;<br />
float4 Diffuse : COLOR0;<br />
float2 TexCoord : TEXCOORD0;<br />
};<br />
<br />
<br />
//--------------------------------------------------------------------------------------------<br />
//-- VertexShaderFunction<br />
//-- 1. Read from VS structure<br />
//-- 2. Process<br />
//-- 3. Write to PS structure<br />
//--------------------------------------------------------------------------------------------<br />
PSInput VertexShaderFunction(VSInput VS)<br />
{<br />
PSInput PS = (PSInput)0;<br />
<br />
//-- Calculate screen pos of vertex<br />
PS.Position = mul(float4(VS.Position, 1), gWorldViewProjection);<br />
<br />
//-- Pass through tex coord<br />
PS.TexCoord = VS.TexCoord;<br />
<br />
//-- Calculate GTA lighting for buildings<br />
PS.Diffuse = MTACalcGTABuildingDiffuse( VS.Diffuse );<br />
//--<br />
//-- NOTE: The above line is for GTA buildings.<br />
//-- If you are replacing a vehicle texture, do this instead:<br />
//--<br />
//-- // Calculate GTA lighting for vehicles<br />
//-- float3 WorldNormal = MTACalcWorldNormal( VS.Normal );<br />
//-- PS.Diffuse = MTACalcGTAVehicleDiffuse( WorldNormal, VS.Diffuse );<br />
<br />
return PS;<br />
}<br />
<br />
<br />
//--------------------------------------------------------------------------------------------<br />
//-- PixelShaderFunction<br />
//-- 1. Read from PS structure<br />
//-- 2. Process<br />
//-- 3. Return pixel color<br />
//--------------------------------------------------------------------------------------------<br />
float4 PixelShaderFunction(PSInput PS) : COLOR0<br />
{<br />
//-- Get texture pixel<br />
float4 texel = tex2D(Sampler0, PS.TexCoord);<br />
<br />
//-- Apply diffuse lighting<br />
float4 finalColor = texel * PS.Diffuse;<br />
<br />
return finalColor;<br />
}<br />
<br />
<br />
//--------------------------------------------------------------------------------------------<br />
//-- Techniques<br />
//--------------------------------------------------------------------------------------------<br />
technique tec<br />
{<br />
pass P0<br />
{<br />
VertexShader = compile vs_2_0 VertexShaderFunction();<br />
PixelShader = compile ps_2_0 PixelShaderFunction();<br />
}<br />
}<br />
<br />
//-- Fallback<br />
technique fallback<br />
{<br />
pass P0<br />
{<br />
//-- Replace texture<br />
Texture[0] = Tex0;<br />
<br />
//-- Leave the rest of the states to the default settings<br />
}<br />
}<br />
</syntaxhighlight><br />
<br />
<br />
The above code as it stands will calculate the correct lighting for GTA buildings. If you are replacing a vehicle, change:<br />
<syntaxhighlight lang="lua"><br />
//-- Calculate GTA lighting for buildings<br />
PS.Diffuse = MTACalcGTABuildingDiffuse( VS.Diffuse );<br />
</syntaxhighlight><br />
to:<br />
<syntaxhighlight lang="lua"><br />
//-- Calculate GTA lighting for vehicles<br />
float3 WorldNormal = MTACalcWorldNormal( VS.Normal );<br />
PS.Diffuse = MTACalcGTAVehicleDiffuse( WorldNormal, VS.Diffuse );<br />
</syntaxhighlight><br><br />
==Multiple pass shaders==<br />
To do more than one pass, add '''pass''' blocks like this:<br />
<syntaxhighlight lang="lua"><br />
//-- Declare the texture. These are set using dxSetShaderValue( shader, "Tex0", texture )<br />
texture Tex0;<br />
<br />
technique simple<br />
{<br />
pass P0<br />
{<br />
// First pass<br />
Texture[0] = Tex0;<br />
}<br />
pass P1<br />
{<br />
// Second pass<br />
SrcBlend = Add;<br />
DestBlend = One;<br />
}<br />
pass P2<br />
{<br />
// Third pass<br />
SrcBlend = InvDestColor;<br />
DestBlend = InvSrcColor;<br />
}<br />
}<br />
</syntaxhighlight><br><br />
==Related scripting functions==<br />
===Client===<br />
{{Drawing functions}}<br />
<br />
[[Category:Element Types]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=CURL_Errors&diff=52766CURL Errors2017-11-04T08:51:36Z<p>Necktrox: http -> https</p>
<hr />
<div>{{Historical}}<br />
List of CURL Errors, updates can be found [https://curl.haxx.se/libcurl/c/libcurl-errors.html here]<br />
<br />
<br />
'''CURLE_OK (0)'''<br />
<br />
All fine. Proceed as usual.<br />
<br />
'''CURLE_UNSUPPORTED_PROTOCOL (1)'''<br />
<br />
The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for.<br />
<br />
'''CURLE_FAILED_INIT (2)'''<br />
<br />
Very early initialization code failed. This is likely to be an internal error or problem.<br />
<br />
'''CURLE_URL_MALFORMAT (3)'''<br />
<br />
The URL was not properly formatted.<br />
<br />
'''CURLE_COULDNT_RESOLVE_PROXY (5)'''<br />
<br />
Couldn't resolve proxy. The given proxy host could not be resolved.<br />
<br />
'''CURLE_COULDNT_RESOLVE_HOST (6)'''<br />
<br />
Couldn't resolve host. The given remote host was not resolved.<br />
<br />
'''CURLE_COULDNT_CONNECT (7)'''<br />
<br />
Failed to connect() to host or proxy.<br />
<br />
'''CURLE_FTP_WEIRD_SERVER_REPLY (8)'''<br />
<br />
After connecting to a FTP server, libcurl expects to get a certain reply back. This error code implies that it got a strange or bad reply. The given remote server is probably not an OK FTP server.<br />
<br />
'''CURLE_REMOTE_ACCESS_DENIED (9)'''<br />
<br />
We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory.<br />
'''<br />
CURLE_FTP_WEIRD_PASS_REPLY (11)'''<br />
<br />
After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.<br />
<br />
'''CURLE_FTP_WEIRD_PASV_REPLY (13)'''<br />
<br />
libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed.<br />
<br />
'''CURLE_FTP_WEIRD_227_FORMAT (14)'''<br />
<br />
FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back.<br />
<br />
'''CURLE_FTP_CANT_GET_HOST (15)'''<br />
<br />
An internal failure to lookup the host used for the new connection.<br />
<br />
'''CURLE_FTP_COULDNT_SET_TYPE (17)'''<br />
<br />
Received an error when trying to set the transfer mode to binary or ASCII.<br />
<br />
'''CURLE_PARTIAL_FILE (18)'''<br />
<br />
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.<br />
<br />
'''CURLE_FTP_COULDNT_RETR_FILE (19)'''<br />
<br />
This was either a weird reply to a 'RETR' command or a zero byte transfer complete.<br />
<br />
'''CURLE_QUOTE_ERROR (21)'''<br />
<br />
When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command.<br />
<br />
'''CURLE_HTTP_RETURNED_ERROR (22)'''<br />
<br />
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400. (This error code was formerly known as CURLE_HTTP_NOT_FOUND.)<br />
<br />
'''CURLE_WRITE_ERROR (23)'''<br />
<br />
An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.<br />
<br />
'''CURLE_UPLOAD_FAILED (25)'''<br />
<br />
Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this. (This error code was formerly known as CURLE_FTP_COULDNT_STOR_FILE.)<br />
<br />
'''CURLE_READ_ERROR (26)'''<br />
<br />
There was a problem reading a local file or an error returned by the read callback.<br />
<br />
'''CURLE_OUT_OF_MEMORY (27)'''<br />
<br />
A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs.<br />
<br />
'''CURLE_OPERATION_TIMEDOUT (28)'''<br />
<br />
Operation timeout. The specified time-out period was reached according to the conditions.<br />
<br />
'''CURLE_FTP_PORT_FAILED (30)'''<br />
<br />
The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.<br />
<br />
'''CURLE_FTP_COULDNT_USE_REST (31)'''<br />
<br />
The FTP REST command returned error. This should never happen if the server is sane.<br />
<br />
'''CURLE_RANGE_ERROR (33)'''<br />
<br />
The server does not support or accept range requests.<br />
<br />
'''CURLE_HTTP_POST_ERROR (34)'''<br />
<br />
This is an odd error that mainly occurs due to internal confusion.<br />
<br />
'''CURLE_SSL_CONNECT_ERROR (35)'''<br />
<br />
A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.<br />
<br />
'''CURLE_FTP_BAD_DOWNLOAD_RESUME (36)'''<br />
<br />
Attempting FTP resume beyond file size.<br />
<br />
'''CURLE_FILE_COULDNT_READ_FILE (37)'''<br />
<br />
A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions?<br />
<br />
'''CURLE_LDAP_CANNOT_BIND (38)'''<br />
<br />
LDAP cannot bind. LDAP bind operation failed.<br />
<br />
'''CURLE_LDAP_SEARCH_FAILED (39)'''<br />
<br />
LDAP search failed.<br />
<br />
'''CURLE_FUNCTION_NOT_FOUND (41)'''<br />
<br />
Function not found. A required zlib function was not found.<br />
<br />
'''CURLE_ABORTED_BY_CALLBACK (42)'''<br />
<br />
Aborted by callback. A callback returned "abort" to libcurl.<br />
<br />
'''CURLE_BAD_FUNCTION_ARGUMENT (43)'''<br />
<br />
Internal error. A function was called with a bad parameter.<br />
<br />
'''CURLE_INTERFACE_FAILED (45)'''<br />
<br />
Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE. (This error code was formerly known as CURLE_HTTP_PORT_FAILED.)<br />
'''<br />
CURLE_TOO_MANY_REDIRECTS (47)'''<br />
<br />
Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS.<br />
<br />
'''CURLE_UNKNOWN_TELNET_OPTION (48)'''<br />
<br />
An option set with CURLOPT_TELNETOPTIONS was not recognized/known. Refer to the appropriate documentation.<br />
<br />
'''CURLE_TELNET_OPTION_SYNTAX (49)'''<br />
<br />
A telnet option string was Illegally formatted.<br />
<br />
'''CURLE_PEER_FAILED_VERIFICATION (51)'''<br />
<br />
The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.<br />
<br />
'''CURLE_GOT_NOTHING (52)'''<br />
<br />
Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.<br />
<br />
'''CURLE_SSL_ENGINE_NOTFOUND (53)'''<br />
<br />
The specified crypto engine wasn't found.<br />
<br />
'''CURLE_SSL_ENGINE_SETFAILED (54)'''<br />
<br />
Failed setting the selected SSL crypto engine as default!<br />
<br />
'''CURLE_SEND_ERROR (55)'''<br />
<br />
Failed sending network data.<br />
<br />
'''CURLE_RECV_ERROR (56)'''<br />
<br />
Failure with receiving network data.<br />
<br />
'''CURLE_SSL_CERTPROBLEM (58)'''<br />
<br />
problem with the local client certificate.<br />
<br />
'''CURLE_SSL_CIPHER (59)'''<br />
<br />
Couldn't use specified cipher.<br />
<br />
'''CURLE_SSL_CACERT (60)'''<br />
<br />
Peer certificate cannot be authenticated with known CA certificates.<br />
<br />
'''CURLE_BAD_CONTENT_ENCODING (61)'''<br />
<br />
Unrecognized transfer encoding.<br />
<br />
'''CURLE_LDAP_INVALID_URL (62)'''<br />
<br />
Invalid LDAP URL.<br />
<br />
'''CURLE_FILESIZE_EXCEEDED (63)'''<br />
<br />
Maximum file size exceeded.<br />
<br />
'''CURLE_USE_SSL_FAILED (64)'''<br />
<br />
Requested FTP SSL level failed.<br />
<br />
'''CURLE_SEND_FAIL_REWIND (65)'''<br />
<br />
When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.<br />
<br />
'''CURLE_SSL_ENGINE_INITFAILED (66)'''<br />
<br />
Initiating the SSL Engine failed.<br />
<br />
'''CURLE_LOGIN_DENIED (67)'''<br />
<br />
The remote server denied curl to login (Added in 7.13.1)<br />
<br />
'''CURLE_TFTP_NOTFOUND (68)'''<br />
<br />
File not found on TFTP server.<br />
<br />
'''CURLE_TFTP_PERM (69)'''<br />
<br />
Permission problem on TFTP server.<br />
<br />
'''CURLE_REMOTE_DISK_FULL (70)'''<br />
<br />
Out of disk space on the server.<br />
<br />
'''CURLE_TFTP_ILLEGAL (71)'''<br />
<br />
Illegal TFTP operation.<br />
<br />
'''CURLE_TFTP_UNKNOWNID (72)'''<br />
<br />
Unknown TFTP transfer ID.<br />
<br />
'''CURLE_REMOTE_FILE_EXISTS (73)'''<br />
<br />
File already exists and will not be overwritten.<br />
<br />
'''CURLE_TFTP_NOSUCHUSER (74)'''<br />
<br />
This error should never be returned by a properly functioning TFTP server.<br />
<br />
'''CURLE_CONV_FAILED (75)'''<br />
<br />
Character conversion failed.<br />
<br />
'''CURLE_CONV_REQD (76)'''<br />
<br />
Caller must register conversion callbacks.<br />
<br />
'''CURLE_SSL_CACERT_BADFILE (77)'''<br />
<br />
Problem with reading the SSL CA cert (path? access rights?)<br />
<br />
'''CURLE_REMOTE_FILE_NOT_FOUND (78)'''<br />
<br />
The resource referenced in the URL does not exist.<br />
<br />
'''CURLE_SSH (79)'''<br />
<br />
An unspecified error occurred during the SSH session.<br />
<br />
'''CURLE_SSL_SHUTDOWN_FAILED (80)'''<br />
<br />
Failed to shut down the SSL connection.<br />
<br />
'''CURLE_AGAIN (81)'''<br />
<br />
Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from curl_easy_recv(3) and curl_easy_send(3) (Added in 7.18.2)<br />
<br />
'''CURLE_SSL_CRL_BADFILE (82)'''<br />
<br />
Failed to load CRL file (Added in 7.19.0)<br />
<br />
'''CURLE_SSL_ISSUER_ERROR (83)'''<br />
<br />
Issuer check failed (Added in 7.19.0)</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=How_you_can_help&diff=52765How you can help2017-11-04T08:51:21Z<p>Necktrox: http -> https</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 />
* Create pull requests for the mod, containing requested features or bugfixes. ([[Coding guidelines]])<br />
* Translate MTA:SA to your native language - https://translate.multitheftauto.com/<br />
<br />
==Scripting==<br />
* Create a gamemode <br />
**[[Scripting Introduction]]<br />
**[https://www.lua.org/pil/index.html "Programming in Lua" Manual]<br />
* Create an administration page on the HTTP server.<br />
**[[Resource Web Access]]<br />
* Make a general purpose resource that provides useful functions to other resources.<br />
<br />
==Mapping==<br />
* Create a map with the map editor for an existing gamemode.<br />
**[[Resource:Editor|Map Editor Manual]]<br />
<br />
==Web development==<br />
* Work with lil_Toady to add new features and improvements to community.mtasa.com.<br />
* Create your own system for statistics - using the [[PHP SDK]] as a basis. Contact eAi or jbeta 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 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 />
<br />
==Specific tasks==<br />
* Create a fuzzer to check for crashes in our scripting functions.<br />
* Help develop/fix existing gamemodes. Contact the original author on IRC (or ask a developer) to tell the author so you can work together.<br />
* The web interface resources (resourcemanager, resourcebrowser and webadmin chiefly) are really only compatible with Firefox. Someone could put in some time to make these work on Internet Explorer, Opera and Safari. See [[User_talk:EAi|eAi]] for help.<br />
<br />
==Grant==<br />
You can donate MTA:SA [https://mtasa.com/donate/manage.php here]<br />
<br />
[[pl:Jak możesz pomóc]]<br />
[[ru:How you can help]]<br />
[[es:Cómo puedes ayudar]]<br />
[[hu:How you can help]]<br />
[[tr:Nasıl yardımcı olabilirsiniz]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Server_Manual&diff=52764Server Manual2017-11-04T08:51:00Z<p>Necktrox: http -> https</p>
<hr />
<div>__TOC__<br />
<br />
==Getting started==<br />
It is much easier than it looks to get a server up and running for your internet or LAN buddies; follow this wiki article and you will hopefully be on your way to hosting your own MTA:SA server in no time!<br />
<br />
==Installing the server==<br />
The dedicated server application is available in different flavours depending on the platform of the server.<br />
<br />
===Linux installation===<br />
There are different ways of getting a Linux server up and running:<br />
* [https://linux.mtasa.com Getting a precompiled package]<br />
* [[Installing and Running MTASA Server on GNU Linux]]<br />
* [[Building MTASA Server on GNU Linux]]<br />
<br />
<br />
Should you have any problems with errors when starting the server some common problems and solutions are listed here:<br />
* [[Building MTASA Server on GNU Linux#Troubleshooting]]<br />
<br />
===FreeBSD installation===<br />
<br />
You can run MTA:SA under FreeBSD using Linux emulation.<br />
* Enable [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html Linux binary compatibility]<br />
* Install following packages or compile them from ports: hs-terminfo, linux_base-f10, linux-f10-sqlite3<br />
* Install [https://linux.mtasa.com/ Linux precompiled package]<br />
<br />
===Windows installation===<br />
Installation of the MTA:SA server on Windows is easy as pie.<br />
*Go to the [https://mtasa.com/ download page] and download the installer.<br />
*Once the installer is downloaded, open it.<br />
*Select a folder where you want to install the server.<br />
*Click Install.<br />
*Done!<br />
<br />
''For a full explanation of acl.xml (access control list) read: [[Access_Control_List|Access Control List]]''<br/><br/><br />
<br />
==Configuring your server==<br />
The Multi Theft Auto dedicated server is initially configurable through it's console window, from within the game, and from a webbrowser. In order to make use of the two last options, it is necessary to add at least one administrator user to your configuration file.<br />
<br />
===General configuration===<br />
All general configuration options can be found in the 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' file and can be opened by any regular text editor.<br />
<br />
This file is fairly straightforward; every variable has a [[Server_mtaserver.conf|description of what to do with it and how to change it]].<br />
<br />
===Port forwarding===<br />
If you run your server on your own private computer, and you have an router between the internet and your computer. You need to forward 3 ports.<br />
<br />
First of all open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' and search for the next lines:<br />
<syntaxhighlight lang="xml"><br />
<serverport>22003</serverport> <br />
<httpport>22005</httpport><br />
</syntaxhighlight><br />
<br />
The ports are needed to setup the server correctly. We explain later how to set them, but first if you want your server to appear in the server browser there is another port we need, and that is the ASE port. <br />
(quick example for how to turn ASE on or off):<br />
<syntaxhighlight lang="xml"><br />
<ase>1</ase> <!-- 0 = off, 1 = on --><br />
</syntaxhighlight><br />
<br />
Now we going to forward the ports in your router, which is not needed if you already have all ports open, or if you don't have a router with a firewall. If so, skip this part.<br />
<br />
If you don't know how port forwarding works in your router, go to the [https://portforward.com/ Port Forward website], find your router model there, and follow the instructions there.<br />
<br />
In almost every router you can set the port type: UDP or TCP. The following list will explain which port type is needed for what:<br />
<br />
<br />
Main server port: UDP<br />
<br />
HTTP Port: TCP<br />
<br />
ASE Port: UDP (this is needed if you want your server to appear in the server list)<br />
<br />
<br />
The ASE port is also simple to get:<br />
<br />
ASE port = Main server port + 123<br />
<br />
So, if you have the main server port set to 22003, then the ASE port will be 22126.<br />
<br />
Good luck!<br />
<br />
''In the latest version of the server, you can check the port status by using the server command [[Server_Commands#openports|openports]].''<br />
<br />
===Client Checks===<br />
<br />
The MTA server can be configured to disable the anti-cheat. It can also allow specific or all files to be modified (e.g. carmods.dat), and make sure clients are of a minimum version.<br />
<br />
All of these settings are within the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]'. See the [[Anti-cheat_guide|Anti-cheat guide]] for more details.<br/><br />
<br />
If you want to force a minimum client version, search for the following line:<br />
<syntaxhighlight lang="xml"><br />
<minclientversion></minclientversion><br />
</syntaxhighlight><br />
Accepted values look like: 1.1.1-9.02320<br />
<br />
===Adding administrators===<br />
It is strongly recommended to add at least one administrator to your server in order to make use of the built-in webserver to easily maintain and configure your server. This administrator will then also be able to log-in from within the game and control the server.<br />
<br />
To add an administrator to your server, follow these steps:<br><br />
<ol><br />
<li>While the server is running, add a new account by typing '''[[Server_Commands#addaccount|addaccount name password]]''' into the server window. For example, to add user BennyLava you could type:<br />
<div style="margin: 10px 10px 10px 10px;"><br />
<syntaxhighlight lang="xml"><br />
addaccount BennyLava 123password<br />
</syntaxhighlight><br />
</div><br />
<div style="margin: 10px 10px 10px 20px;"><br />
''Note: If you do not have access to the server window, and the 'admin' resource is running, you can add the example account by issuing the client console (F8) command '''register BennyLava 123password'''''<br />
</div><br />
<li>The server should display a message confirming the account has been added.<br />
<li>Next, shutdown the server by typing '''shutdown''' into the server window.<br />
<li>Make sure your server is stopped; if your server is still running, the following changes you make will be overwritten</li><br />
<li>Open the file 'mods/deathmatch/acl.xml' with any text editor</li><br />
<li>Add the account to the ''Admin'' group by using the XML-syntax below<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<acl><br />
...<br />
<group name="Admin"><br />
<acl name="Admin"/><br />
...<br />
<object name="user.BennyLava" /><br />
</group><br />
...<br />
</acl><br />
</syntaxhighlight><br />
</div><br />
<br />
You're done! You can add as many administrators or users as you want this way, take a look at some of the other groups and ACLs for example. The ACL is also accessible through the [[Access_Control_List|Lua scripting engine]].<br><br />
<br />
It is recommended to take a look at the web interface, we will explain how to do this below.<br />
</li><br />
</ol><br />
'''Note''': There are also ways to add accounts and edit rights for the server while it's running. "[[Server_Commands#addaccount|addaccount <user> <password>]]" is an internal command to add accounts, but you will have to use the web interface to add these accounts to specific groups/ACLs!<br /><br />
<br />
===Using the web interface===<br />
The dedicated server comes with a few Lua [[resources]] that provide a nice little web interface to your server. This can be used to easily maintain your server, as it allows you to add users, start/stop resources, and more.<br />
<br />
The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:<br />
<ol><br />
<li>Make sure your server is stopped<br />
<li>Open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' with any text editor</li><br />
<li>Verify that the HTTP server is enabled:<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<httpserver>1</httpserver><br />
</syntaxhighlight><br />
</div><br />
</li><br />
<li>Change the HTTP server port to your liking:<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"><br />
<httpport>22005</httpport><br />
</syntaxhighlight><br />
</div><br />
</li><br />
<li>Save and close the configuration file</li><br />
<li>Start your server</li><br />
<li>If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:<br />
<br />
# resourcebrowser<br />
# resourcemanager<br />
# webadmin<br />
# webmap<br />
<br />
These are automatically started in the default configuration file, in case you just installed your server.<br />
</li><br />
<li>Open a web browser (Internet Explorer 6 or 7 are NOT supported; use [https://www.mozilla.com/firefox Mozilla Firefox], [https://www.google.com/chrome Google Chrome], [https://www.apple.com/safari/download Apple Safari], [https://www.opera.com Opera] or others) and navigate to the HTTP server URL: '''http://server:port/'''. For example, If you are running a local server on HTTP port 22005, use '''http://127.0.0.1:22005/'''.</li><br />
<li>Enter the username and password of the administrator you added in the previous section.</li><br />
</ol><br />
<br />
<br /><br />
You should now be able to maintain your server from the web interface.<br />
<br />
=== Configuring an external web server ===<br />
<br />
The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.<br />
<br />
For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.<br />
<br />
To enable downloading off an external web server, you should configure the [[Server_mtaserver.conf#httpdownloadurl|httpdownloadurl]] tag in your server configuration:<br />
<br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml"> <br />
<httpdownloadurl>http://www.myserver.tld/directory/here</httpdownloadurl><br />
</syntaxhighlight></div><br />
<br />
When you launch the server, the directory '''<SERVER>/mods/deathmatch/resource-cache/http-client-files''' will contain the correct client files for hosting on an external web server. If the web server is on the same machine, you can simply link the appropriate web server directory to '''http-client-files'''. If the web server is on a separate machine, ensure it has access to '''http-client-files''' via a network path, or maintain a remote copy using synchronization software.<br />
<br />
'''Note 1''': Please try to avoid any special characters (e.g. ~, !) in your download URLs.<br /><br />
'''Note 2''': Please do not use a trailing slash in your download URL (e.g. ''<nowiki>http://www.myserver.tld/directory</nowiki>'' rather than ''<nowiki>http://www.myserver.tld/directory/</nowiki>'')<br /><br />
'''Note 3''': The web server must use 'ContentType: application/octet-stream' for Lua files. Most web servers will do this by default, or you can add the following line to the .htaccess file:<br /><br />
<div style="padding: 10px"><br />
<syntaxhighlight lang="xml">AddType application/octet-stream .lua<br />
</syntaxhighlight></div><br />
<br />
Instructions on how to install and configure Nginx as an external web server for MTA is here: [[Installing and Configuring Nginx as an External Web Server]]<br />
<br />
==Starting your server==<br />
Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!<br />
<br />
To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where necessary.<br />
<br />
==Installing/Updating resources on your server==<br />
Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA server supports both these methods.<br />
<br />
# Move or copy the new resource to your <SERVER>\mods\deathmatch\resources folder.<br />
# In the server window type in the command [[Server_Commands#refresh|refresh]], this will re-scan the resources folder and update the live resources where necessary.<br />
<br />
==Uninstalling resources==<br />
Resources can easily be removed from your server if you no longer want them.<br />
<br />
# Delete the ZIP file or the folder of the resource you wish to uninstall<br />
# In the server window type in the command "refresh" (without the quotes), this will re-scan the resources folder and update the live resources where necessary.<br />
<br />
==Administrating your server==<br />
You can start resources by typing the command "start resourcename" in the server console, or stop ones with "stop resourcename".<br />
<br />
It's also possible to execute these and other admin commands from the in-game console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command "[[Server_Commands#login|login username password]]". Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.<br />
<br />
For further commands, type [[Server_Commands#help|help]] in a console.<br />
<br />
==Starting a map/gamemode==<br />
See the commands section of the documentation for [[Resource:Map manager|mapmanager]] for more information.<br />
<br />
==Useful Notes==<br />
<br />
# You may also update the resources while in-game as long as you have the correct access levels by typing "refresh" in the clients console or "/refresh" in the chat window. This may cause a second of lag if you have many resources.<br />
# In the above instructions, <SERVER> is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server<br />
# You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.<br />
# Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.<br />
<br />
====Need further help?====<br />
Why not pop over to our [https://forum.mtasa.com/ Forums] or join us on [irc://irc.multitheftauto.com/mta IRC] (irc.multitheftauto.com #mta - [https://www.mirc.com mIRC])<br />
<br />
[[es:Manual del Servidor]]<br />
[[de:Server Anleitung]]<br />
[[it:Manuale del Server]]<br />
[[nl:Server Manual]]<br />
[[ru:Server Manual]]<br />
[[pl:Server Manual]]<br />
[[pt-br:Manual do Servidor]]<br />
[[hu:Server Manual]]<br />
<br />
[[Category:Support]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=JSON&diff=52763JSON2017-11-04T08:49:33Z<p>Necktrox: http -> https</p>
<hr />
<div>JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.<br />
<br />
MTA uses JSON in a number of places, most significantly it is used for communication over HTTP. See [[Resource Web Access]]. You can encode JSON strings in the server using [[toJSON]] and decode them using [[fromJSON]].<br />
<br />
For more general information about JSON, see https://www.json.org.<br />
<br />
[[pl:JSON]]<br />
[[Category:Scripting Concepts]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Known_Issues_-_FAQ&diff=52762Known Issues - FAQ2017-11-04T08:46:05Z<p>Necktrox: http -> https</p>
<hr />
<div>{{Note_box|Before you check the known issues make sure everything is [[Up-to-date]].}}<br />
Post here your proposed Q&A, regarding the known problems with MTA:SA and their solutions, especially the problems we are encountering now, that might be also encountered by users in the final release. You are also welcome to edit them grammar/style wise.<br />
<br />
* [[Resource:Editor#FAQ|Map editor FAQ/known issues can be found here.]]<br><br />
* [[MTA 0.5r2 Known Issues|Known issues for MTA 0.5r2 can be found here.]]<br />
* [[Compatibility FAQ|Compatibility FAQ]]<br />
<br />
== Client ==<br />
=== General ===<br />
==== I have the Steam version of GTA San Andreas. How can I play MTASA? ====<br />
:The Steam version of GTASA is currently incompatible with MTASA, just like it is with some other mods. However, it can be made to work with it.<br />
<br />
:'''If you just want to play the newest version of the mod, all you need to do is download the mod from our home page and then install it'''. The installer will detect your Steam's GTASA installation and will make some adjustments automatically.<br />
:No original files are modified in the process, so the single player mode will work the same way as it did before.<br />
<br />
<br />
:If you want to play some older MTA:SA version (1.3.2 or older), follow a few simple steps, and the Steam version will be compatible with it:<br />
:* '''Option 1:''' Find a '''GTA SA 1.00 No CD''' (Google will give useful results). You should obtain a 1.00 Cracked/NoCd EXE, not a Disc image. Any HOODLUM release will work fine.<br />
:** Open the download with Winrar or other similar archive tools, and inside there should be a gta_sa.exe. Place this file inside your installation directory. This is normally '''C:\Program Files\Steam\steamapps\common\grand theft auto san andreas'''. No files need to be replaced during this process.<br />
:This procedure will not affect your Steam version of GTASA, but will allow MTASA to boot alongside it.<br />
:* '''Option 2:''' Use the unofficial [https://forums.steampowered.com/forums/showthread.php?t=1952458 steam downgrade patch], be sure to downgrade to 1.0 and not 1.01.<br />
<br />
==== Does MTASA work with v1.01 or v2.00 of GTA San Andreas? ====<br />
:No. It can be made to work with them however - please see [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ this forum topic] for instructions on patching the exe.<br />
<br />
==== Initial black screen/hanging GTA splash screens ====<br />
:* '''MTA shows a permanent black screen or hanging GTA splash screens.'''<br />
<br />
:It may be necessary that during/after the logo splash screens in Grand Theft Auto you have to give some input in order to skip the videos correctly. Try to click your left-mouse button a few times, or tapping a few keys.<br />
<br />
:* '''MTA shows a permanent black screen after the GTA splash screens (possibly with text in the bottom right corner).'''<br />
<br />
:This can be related to a lack of support for DirectX or video card features, on your system, which are needed to run the dynamically rendered menu. This dynamic menu is enabled by default. You can disable it by opening your [[coreconfig.xml]] configuration file located in the ''GTA San Andreas\MTA'' directory, and changing the value of ''menu_options'' to ''248''.<br />
<br />
==== Halt after MTA splash screen ====<br />
:* '''Nothing happens after the 'Stop playing with yourself' splash screen'''<br />
<br />
:If you use nVidia GeForce, try turning off nView Desktop Manager before starting MTA.<br />
<br />
:Also try deleting GTA San Andreas settings file ("gta_sa.set") in "Documents\GTA San Andreas User Files" folder.<br />
<br />
:If it all fails and you run Kaspersky Anti-Virus or Internet Security, make sure status of "multi theft auto.exe" in not restricted. Other anti-virus software may block MTA from running.<br />
<br />
==== Crash after MTA splash screen ====<br />
:* '''MTA crashes after the 'Stop playing with yourself' logo. Both single player and the MTA: Race ran fine before.'''<br />
<br />
:Try downloading the latest DirectX Runtime files from [https://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&DisplayLang=en Microsoft]. Also check in Task Manager, if :gta_sa.exe process isn't already running.<br />
<br />
:If you run at any substandard resolutions (e.g. 960x720), try to change your resolution to a commonly supported one (e.g. 640×480, 800×600, 1024×768, 1152×864, 1280×1024) by launching Grand Theft Auto: San Andreas in normal mode, setting the new resolution and exiting.<br />
<br />
:If you are a user of Windows Vista or Windows 7, try the following:<br />
:* Enable Windows XP SP3 compatiblity mode for both Multi Theft Auto.exe and gta_sa.exe, setting their privilege level to "Run this program as an administrator".<br />
:* Configure Data Execution Prevention: Use the setting ''Turn DEP for all programs and services except those I select''. Click ''add'' and find "Multi Theft Auto.exe" and "gta_sa.exe" and add them.<br />
:* Run MTASA as administrator.<br />
<br />
==== "Data files have been modified" ====<br />
:* '''You receive an error stating "San Andreas data files have been modified"'''<br />
:You can fix this by [https://updatesa.mtasa.com/sa/files/GTASA-data-1.0.4.exe installing this patch]. If that doesn't work, try reinstalling GTA San Andreas.<br />
<br />
<!--<br />
==== Assertion in CMainMenu.cpp line 106 upon launching MTASA ====<br />
:* '''I'm getting an assertion in CMainMenu.cpp (line 106) after I have launched MTASA. I'm able to ignore it, but then game crashes after I try to connect to a server.''' <br />
<br />
:This is likely caused by GTASA or MTA:SA being installed in a path that contains non-ASCII characters (eg. Cyrillic, Polish, Japanese) in it. <br />
<br />
:To resolve this, you need to uninstall MTA:SA and GTASA, then install them in such paths that don't contain such characters.--><br />
==== Crash after connecting to any server ====<br />
:* '''MTASA crashes upon connecting to any server. Single player runs fine.'''<br />
<br />
:Single player mods can affect the way MTA:SA works, potentially causing crashes - you should always use a clean GTASA install for MTA:SA.<br />
<br />
:This might also occur on non-modded installs, when your GTASA executable is in an unsupported by MTA:SA version (eg. 1.0 German or Australian). To resolve this, use [https://forum.mtasa.com/topic/11757-patching-your-101-or-200-version-of-gta_saexe/ our converter].<br />
<br />
==== Controls not working ====<br />
:* '''My controls don't seem to work as they should.'''<br />
<br />
:Try using the 'copygtacontrols' command in the console.<br />
<br />
==== Incorrect models ====<br />
:* '''Woman model's breasts look awkward ingame / I'm seeing odd, spider-like shaped player models.'''<br />
<br />
:This is caused by the way GTA handles player stats. To fix this, be sure to set both fat and muscles player stats to 0, when you're changing player skin.<br />
<br />
==== Incorrect drive-by functionality ====<br />
:* '''Drivebys arent working as they should'''<br />
<br />
:Drivebys are handled by script, and will change depending on the loaded gamemode.<br />
<br />
==== Unsaved settings ====<br />
:* '''My MTA setting(s) didn't get saved (...) I crashed.'''<br />
<br />
:First, configure the MTA the way you want to, then exit the game and launch it again. Settings should get saved. Alternatively, try removing the coreconfig.xml file, then configure it and quit the game.<br />
<br />
==== Gamepad support ====<br />
:* '''MTA doesn't recognise my gamepad'''<br />
<br />
:Ensure that your controller is the first controller recognised by Windows (MTA will only use the first controller). You can configure your gamepad in options in MTASA's main menu.<br />
<br />
==== Free mouselook not working properly ====<br />
:* '''MTA doesnt recognise my mouse'''<br />
<br />
:Some people got problems with their mouse in MTA. They can use it in the menu, connect to a server, but they can't use the mouse for free look.<br />
:This problem can be solved by entering a server, click your Win/Windows key at your keyboard once, and then click your mouse.<br />
:If that doesn't work try starting GTA in Singleplayer, go to options > controler setup and set "Configuration" to "Mouse + Keys" instead of "Joypad".<br />
<br />
==== Server browser not working ====<br />
:* '''The in-game server browser shows "Loading" but does not come up with any servers'''<br />
<br />
:Depending on the type and status of the internet connection you are using, it can take up to a few seconds for the server browser to retrieve all the servers. Please wait a little longer for the results to appear.<br />
<br />
==== Invalid serial number ====<br />
:* '''I am getting an 'Invalid serial number' error when trying to launch or play the game'''<br />
<br />
:You are running an outdated version of Multi Theft Auto. Head over to the [https://mtasa.com/ main page] and download the latest version of Multi Theft Auto.<br />
<br />
==== 'Network module not compatible!' on MTA:SA launch ====<br />
:* '''I am getting 'Network module not compatible!' error message upon launching MTA:SA<br />
<br />
:This could mean that your MTA:SA install is incomplete or broken. Reinstall it.<br />
<br />
==== 'No such mod installed (deathmatch)' ====<br />
:* '''I am getting a 'No such mod installed (deathmatch)' error message when trying to connect to any server<br />
<br />
:'''Option 1:''' Simply re-install MTA. <br><br />
:'''Option 2:''' Run both gta_sa.exe and Multi Theft Auto.exe with administrator privileges.<br />
<br />
==== D3dx9_**.dll is not found ====<br />
:* '''When I start Multi Theft Auto: San Andreas I am getting an error D3dx9_**.dll (** = a number) cannot be found.<br />
<br />
:This means that DirectX 9 is not installed or not up to date.<br />
:To install/update DirectX download the [https://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3 DirectX End-User Runtime Web Installer] from the Microsoft download site.<br />
<br />
==== CRC mismatch ====<br />
:* '''When joining a server, the chatbox shows 'CRC mismatch'<br />
:This is a server problem. Tell the owner to look at the server section of this page.<br />
<br />
==== 'Error loading netc.dll module! (Error 14001)' on MTA:SA launch ====<br />
:* Full error message:<br />
:''Error loading netc.dll module! (Error 14001: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.)''<br />
<br />
:Make sure you have installed Microsoft Visual C++ 2008 regular and SP1 redistributable packages (x86):<br />
<br />
:[https://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en Microsoft Visual C++ 2008 Redistributable package (x86)]<br />
<br />
:[https://www.microsoft.com/download/en/details.aspx?id=5582 Microsoft Visual C++ 2008 SP1 Redistributable package (x86)]<br />
<br />
==== 'Error 1935. An error occurred during the installation of assembly 'Microsoft.VC90.ATL...' ====<br />
: Download the 'Fix it' helper from here: [https://support.microsoft.com/default.aspx?scid=kb;en-us;946414]<br />
<br />
==== Your virus scanner warns you about MTA:SA ====<br />
:* '''Your virus scanner informs you that the MTA:SA or setup executable is a virus or malware.'''<br />
:MTA does '''NOT''' contain any viruses, malware, adware or spyware. You should re-download MTASA [https://mtasa.com here] if you doubt the validity of your copy of MTA.<br />
<br />
==== When downloading large maps, progress halts ====<br />
:* '''When downloading large maps, progress often halts, while transmission is still taking place.'''<br />
:This issue is fixed in [https://forum.mtasa.com/topic/33297-multi-theft-auto-san-andreas-13-released/ MTA:SA 1.3].<br />
<br />
=== Windows Vista® / Windows 7-specific ===<br />
<br />
==== Crash on connect ====<br />
:* '''I seem to crash whenever I connect to a server just before I go in-game on Vista'''<br />
<br />
:This seems to be an issue with the Microsoft DirectX April 2006 SDK Redistributable DLL file (d3dx9_30.dll) when running in compatibility mode. Please make sure that compatibility mode is competely turned off for '''both''' your GTA_SA.exe and Multi Theft Auto.exe executables.<br />
<br />
==== Clock manipulation error ====<br />
:* '''I am getting 'Clock manipulation detected!' error message upon launching MTA:SA<br />
<br />
:This is caused by incorrect system date/time being set (which could be a result of wrong settings or a faulty battery on the pc's motherboard). Setting time and date again should fix the problem.<br />
<br />
:It might also happen if you are using an AMD Athlon 64 X2 processor with some old drivers. Update them at [https://support.amd.com/en-us/download AMD's site].<br />
<br />
==== Halt on launch ====<br />
:* '''When I launch MTA:SA, nothing happens (GTA_SA.exe is running but not loading up)<br />
<br />
:Run MTA:SA with Administrator privileges. To do this, right click on the installer executable, choose 'Properties', go into 'Compatibility' tab and tick the check box on the last field and try again.<br />
<br />
==== General GTA problems ====<br />
:* '''I have unexplainable GTA problems or crashes'''<br />
<br />
:Make sure your computer as well as your GTA install meet the [[Deathmatch_Client_Manual#System_requirements|minimum requirements]] and that you are not running in any 98/2000/XP/2003 compatibility modes.<br />
<br />
:Also try the solutions from these pages:<br />
:* http://gtaforums.com/topic/307992-san-andreas-v1-works-on-windows-vista/<br />
:* [https://web.archive.org/web/20160330172922/http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista http://pullmonkey.com/2007/4/30/how-i-got-gta-san-andreas-to-work-with-a-crappy-os-vista]<br />
<br />
==== Performance Issues Sandy Bridge / Second Generation Intel Core ====<br />
:* '''Slow MTA performance on Sandy Bridge Processors while other games and San Andreas Singleplayer run fine.'''<br />
:There seems to be a issue in combination with the Windows power profile running in power saving mode, you can solve this issue by changing the power profile to high performance when playing MTA:SA.<br />
:* Topic about this issue: [https://forum.mtasa.com/topic/26441-solved-sandy-bridge-performance-issues/ Sandy Bridge performance issues?]<br />
<br />
== Server ==<br />
<br />
=== General ===<br />
==== Fatal error 3 ====<br />
:* '''I'm getting ''Fatal Error 3'' whenever I connect to my server'''<br />
<br />
:This error happens when the server you are trying to connect to is unable to provide you the required downloads, because it does not have http downloading enabled. Be sure to set the '''httpdownload''' configuration tag in your configuration to '''1'''.<br />
==== Download error 9: Error downloading requested files ====<br />
:* '''I'm getting ''Download Error 9: Error downloading requested files'' whenever I connect to my server'''<br />
<br />
:This error happens when the server you are trying to connect to is unable to provide you with a valid link. This results in a 404 (Not found) HTTP error and an error at your end.<br />
<br />
:* If you are running the built-in server ('''httpserver''' is set to '''1''' and '''httpdownloadurl''' is empty), make sure that your HTTP server is accessible (you can try to access it by using a browser) for everyone.<br />
<br />
:* If you have configured an external web server ('''httpdownloadurl''' is set to your custom URL), make sure that your HTTP is accessible and make sure you have read the [[Deathmatch_Server_Manual#Configuring_an_external_web_server | Configuring an external web server]] guide.<br />
<br />
==== CRC mismatch ====<br />
:* '''When clients join my server, their chatbox shows 'CRC mismatch'<br />
:CRC mismatch occurs when either:<br />
:* The server files have been changed, but the resource has not been restarted/refreshed<br />
:* An external http server is being used and the files are not synchronized<br />
<br />
==== Accounts missing ====<br />
:The file ''accounts.xml'' is not used from 1.0.4, it has been replaced by a file called ''internal.db''. To ensure your old accounts information is migrated:<br />
:*Stop the server<br />
:*Make sure your old ''accounts.xml'' is correct<br />
:*Delete ''internal.db''<br />
:*Start the server<br />
<br />
==== Resources missing ====<br />
:From 1.0.4, resource names cannot contain dots.<br />
<br />
==== Download error 28 ====<br />
:Try closing anti-virus or firewall applications. If it then works, try adding an exception to your firewall to allow your http port through.<br />
<br />
==== Accounts disappearing ====<br />
:Account information (or anything else) not being saved correctly can be caused by database corruption. From build 2836, the server checks the integrity of the sqlite database files on startup. If it reports a database error, please read [[How to repair the database files]].<br />
:If you are running an earlier version and are having troubles such as accounts disappearing, you should upgrade your server to the [https://nightly.multitheftauto.com/ lastest build]<br />
<br />
=== Windows-related ===<br />
:No known reported issues in {{Current Version|full}}.<br />
<br />
=== Linux-related ===<br />
====Default nohup creates infinitely big nohup.out====<br />
<br />
:Temporary fix, disable the nohup file: 'nohup ./mta_server > /dev/null &'<br />
<br />
[[es:Problemas Conocidos - FAQ]]<br />
[[it:Bugs noti e FAQ]]<br />
[[ru:Known Issues - FAQ]]<br />
[[de:Known Issues - FAQ]]<br />
[[pt-br:Soluções de Problemas - FAQ]]<br />
[[hu:Known Issues - FAQ]]<br />
[[zh-cn:已知问题 - 常见问题]]<br />
<br />
[[Category:Support]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Server_Scripting_Functions&diff=52761Server Scripting Functions2017-11-04T08:37:27Z<p>Necktrox: http -> https</p>
<hr />
<div><pageclass class="server"></pageclass><br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
This page lists all the '''server-side''' scripting functions that have been implemented and are available as native functions. To request a function or event, use [[Requested Functions and Events]] or https://bugs.mtasa.com.<br />
<br />
Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.<br />
<br />
Head over to [[Modules]] for a list of non-native serverside functions and modules that are available.<br />
<br />
For more functions, check the [[Useful_Functions|useful functions page]].<br />
<br />
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''<br />
__TOC__<br />
<br />
==Account functions==<br />
{{Account_functions}}<br />
<br />
==ACL functions==<br />
{{ACL_functions}}<br />
<br />
==Admin functions==<br />
{{Admin_functions}}<br />
<br />
==Audio functions==<br />
{{Audio_functions}}<br />
<br />
==Announcement functions==<br />
{{Announce_functions}}<br />
<br />
==Blip functions==<br />
{{Blip_functions}}<br />
<br />
==Camera functions==<br />
{{Camera functions}}<br />
<br />
==Clothes and body functions==<br />
{{Clothes and body functions}}<br />
<br />
==Collision shape functions==<br />
{{Collision shape functions}}<br />
<br />
==Cursor functions==<br />
{{Cursor_functions}}<br />
<br />
==Element functions==<br />
{{Element functions}}<br />
<br />
==Event functions==<br />
{{Event_functions}}<br />
<br />
==Explosion functions==<br />
{{Explosion_functions}}<br />
<br />
==File functions==<br />
{{File_functions}}<br />
<br />
==HTTP functions==<br />
{{HTTP_functions}}<br />
<br />
==Input functions==<br />
{{Input_functions}}<br />
<br />
==Map functions==<br />
{{Map_functions}}<br />
<br />
==Marker functions==<br />
{{Marker functions}}<br />
<br />
==Matrix functions==<br />
{{Shared_matrix_functions}}<br />
<br />
==Module functions==<br />
{{Module functions}}<br />
<br />
==Object functions==<br />
{{Object functions}}<br />
<br />
==Ped functions==<br />
{{Ped_functions}}<br />
<br />
==Pickup functions==<br />
{{Pickup functions}}<br />
<br />
==Player functions==<br />
{{Player functions}}<br />
<br />
==Projectile functions==<br />
{{Projectile_functions}}<br />
<br />
==Radar area functions==<br />
{{Radar area functions}}<br />
<br />
==Resource functions==<br />
{{Resource functions}}<br />
<br />
==Server functions==<br />
{{Server functions}}<br />
<br />
==Settings registry functions==<br />
{{Settings registry functions}}<br />
<br />
==SQL functions==<br />
{{SQL_functions}}<br />
<br />
==Team functions==<br />
{{Team functions}}<br />
<br />
==Text functions==<br />
{{Text functions}}<br />
<br />
==Utility functions==<br />
{{Utility functions}}<br />
<br />
==UTF8 Library==<br />
{{UTF8 functions}}<br />
<br />
==Vehicle functions==<br />
{{Vehicle functions}}<br />
<br />
==Water functions==<br />
{{Water functions}}<br />
<br />
==Weapon functions==<br />
{{Weapon functions}}<br />
<br />
==World functions==<br />
{{World functions}}<br />
<br />
==XML functions==<br />
{{XML functions}}<br />
<br />
[[ar:Server Scripting Functions]]<br />
[[de:Server-Seitige Scripting Funktionen]]<br />
[[es:Funciones_del_Server]]<br />
[[pl:Server Scripting Functions]]<br />
[[pt-br:Funções de Scripting do Servidor]]<br />
[[ru:Server Scripting Functions]]<br />
[[tr:Server Scripting Functions]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Changes_in_1.5.5&diff=52335Changes in 1.5.52017-09-21T17:58:31Z<p>Necktrox: </p>
<hr />
<div>{{Changelogs}}<br />
__NOTOC__<br />
* Changelog on Mantis: https://bugs.mtasa.com/changelog_page.php<br />
* Full changelog: https://github.com/multitheftauto/mtasa-blue/commits/master?page=1<br />
<br />
== Main Additions / Changes ==<br />
* Fixed a couple of crashes<br />
* Updated dependencies<br />
* Upgraded build tools and migrated to a Docker-based environment (now, we have support for VS2017 and GCC-6)<br />
* Code cleanups<br />
<br />
== Scripting ==<br />
=== Client ===<br />
* Added [[guiGetCursorType]]<br />
* Added ''player'' element to [[onClientChatMessage]]<br />
* Added ''soundEnable'' parameter to [[createEffect]]<br />
<br />
=== Server ===<br />
* Added [[getDevelopmentMode]], [[setDevelopmentMode]] (client-only before)<br />
* Added [[isResourceArchived]]<br />
<br />
=== Shared (''Client & Server side'') ===<br />
* Added [[debugSleep]]<br />
* Limit range in [[setRainLevel]]<br />
* Extended [[fetchRemote]] by request method, request headers, response headers, authentication, redirection and form fields<br />
* Added RGB parameters to [[onClientDebugMessage]]/[[onDebugMessage]]<br />
* Deprecated ''setControlState''/''getControlState'' in favour of [[setPedControlState]]/[[getPedControlState]]<br />
* Added logging a warning when some functions are used on non-joined players (e.g. when called from [[onPlayerConnect]])<br />
* Fixed [[coroutine.resume]] returning only the first argument<br />
<br />
== Client ==<br />
=== Client: Additions ===<br />
* Added 'localhost' to the hardcoded CEF whitelist<br />
* Enabled [[setPedStat]] for client side peds<br />
* Added black outline option for chat text<br />
* Added support for more gta_sa.exe variants<br />
<br />
=== Client: Bugfixes & Changes ===<br />
* Fixed [[getHeliBladeCollisionsEnabled]] accepting incorrect arguments<br />
* Fixed effect sounds playing at the wrong position (thanks to '''ZRec''')<br />
* Fixed swapped color channels in browsers on Intel integrated graphics<br />
* Changed camera mode used for vehicle targets (for [[setCameraTarget]])<br />
* Fixed [[setObjectBreakable]] not properly working with melee<br />
* Tweaked layout of chatbox settings<br />
* Added chatbox positioning settings<br />
* Fixed radio name not always showing<br />
* Improved disconnect time duration text<br />
* Improved client connecting through firewalls<br />
* Updated CEF<br />
* Fixed helicopter/planes engine sounds being missing sometimes<br />
* Fixed memory leak and crash in password functions<br />
* Potentially fixed crouchbug<br />
* Added some missing translations (thanks to '''Sergeanur''')<br />
<br />
== Server ==<br />
=== Server: Additions ===<br />
* Added password append option to ''authserial'' command<br />
<br />
=== Server: Bugfixes & Changes ===<br />
* Hide account passwords from logs when using the /addaccount command<br />
* Censored [[onClientConsole]] for login command<br />
<br />
== Shared ==<br />
=== Shared: Bugfixes & Changes ===<br />
* Migrated from OpenSSL to mbedtls<br />
* Initial work on macOS server support<br />
<br />
== Resources ==<br />
* Updated ''ipb'' resource to 0.3 (includes code cleanups, tweaked GUI layout and client performance stats)<br />
* Modernised ''play'' gamemode<br />
* Fixed fast jetpack flying with gravity glitch (freeroam)<br />
* Added support for hex colors to killmessages (thanks to '''AboShanab''')<br />
* Tweaked realdriveby a lot (thanks to '''emre1702''')<br />
* Tweaked admin report system (thanks to '''Dezash''')<br />
* Fixed warping to interiors (freeroam)<br />
* Fixed fast-flying glitch with hydra/hunter on custom gravity (freeroam)<br />
* Added support for hex colors to joinquit<br />
* Added support for blowing off heads (headshot)<br />
* Added anti-spam and some sanity checks (freeroam)<br />
<br />
== Editor ==<br />
<br />
<br />
== Extra information ==<br />
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and GitHub repositories:<br />
:* [https://github.com/multitheftauto/mtasa-blue MTA: SA Blue]<br />
:* [https://github.com/multitheftauto/mtasa-resources MTA: SA Official Resources]<br />
<br />
[[Category:Changelog]]<br />
[[Category:Incomplete]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=OnPlayerCommand&diff=51715OnPlayerCommand2017-07-22T23:01:24Z<p>Necktrox: Reverted edits by Pirulax (talk) to last revision by Ccw</p>
<hr />
<div>__NOTOC__<br />
{{Server event}}<br />
This event is triggered when a player issues a command.<br />
{{Note|This event triggers regardless of whether the command exists or not. Also, typing anything in chat will execute command "say", so this event will be triggered on every chat message as well.}}<br />
<br />
==Parameters==<br />
<syntaxhighlight lang="lua"><br />
string command<br />
</syntaxhighlight><br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[player]] who tried to execute a command<br />
<br />
==Cancel effect==<br />
The command will not be executed<br />
<br />
==Example== <br />
This example prevents players executing more than 5 commands a second, recommended for all servers<br />
<syntaxhighlight lang="lua"><br />
local commandSpam = {}<br />
<br />
function preventCommandSpam()<br />
if (not commandSpam[source]) then<br />
commandSpam[source] = 1<br />
-- New person so add to table<br />
elseif (commandSpam[source] == 5) then<br />
cancelEvent()<br />
outputChatBox("Please refrain from command spamming!", source, 255, 0, 0)<br />
-- This person is command spamming!<br />
else<br />
commandSpam[source] = commandSpam[source] + 1<br />
-- Add one to the table<br />
end<br />
end<br />
addEventHandler("onPlayerCommand", root, preventCommandSpam)<br />
setTimer(function() commandSpam = {} end, 1000, 0) -- Clear the table every second<br />
</syntaxhighlight><br />
<br />
{{See also/Server event|Player events}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GetInteriorSoundsEnabled&diff=51617GetInteriorSoundsEnabled2017-07-11T21:43:42Z<p>Necktrox: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
This function checks to see if the music played by default in clubs is disabled or not.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool getInteriorSoundsEnabled ( )<br />
</syntaxhighlight><br />
<br />
==Returns==<br />
Returns true if music is playing, returns false if music is not playing.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
addCommandHandler("check_sounds",<br />
function()<br />
if getInteriorSoundsEnabled() then <br />
outputChatBox("Interior sounds are enabled!!!",0,255,0)<br />
else<br />
outputChatBox("Interior sounds are disabled!!!",255,0,0) <br />
end<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Client world functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GuiEditGetCaretIndex&diff=51614GuiEditGetCaretIndex2017-07-11T20:29:41Z<p>Necktrox: </p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
{{New feature/item|3.0135|1.3.5|6054|<br />
This function returns the caret (the text cursor) position within the editbox.<br />
}}<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int guiEditGetCaretIndex ( element theElement )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''theElement:''' The edit box you want to get the caret position from<br />
<br />
===Returns===<br />
Returns the caret index on success, ''false'' otherwise.<br />
<br />
==Example==<br />
This example outputs the caret position of the edit field to the chat<br />
<syntaxhighlight lang="lua"><br />
local edit = guiCreateEdit(0.4,0.4,0.3,0.1,"",true)<br />
<br />
addEventHandler("onClientGUIChanged",edit,function()<br />
outputChatBox("Caret index is: "..guiEditGetCaretIndex(edit)) -- output index to chat<br />
end)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=GuiScrollBarSetScrollPosition&diff=51613GuiScrollBarSetScrollPosition2017-07-11T20:29:16Z<p>Necktrox: </p>
<hr />
<div>{{client function}}<br />
This function is used to set the scroll amount of a scrollbar as a percentage.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool guiScrollBarSetScrollPosition ( gui-scrollBar theScrollBar, float amount )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
*'''theScrollBar''': The scrollbar you want to change the progress of<br />
*'''amount''': a float ranging from 0 - 100 representing the amount you wish to set the scroll bar.<br />
<br />
===Returns===<br />
Returns true if the scroll position was successfully set, false otherwise.<br />
<br />
==Example==<br />
In this example, you can set the scrolling position using the command /pos <amount><br />
<syntaxhighlight lang="lua"><br />
local window = guiCreateWindow(0.3,0.3,0.3,0.3,"Scroll-Position",true)<br />
local scroll_bar = guiCreateScrollBar(5,25,30,245,false,false,window)<br />
<br />
function scroll_bar_setPos(_,position)<br />
if (tonumber(position)) then -- If we have typed a position<br />
guiScrollBarSetScrollPosition(scroll_bar,position) --Set the position in the scroll bar<br />
end<br />
end<br />
addCommandHandler("pos",scroll_bar_setPos)<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{GUI_functions}}<br />
[[Catogory:Needs_Example]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&diff=51452Template:Useful Functions2017-06-29T11:23:24Z<p>Necktrox: Reverted edits by Salh (talk) to last revision by AlexTMjugador</p>
<hr />
<div>=== ACL functions ===<br />
*[[aclGroupClone]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function clone a group to another group with/without ACLs and/or objects.</span><br />
*[[getPlayerAcls]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all ACL groups on a player.</span><br />
*[[isPlayerInACL]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a player element is in an ACL group.</span><br />
*[[renameAclGroup]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gives an existing ACL group a new name.</span><br />
<br />
=== Account functions ===<br />
*[[setAccountName]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to change an existing account's name.</span><br />
*[[removeAccountData]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to remove data from account .</span><br />
<br />
=== Camera functions ===<br />
*[[smoothMoveCamera]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to create a cinematic camera flight.<br />
<br />
=== Cursor functions ===<br />
*[[getCursorMoveOn]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function draws an animated 2D window on the screen.</span><br />
*[[dxDrawCircle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a number of 2D lines in order to achieve a circle shape on the screen.</span><br />
*[[dxDrawOctagon3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function creates a 3D Octagon</span><br />
*[[dxDrawTriangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a triangle with dx lines.</span><br />
*[[dxDrawLinedRectangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a rectangle outline with dx lines.</span><br />
*[[dxDrawBorderedRectangle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is a function that will create a bordered rectangle .</span><br />
*[[dxDrawGifImage]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D image in GTA world.</span><br />
*[[dxDrawImageOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws an image on any element.</span><br />
*[[dxDrawLoading]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a loading bar on the screen.</span><br />
*[[dxDrawProgressBar]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function simulates a progress bar drawed using DirectDraw.</span><br />
*[[dxDrawRectangle3D]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a 3D rectangle in GTA world.</span><br />
*[[dxDrawTextOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function draws a text on any element.</span><br />
*[[dxGetFontSizeFromHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the font size from given height.</span><br />
*[[dxGetRealFontHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the height of a font.</span><br />
<br />
=== Effects functions ===<br />
*[[attachEffect]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you attach an effect to an element.</span><br />
<br />
=== Elements functions === <br />
*[[getElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the specified element's speed in m/s, km/h or mph.</span><br />
*[[getElementsInDimension]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of elements that are in the specified dimension.</span><br />
*[[getElementsWithinMarker]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of elements that are within a marker's collision shape.</span><br />
*[[isElementInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is moving.</span><br />
*[[isElementWithinAColShape]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if an element is within a collision shape element.</span><br />
*[[multi_check]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks one element to many, handy and clean.</span><br />
*[[setElementSpeed]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function converts an integer (number of bytes) into a human-readable unit.</span><br />
*[[capitalize]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function capitalizes a given string.</span><br />
*[[convertNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts and formats large numbers.</span><br />
*[[convertServerTickToTimeStamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts server ticks to a unix timestamp.</span><br />
*[[convertTextToSpeech]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts the provided text to a speech in the provided language which players can hear.</span><br />
*[[findRotation]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function formats a date on the basis of a format string and returns it.</span><br />
*[[getRealMonthM]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gives you the real months name</span><br />
*[[getRealMonthH]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function convert english months to arabic months</span><br />
*[[generateString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function generates a random string with any characters.</span><br />
*[[generateRandomASCIIString]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a random string which uses ASCII characters. </span><br />
*[[getAge]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function calculates the age of a given birthday.</span><br />
*[[getDistanceBetweenPointAndSegment2D]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function returns easter date monthday and month for a given year.</span><br />
*[[getKeyFromValueInTable]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the key of the specified value in a table.</span><br />
*[[getOffsetFromXYZ]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function finds a point based on a starting point, direction and distance.</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-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a screen relative rotation to a world position.</span><br />
*[[getTimestamp]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the UNIX timestamp of a specified date and time.</span><br />
*[[isLeapYear]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a provided e-mail string is valid.</span><br />
*[[removeHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is used to remove hexadecimal numbers (colors, for example) from strings.<br />
*[[RGBToHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string representing the color in hexadecimal.</span><br />
*[[toHex]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a decimal number to a hexadecimal number, as a fix to be used client-side.</span><br />
*[[secondsToTimeDesc]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function splits a string at a given separator pattern and returns a table with the pieces.</span><br />
*[[switch]] <span style="color:gray; font-family:'Georgia',sans-serif; 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 />
*[[var dump]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function outputs information about one or more variables using outputConsole.</span><br />
*[[wavelengthToRGBA]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function centers a CEGUI window element responsively in any resolution.</span><br />
=====Comboboxes=====<br />
*[[guiComboBoxAdjustHeight]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function adjusts a CEGUI combobox element to have the correct height.</span><br />
=====Gridlists=====<br />
*[[getGridListRowIndexFromText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the GridList row index from the specified text.</span><br />
*[[guiGridListGetSelectedText]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a string containing the inner text of a selected gridlist item.</span><br />
*[[guiGridListAddPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function add all online players to a grid list.</span><br />
*[[isTextInGridList]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if some text exist or not in the GridList.</span><br />
<br />
=== Math functions ===<br />
*[[mathNumber]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function is a workaround for the client-side floating-point precision of 24-bits.</span><br />
*[[math.hypot]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the Hypotenuse of the triangle given by sides x and y.</span><br />
*[[math.percent]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a percentage from two number values.</span><br />
*[[math.round]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» Rounds a number whereas the number of decimals to keep and the method may be set.</span><br />
<br />
=== Ped functions ===<br />
*[[getAlivePlayers (Client)|getAlivePlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players client-side.</span><br />
*[[getAlivePlayersInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the alive players in a team.</span><br />
*[[getOnlineAdmins]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all logged-in administrators.</span><br />
*[[getPedMaxHealth]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a ped's maximum oxygen level by converting it from their maximum underwater stamina stat.</span><br />
*[[getPlayerFromNamePart]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a player from partial name.</span><br />
*[[getPlayerFromSerial]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a player from their serial.</span><br />
*[[getPlayersInGroup]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all Players In Group .</span><br />
*[[getGuestPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets a players not login or players Guest .</span><br />
*[[getDimensionEmpty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns id Dimension Empty .</span><br />
*[[getPlayersByData]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of players that have the specified data name.</span><br />
*[[getPlayersInPhotograph]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all players in photograph.</span><br />
*[[isPedAiming]]<span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a pedestrian is aiming their weapon.</span><br />
*[[isPedDrivingVehicle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a specified pedestrian is driving a vehicle.</span><br />
*[[isPlayerInTeam]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a player is in a specified team.</span><br />
*[[isPedAimingNearPed]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This is similar to isPedAiming but uses a colshape to be more precise.</span><br />
*[[getPedEyesPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get peds eyes position.</span><br />
<br />
=== Resource functions ===<br />
*[[getResourceSettings]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource settings.</span><br />
*[[getResourceScripts]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of the resource scripts.</span><br />
*[[refreshResource]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function refreshes your resource if you changed any of the files<br />
<br />
=== Sound functions ===<br />
*[[isSoundFinished]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a sound element has finished.</span><br />
*[[stopSoundSlowly]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function stop your sound element slowly.</span><br />
<br />
=== Table functions ===<br />
*[[rangeToTable]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function converts a string range to a table containing number values.</span><br />
*[[setTableProtected]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function protects a table and makes it read-only.</span><br />
*[[table.copy]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function copies a whole table and all the tables in that table.</span><br />
*[[table.compare]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether two given tables are equal.</span><br />
*[[table.empty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a table is empty.</span><br />
*[[table.map]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function merges two or more tables together.</span><br />
*[[table.random]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function retrieves a random value from a table.</span><br />
*[[table.size]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the absolute size of a table.</span><br />
*[[table.removeValue]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function removes a specified value from a table.</span><br />
<br />
=== Team functions ===<br />
*[[getTeamFromColor]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a team element by the specified color.</span><br />
*[[getTeamWithFewestPlayers]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a team element with least players of all the specified teams.</span><br />
<br />
=== Vehicle funcions === <br />
*[[getRandomVehicle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function gets a random vehicle.</span><br />
*[[getValidVehicleModels]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of all valid vehicle models.</span><br />
*[[getVehicleRespawnPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to get the respawn position of a vehicle.</span><br />
*[[getVehiclesCountByType]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the amount of vehicles by the given type as an integer value.</span><br />
*[[isVehicleEmpty]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether a vehicle is empty.</span><br />
*[[isVehicleOccupied]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a specified vehicle is occupied.</span><br />
*[[isVehicleOnRoof]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether vehicle is on roof.</span><br />
*[[setVehicleGravityPoint]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.</span><br />
<br />
=== Weapon functions === <br />
*[[getJetpackWeaponsEnabled]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns a table of enabled weapons usable on a jetpack.</span><br />
<br />
=== XML functions ===<br />
*[[getXMLNodes]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns all children of a XML node.</span><br />
<br />
=== Utility ===<br />
*[[Check]] <span style="color:gray; font-family:'Georgia',sans-serif; 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 />
*[[coroutine.resume]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function applies a fix for hidden coroutine error messages.</span><br />
*[[callClientFunction]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to call any server-side function from the client's side.</span><br />
*[[createAnimation]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function allows you to use interpolateBetween without render event and easily used.</span><br />
*[[getBanFromName]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This functions returns the ban of the given playername.</span><br />
*[[getCurrentFPS]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns the frames per second at which GTA: SA is running.</span><br />
*[[IfElse]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function returns one of two values based on a boolean expression.</span><br />
*[[isCursorOnElement]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks whether the cursor is in a particular area.</span><br />
*[[isMouseInCircle]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This function checks if a cursor position is in circular area or not.</span><br />
*[[isMouseInPosition]] <span style="color:gray; font-family:'Georgia',sans-serif; 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-family:'Georgia',sans-serif; font-size:smaller;">» This function returns ''a time-saving'' iterator for your for-loops.</span><br />
*[[vector3:compare]] <span style="color:gray; font-family:'Georgia',sans-serif; font-size:smaller;">» This method checks whether two vectors match, with optional precision.</span><br />
<br />
[[Category:Useful Functions]]</div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Template:CEF_functions&diff=51451Template:CEF functions2017-06-29T11:23:02Z<p>Necktrox: Reverted edits by Salh (talk) to last revision by Lars</p>
<hr />
<div>{{New items|3.0150|1.5|<br />
*[[createBrowser]]<br />
*[[executeBrowserJavascript]]<br />
*[[focusBrowser]]<br />
{{New items|3.0153|1.5.3-9912|<br />
*[[resizeBrowser]]<br />
}}<br />
*[[isBrowserDomainBlocked]]<br />
*[[isBrowserFocused]]<br />
*[[isBrowserLoading]]<br />
*[[getBrowserProperty]]<br />
*[[getBrowserSettings]]<br />
*[[getBrowserTitle]]<br />
*[[getBrowserURL]]<br />
*[[injectBrowserMouseDown]]<br />
*[[injectBrowserMouseMove]]<br />
*[[injectBrowserMouseUp]]<br />
*[[injectBrowserMouseWheel]]<br />
*[[loadBrowserURL]]<br />
*[[canBrowserNavigateBack]]<br />
*[[canBrowserNavigateForward]]<br />
*[[navigateBrowserBack]]<br />
*[[navigateBrowserForward]]<br />
*[[reloadBrowserPage]]<br />
*[[setBrowserProperty]]<br />
*[[setBrowserRenderingPaused]]<br />
*[[setBrowserVolume]]<br />
*[[requestBrowserDomains]]<br />
|}}<br />
{{New items|3.0151|1.5.1|<br />
*[[setBrowserAjaxHandler]]<br />
*[[getBrowserSource]]<br />
*[[toggleBrowserDevTools]]<br />
|}}<br />
===GUI Functions=== <!-- Please see Template:GUI_functions when updating this section! --><br />
*[[guiCreateBrowser]]<br />
*[[guiGetBrowser]]<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>Necktroxhttps://wiki.multitheftauto.com/index.php?title=Client_Scripting_Functions&diff=51450Client Scripting Functions2017-06-29T11:22:51Z<p>Necktrox: Reverted edits by Salh (talk) to last revision by StrixG</p>
<hr />
<div><pageclass class="client"></pageclass><br />
{{Adding_Pages_to_Categories_and_Templates}}<br />
This page lists all the '''client-side''' 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 />
==Audio functions==<br />
{{Client_audio_functions}}<br />
<br />
==Blip functions==<br />
{{Client_blip_functions}}<br />
<br />
==Browser functions==<br />
{{CEF_functions}}<br />
<br />
==Camera functions==<br />
{{Client_camera_functions}}<br />
<br />
==Clothes and body functions==<br />
{{Client_Clothes and body functions}}<br />
<br />
==Collision shape functions==<br />
{{Client_collision_shape_functions}}<br />
<br />
==Cursor functions==<br />
{{Client_cursor_functions}}<br />
<br />
==Drawing functions==<br />
{{Drawing_functions}}<br />
<br />
==Effects functions==<br />
{{Client_Effects_functions}}<br />
<br />
==Element functions==<br />
{{Client_element_functions}}<br />
<br />
==Engine functions==<br />
{{Engine_functions}}<br />
<br />
==Event functions==<br />
{{Client_event_functions}}<br />
<br />
==Explosion functions==<br />
{{Client_explosion_functions}}<br />
<br />
==File functions==<br />
{{Client file functions}}<br />
<br />
==Fire functions==<br />
{{Client fire functions}}<br />
<br />
==GUI functions==<br />
{{GUI_functions}}<br />
<br />
==Input functions==<br />
{{Client_input_functions}}<br />
<br />
==Light functions==<br />
{{Client_light_functions}}<br />
<br />
==Marker functions==<br />
{{Client_marker_functions}}<br />
<br />
==Matrix functions==<br />
{{Shared_matrix_functions}}<br />
<br />
==Object functions==<br />
{{Client_object_functions}}<br />
<br />
==Output functions==<br />
{{Client_output_functions}}<br />
<br />
==Ped functions==<br />
{{Client_ped_functions}}<br />
<br />
==Pickup functions==<br />
{{Client_pickup_functions}}<br />
<br />
==Player functions==<br />
{{Client_player_functions}}<br />
<br />
==Projectile functions==<br />
{{Client_projectile_functions}}<br />
<br />
==Radar area functions==<br />
{{Client_radar-area_functions}}<br />
<br />
==Resource functions==<br />
{{Client_resource_functions}}<br />
<br />
==Searchlight functions==<br />
{{Client_searchlight_functions}}<br />
<br />
==Team functions==<br />
{{Client_team_functions}}<br />
<br />
==Utility functions==<br />
{{Client_utility_functions}}<br />
<br />
==UTF8 Library==<br />
{{UTF8 functions}}<br />
<br />
==Vehicle functions==<br />
{{Client_vehicle_functions}}<br />
<br />
==Water functions==<br />
{{Client_water_functions}}<br />
<br />
==Weapon functions==<br />
{{Client_weapon_functions}}<br />
<br />
==Weapon Creation functions==<br />
<strike>Documentation can be found [http://code.google.com/p/mtasa-blue/source/detail?r=4555 here] [https://github.com/multitheftauto/mtasa-blue/commit/c0ac461867e24fe5fc471fe373ec6212e8736c01 (GitHub)] and [http://code.google.com/p/mtasa-blue/source/detail?r=4557 here] [https://github.com/multitheftauto/mtasa-blue/commit/9c2464b5e0c7d0f2915a9b46273832cd950af48e (GitHub)]</strike><br />
{{Client_weapon_creation_functions}}<br />
<br />
==World functions==<br />
{{Client_world_functions}}<br />
<br />
==XML functions==<br />
{{Client XML functions}}<br />
<br />
[[ar:Client Scripting Functions]]<br />
[[pl:Funkcje po stronie klienta]]<br />
[[it:Funzioni Client-side]]<br />
[[ru:Client Scripting Functions]]<br />
[[es:Funciones del cliente]]<br />
[[de:Clientseitige_Funktionen]]<br />
[[tr:Client Taraflı Fonksiyonlar]]<br />
[[zh-cn:客户端脚本函数]]</div>Necktrox