<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cristiano+Cardoso</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cristiano+Cardoso"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Cristiano_Cardoso"/>
	<updated>2026-05-08T05:50:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=69036</id>
		<title>Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=69036"/>
		<updated>2021-02-16T22:08:06Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: [+] link para tutorial CEF (navegador)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding: 5px; height: 130px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px]]'''Bem vindo ao Wiki do Multi Theft Auto.''' Aqui você encontra tudo sobre o uso desta modificação.&lt;br /&gt;
&lt;br /&gt;
Há muitas [[How you can help|coisas em que você pode nos ajudar]] para melhorar este programa, como criar um mapa, um modo de jogo, documentar funções e eventos, escrever códigos úteis para outros usuários, fazer tutoriais, reportar bugs que encontrar ou somente jogar a vontade!&lt;br /&gt;
&lt;br /&gt;
Se você tem alguma dúvida a respeito do Multi Theft Auto, não se esqueça de perguntar à comunidade em nossos [http://forum.mtasa.com/ fóruns].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[ Pare de jogar sozinho ]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Jogar&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Baixe o Multi Theft Auto {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Onde_adquirir_o_GTASA|Onde adquirir o GTASA]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Cliente|Manual do usuário]]&lt;br /&gt;
&amp;lt;!--* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Novidades_na_versão_{{Current Version|full}}|Novidades da última versão ]] --&amp;gt;&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[Changes_in_{{padleft:|5|{{Current Version|full}}}}| Novidades da versão {{padleft:|5|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Soluções_de_Problemas_-_FAQ|Solução de problemas]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Migrando_do_MTA:Race_ao_MTA:SA_1.3|Migrando do MTA:Race para o MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Servidor|Manual do servidor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Recursos:Map_Manager|Gerenciador de mapas (''Map Manager'')]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Editor de mapas&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor|Manual do editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor-EDF|Ficheiro de definições do editor (EDF)]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor-Plugins|Extensões para o editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor#FAQ|Perguntas frequentes (FAQ)]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Banco de dados&amp;lt;/h3&amp;gt;&lt;br /&gt;
Aqui tem tudo relacionado às vantagens que Lua tem a oferecer ao MTA e seus recursos.&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[:Category:Resource|Catálogo de Recursos]] - Você deve aprender com eles para fazer scripts bons&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Scripts_do_Cliente|Scripts do Cliente]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Módulos|Módulos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Desenvolvimento do Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Últimas compilações]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA|Compilando o MTASA no Windows]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Mac_OS_X|Compilando o MTASA no Mac OS X]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Linux|Compilando o MTASA no Linux]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Guia_do_Desenvolvedor|Guia do Desenvolvedor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]      [https://github.com/multitheftauto/mtasa-blue Repositório Github]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Roadmap|Roteiro para versões futuras]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]      [http://bugs.mtasa.com/ Central de bugs]&lt;br /&gt;
* [[File:iUS.png|En Inglês|20px]]      [[Branches|Ramos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Como você pode nos ajudar&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Documentar funções ou eventos&lt;br /&gt;
* Criar exemplos funcionais e eficientes de funções e eventos&lt;br /&gt;
* Examinar e corrigir as páginas&lt;br /&gt;
* Escrever tutoriais para ajudar novatos&lt;br /&gt;
* Ajudar a traduzir as páginas da Wiki para outras linguagens&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Comunidade&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.multitheftauto.com/ Fóruns]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [irc://irc.multitheftauto.com/mta IRC]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://community.mtasa.com/ Comunidade]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://twitter.com/#!/MTAQA/ Twitter] &lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.youtube.com/user/MTAQA Youtube]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://plus.google.com/102014133442331779727/ Google]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introdução_ao_Scripting|Introdução a ''scripting'']]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introducao_ao_GUI_scripting|Introdução a ''scripting'' de UI]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[Depuração|Depuração]] - Encontre erros em seu Script&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Recursos|Introdução a recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Acesso web via recursos|Acesso web via recursos]] - Abra servidores web através de recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/Tutorial_CEF|Tutorial CEF]] - Como usar o navegador web em seus recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[:Category:PT-BR/Recursos|Lista de recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[O arquivo Meta|Meta.xml]] - Todo recurso possui um arquivo meta descrevendo a si próprio&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Lista de Controle de Acesso|Lista de controle de acesso (ACL)]] - Componente vital para recursos complexos&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Composição_de_Gamemodes|Composição de modos de jogo]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Links dos fóruns&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [http://forum.mtasa.com/viewforum.php?f=152 Secção do fórum para dúvidas sobre ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewforum.php?f=148 Guias de ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Wiki ''offline'']&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Manuais sobre Lua&amp;lt;/h3&amp;gt;&lt;br /&gt;
Página muito útil para ajuda-lo a entender o funcionamento do Lua&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/portugues.html Introdução à linguagem]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html Manual básico]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/manual/5.1/pt/ Manual de referência]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://lua-users.org/wiki/TutorialDirectory Outra wiki, somente de Lua]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Referência&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Funções_de_Scripting_do_Cliente|Funções de Scripting do Cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Events|Eventos do cliente]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Funções_de_Scripting_do_Servidor|Funções de Scripting do Servidor]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Eventos_de_Scripting_do_Servidor|Eventos de Scripting do Servidor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[PT-BR/Funções_Úteis|Funções Úteis]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[MTA Classes|Classes do Multi Theft Auto]] - Informações detalhadas sobre todas as classes do MTA&lt;br /&gt;
** [[File:iUS.png|Em Inglês|20px]] [[Element tree|Árvore dos elementos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|Lista de IDs de objetos e texturas]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animações]]&lt;br /&gt;
*[[Character Skins|''Skins'' de pedestres]]&lt;br /&gt;
*[[Roupas do CJ|Roupas do CJ]]&lt;br /&gt;
*[[Garage|Garagens]]&lt;br /&gt;
*[[Interior IDs|Interiores]]&lt;br /&gt;
*[[Material IDs|Materiais]]&lt;br /&gt;
*[[Projectiles|Projéteis]]&lt;br /&gt;
*[[Radar Blips|''Blips'']]&lt;br /&gt;
*[[Sounds|Efeitos sonoros]]&lt;br /&gt;
*[[Vehicle IDs|Veículos]]&lt;br /&gt;
*[[Vehicle Colors|Cores dos veículos]]&lt;br /&gt;
*[[Vehicle Upgrades|Acessórios dos veículos]]&lt;br /&gt;
*[[Vehicle variants|Variantes dos veículos]]&lt;br /&gt;
*[[Weapons|Armas]]&lt;br /&gt;
*[[Weather|Ambientação]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:pBR.png|32px]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Sobre a Tradução&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Tradutores:&lt;br /&gt;
** [https://forum.mtasa.com/profile/19686-racextreme/|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;RaceXtreme&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/27827-stanley-sathler/|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;StanleySathler&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/24588-dnl291/|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;DNL291&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/30695-ymassai/|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Ninguem&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/31772-anderl/|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Anderl&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/71215-kronos-lettify|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;KronoS Lettify&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [https://forum.mtasa.com/profile/69598-eficiencia/|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Eficiencia&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
É importante que todos colaborem para que nossa página em português fique melhor a cada dia!&lt;br /&gt;
&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/]]&lt;br /&gt;
'''Multi Theft Auto''' é um projeto '''open source'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Sobre o Multi Theft Auto'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive|Arquivos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage|Eventos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Desenvolvedores]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Baixe-o]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Solução de problemas]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Status da Wiki'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} artigos&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} páginas&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} usuários registrados&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|pt-br}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=69035</id>
		<title>CEF Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CEF_Tutorial&amp;diff=69035"/>
		<updated>2021-02-16T22:05:46Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: [+] link to translated pt_BR page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives you a brief introduction to CEF.&lt;br /&gt;
&lt;br /&gt;
=What is CEF?=&lt;br /&gt;
CEF stands for '''C'''hromium '''E'''mbedded '''F'''ramework and is a framework for embedding Chromium-based browsers in other applications - in our case MTA. CEF is based on Google's Chromium project so it is also a fast, secure and stable web engine.&lt;br /&gt;
&lt;br /&gt;
You can find more information about CEF on CEF's GoogleCode project page: https://bitbucket.org/chromiumembedded/cef&lt;br /&gt;
&lt;br /&gt;
=The basics=&lt;br /&gt;
Creating a new browser is really simple. Let's open YouTube for example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a new remote browser (size is 800*600px) with transparency enabled&lt;br /&gt;
local browser = createBrowser(800, 600, true, true)&lt;br /&gt;
&lt;br /&gt;
-- &amp;quot;Wait&amp;quot; for the browser (this is necessary because CEF runs in a secondary thread and hence requires the 'asynchronous' event mechanism)&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, browser,&lt;br /&gt;
    function()&lt;br /&gt;
        -- We're ready to load the URL now (the source of this event is the browser that has been created)&lt;br /&gt;
        loadBrowserURL(source, &amp;quot;https://youtube.com/&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example does not require any domain requests as YouTube is whitelisted by default. More about domain requests below.&lt;br /&gt;
&lt;br /&gt;
=Domain request system=&lt;br /&gt;
In order to prevent people from abusing the possibilities CEF offers, we decided to introduce a request system.&lt;br /&gt;
This means the domain you want to load has to meet at least one of the following requirements:&lt;br /&gt;
*it is whitelisted globally by the MTA team (you can create a post in [this topic] to suggest a new domain to be whitelisted) - '''**TODO: Add forum URL here**'''&lt;br /&gt;
*the domain was requested via requestBrowserDomains/Browser.requestDomains and accepted by the player '''before'''&lt;br /&gt;
*the domain is on the user's whitelist (MTA settings =&amp;gt; Tab: Browser =&amp;gt; Whitelist)&lt;br /&gt;
&lt;br /&gt;
Apart from these options, a domain might be blacklisted due to malicious content. Such domains cannot be requested.&lt;br /&gt;
&lt;br /&gt;
=Local vs remote mode=&lt;br /&gt;
There are two modes CEF can run in:&lt;br /&gt;
&lt;br /&gt;
Characteristics of local mode:&lt;br /&gt;
*you '''can''' execute Javascript code without any restriction (See: [[executeBrowserJavascript]])&lt;br /&gt;
*you '''can''' only load websites stored in the resource folder&lt;br /&gt;
*you '''cannot''' load remote content&lt;br /&gt;
&lt;br /&gt;
Characteristics of remote mode:&lt;br /&gt;
*you '''cannot''' execute Javascript code&lt;br /&gt;
*you '''can''' only load remote content&lt;br /&gt;
*keep in mind that either loading remote websites or Javascript on remote websites can be disabled in the MTA settings&lt;br /&gt;
&lt;br /&gt;
Changing the mode after the browser was created is not possible due to technical reasons.&lt;br /&gt;
&lt;br /&gt;
=Resource management=&lt;br /&gt;
==How to load local HTML files==&lt;br /&gt;
Loading local HTML files works similar to loading images.&lt;br /&gt;
&lt;br /&gt;
Add your HTML files to your meta.xml through the file tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myAwesomeUI.html&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to load local resources in local HTML files==&lt;br /&gt;
Imagine you want to load an image or play a video from your MTA resource. This is possible via a custom URI scheme named '''''&amp;quot;http://mta/&amp;quot;'''''&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
This examples shows how to play a video. Note that you have to enable OOP.&lt;br /&gt;
====Lua====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Create a browser (local mode is also required to access local data)&lt;br /&gt;
local webView = Browser(640, 480, true, true)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webView,&lt;br /&gt;
     function()&lt;br /&gt;
    &lt;br /&gt;
          -- Load HTML UI&lt;br /&gt;
          webView:loadURL(&amp;quot;http://mta/local/html/myVideo.html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/myVideo.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;media/myVideo.webm&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====HTML====&lt;br /&gt;
This is the most interesting part:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot; controls&amp;gt;&lt;br /&gt;
         &amp;lt;source src=&amp;quot;http://mta/local/myVideo.webm&amp;quot; type=&amp;quot;video/webm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Lua &amp;lt;==&amp;gt; Javascript communication=&lt;br /&gt;
First of all, communication between Lua and Javascript is only available in local mode due to security reasons.&lt;br /&gt;
&lt;br /&gt;
==Lua to Javascript==&lt;br /&gt;
Lua to javascript is pretty easy as you can execute Javascript code from Lua using [[executeBrowserJavascript]].&lt;br /&gt;
&lt;br /&gt;
So, a bit Lua code around it and you have got the first direction:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/WebWindow.lua#L180-189&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/mtaevents.js#L9-L15&lt;br /&gt;
&lt;br /&gt;
==Javascript to Lua==&lt;br /&gt;
You are able to trigger a client event via the Javascript method ''triggerEvent'' which is part of the static class/namespace ''mta''.&lt;br /&gt;
The syntax is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mta.triggerEvent(string event, var parameter1, var parameter2, var parameter3, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The source of this event is always the browser element that triggered the event.&lt;br /&gt;
&lt;br /&gt;
An example is available here:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/html/ui2.html#L66&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/Main.lua#L35-L40&lt;br /&gt;
&lt;br /&gt;
=Debugging=&lt;br /&gt;
The ''web development mode'' can be enabled as follows (type it in the client's F8 console):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;start runcode&lt;br /&gt;
crun setDevelopmentMode(true, true)&lt;br /&gt;
debugscript 3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now, you should be able to see web errors and blocked domains/URLs in the debug window at the bottom.&lt;br /&gt;
&lt;br /&gt;
=Things you should keep in mind while working with CEF=&lt;br /&gt;
You should always keep in mind that some modern browser features are not available on some computers.&lt;br /&gt;
This is for example true for '''WebGL'''.&lt;br /&gt;
&lt;br /&gt;
Another problematic feature is '''Adobe Flash'''. Adobe Flash is enabled by default, but you should avoid using it due to the fact that plugins can be disabled in the settings on the one hand (Java is disabled completely by the way) and Flash is very restrictive on the other hand. Restrictive means it runs in a separate process uses a very old interface and offers therefore just a few ways to control it.&lt;br /&gt;
As a consequence, you cannot control the volume of flash objects. Fortunately, HTML5 is an even better replacement and provides very good audio and video interface (http://www.w3schools.com/tags/ref_av_dom.asp) which even supports 3D sound (@all bored people among us: Feel free to write a 3D sound 'wrapper' that maps the GTA onto HTML5 coordinates :P).&lt;br /&gt;
&lt;br /&gt;
=Advanced usage=&lt;br /&gt;
Since our CEF implementation does not do z-ordering by default, you have to provide your own z-ordering mechanism.&lt;br /&gt;
You can find a basic implementation of such a mechanism here: https://github.com/Jusonex/mtasa_cef_tools&lt;br /&gt;
There are also a few utility functions that allow you to integrate these classes easily into your own object-oriented UI system.&lt;br /&gt;
I'll provide some code to use CEF along with CEGUI soon too.&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
Creating lots of browsers does not influence MTA directly (except the fact MTA has to copy the texture data in the main/GTA thread due to technical restrictions), because one part of CEF runs in another process and the other part in a secondary thread.&lt;br /&gt;
So if you do not want to show the browser, it is definitely the best to destroy the browser. If you cannot destroy the browser (imagine you have to save the website's state for some reason), you can save a lot of resources by disabling rendering via [[setBrowserRenderingPaused]]. This will stop CEF from rendering new frames/processing input and MTA from copying the texture data.&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
===google.com doesn't work (even though I requested google.com)===&lt;br /&gt;
Google redirects to a country-specific website by default. If you want to prevent Google from doing this, load the following URL: https://www.google.com/ncr&lt;br /&gt;
&lt;br /&gt;
=Scripting functions=&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
=Scripting events=&lt;br /&gt;
{{CEF_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
[[pt-br:Tutorial_CEF]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Tutorial_CEF&amp;diff=69034</id>
		<title>PT-BR/Tutorial CEF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Tutorial_CEF&amp;diff=69034"/>
		<updated>2021-02-16T22:03:32Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: [+] tradução para Tutorial CEF (navegador)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta página possui uma breve introdução ao CEF.&lt;br /&gt;
&lt;br /&gt;
=O que é CEF?=&lt;br /&gt;
CEF é um acrônimo para '''C'''hromium '''E'''mbedded '''F'''ramework. Consiste em um ''framework'' para embutir navegadores baseados no Chromium em outras aplicações, neste caso, o MTA. CEF é construido a partir do projeto Chromium mantido pela Google, este por sua vez consiste em um motor web rápido, estável e seguro. É possível encontrar mais informações sobre o CEF em sua página do GoogleCode: https://bitbucket.org/chromiumembedded/cef&lt;br /&gt;
&lt;br /&gt;
=Conceitos Básicos=&lt;br /&gt;
Criar uma nova instância do navegador é bem simples. Segue o exemplo para abrir a página do Youtube:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Criar um novo navegador remoto (seu tamanho é 800x600px), com transparência habilitada&lt;br /&gt;
local browser = createBrowser(800, 600, true, true)&lt;br /&gt;
&lt;br /&gt;
-- Aguardar pelo navegador (isso é necessário porque o CEF roda em uma thread separada, portanto é necessário adotar o sistema de eventos assíncronos)&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, browser,&lt;br /&gt;
    function()&lt;br /&gt;
        -- Agora é possível carregar a URL (o &amp;quot;source&amp;quot; desse evento é o navegador que foi criado)&lt;br /&gt;
        loadBrowserURL(source, &amp;quot;https://youtube.com/&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Este exemplo não requer solicitação de domínio já que o Youtube está na lista de domínios autorizados do MTA.&lt;br /&gt;
&lt;br /&gt;
=Sistema de Requisição de Domínios=&lt;br /&gt;
De modo a prevenir abuso quanto as possibilidades que o CEF oferece, decidiu-se introduzir um sistema de controle. Isso significa que domínios desconhecidos não serão carregados automaticamente caso não cumprir com pelo menos uma das exigências a seguir:&lt;br /&gt;
* estar incluso na lista mantida pelo time de desenvolvimento do MTA&lt;br /&gt;
* ser autorizado pelo usuário após a chamada via ''script'' da função &amp;lt;code&amp;gt;requestBrowserDomains/Browser.requestDomains&amp;lt;/code&amp;gt;&lt;br /&gt;
* estar incluso na lista de domínios permitidos do usuário, esta disponível em: Configurações do MTA &amp;amp;rarr; Aba: Navegador &amp;amp;rarr; ''Whitelist''&lt;br /&gt;
&lt;br /&gt;
Alguns domínios são conhecidos por conter conteúdo malicioso, portanto há uma chance desse estar na lista proibida - esta gerenciada automaticamente pelo MTA. Neste caso, nenhuma das alternativas citadas acima funcionará, portanto, todas as solicitações a ele serão negadas. Não há nada que o usuário ou o desenvolvedor possa fazer. Caso haja algum engano, é sugerido contatar nosso time de suporte.&lt;br /&gt;
&lt;br /&gt;
=Modo remoto versus local=&lt;br /&gt;
Existem dois modos que o CEF pode rodar:&lt;br /&gt;
&lt;br /&gt;
1. Modo local:&lt;br /&gt;
* é possível executar código em Javascript sem restrição (vide: [[executeBrowserJavascript]])&lt;br /&gt;
* é possível carregar sítios hospedados somente na pasta &amp;lt;code&amp;gt;resource&amp;lt;/code&amp;gt;&lt;br /&gt;
* ''não'' é permitido carregar conteúdo remoto (e.g. www.mtasa.com)&lt;br /&gt;
&lt;br /&gt;
2. Modo remoto:&lt;br /&gt;
* ''não'' é permitido executar código em Javascript&lt;br /&gt;
* é permitido carregar somente conteúdo remoto&lt;br /&gt;
* lembre-se que o usuário pode desabilitar o carregamento de ''websites'' remotos ou a execução de Javascript nas configurações&lt;br /&gt;
&lt;br /&gt;
Vale ressaltar que não é possível mudar o modo do navegador após sua criação devido a limitações técnicas.&lt;br /&gt;
&lt;br /&gt;
=Gerenciamento de Recursos=&lt;br /&gt;
==Como carregar arquivos HTML locais==&lt;br /&gt;
Carregar um arquivo HTML local funciona de forma similar a carregar imagens.&lt;br /&gt;
&lt;br /&gt;
Adicione o caminho para o arquivo HTML no &amp;lt;code&amp;gt;meta.xml&amp;lt;/code&amp;gt; usando a seguinte tag:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/minhaInterface.html&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Como carregar arquivos locais dentro do HTML==&lt;br /&gt;
Suponha que seja necessário carregar uma imagem ou reproduzir um vídeo que foi incluso no seu pacote do MTA. Isso é possível através de um URI específico no formato: '''''&amp;quot;http://mta/&amp;quot;'''''&lt;br /&gt;
&lt;br /&gt;
===Exemplo===&lt;br /&gt;
Este exemplo mostra como reproduzir um vídeo. Note que é necessário habilitar programação orientada a objeto.&lt;br /&gt;
====Lua====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Cria um navegador (modo local também é obrigatório para acessar arquivos locais)&lt;br /&gt;
local janelaNavegador = Browser(640, 480, true, true)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, janelaNavegador,&lt;br /&gt;
     function()&lt;br /&gt;
          -- Carregar interface em HTML&lt;br /&gt;
          janelaNavegador:loadURL(&amp;quot;http://mta/local/html/meuVideo.html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
     end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====meta.xml====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;html/meuVideo.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;file src=&amp;quot;midia/meuVideo.webm&amp;quot;/&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====HTML====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;video width=&amp;quot;640&amp;quot; height=&amp;quot;480&amp;quot; controls&amp;gt;&lt;br /&gt;
         &amp;lt;!-- todo arquivo local deve ter o prefixo http://mta/local --&amp;gt;&lt;br /&gt;
         &amp;lt;source src=&amp;quot;http://mta/local/midia/meuVideo.webm&amp;quot; type=&amp;quot;video/webm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Comunicação bidirecional entre Lua e JS=&lt;br /&gt;
A comunicação entre Lua e Javascript (JS) está somente disponível no modo local devido à razões de segurança.&lt;br /&gt;
&lt;br /&gt;
==Lua para JS==&lt;br /&gt;
É possível chamar código em Javascript a partir do Lua usando a função [[executeBrowserJavascript]].&lt;br /&gt;
&lt;br /&gt;
Os links a seguir contém mais detalhes de como isso é implementado:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/WebWindow.lua#L180-189&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/src/mtaevents.js#L9-L15&lt;br /&gt;
&lt;br /&gt;
==JS para Lua==&lt;br /&gt;
É possível adicionar um evento-cliente no Javascript usando a função ''triggerEvent'' a qual é parte da classe estática ''mta''.&lt;br /&gt;
Segue a sintaxe:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mta.triggerEvent(string evento, var parametro1, var parametro2, var parametro3, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A fonte (variável &amp;quot;source&amp;quot;) desse evento é sempre o elemento navegador que acionou este evento.&lt;br /&gt;
&lt;br /&gt;
Estão disponíveis exemplos nos seguintes links:&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/html/ui2.html#L66&lt;br /&gt;
* https://github.com/Jusonex/mtasa_cef_tools/blob/master/webui/examples/Main.lua#L35-L40&lt;br /&gt;
&lt;br /&gt;
=Depuração=&lt;br /&gt;
O modo ''desenvolvedor'' pode ser habilitado da seguinte forma (digite no console após pressionar F8):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;start runcode&lt;br /&gt;
crun setDevelopmentMode(true, true)&lt;br /&gt;
debugscript 3&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora é possível visualizar os erros no navegador e os domínios/URLs bloqueados na janela de depuração no canto inferior da tela.&lt;br /&gt;
&lt;br /&gt;
=Pontos de atenção=&lt;br /&gt;
Importante lembrar que nem todas os recursos de um navegador recente estão disponíveis nos computadores de seus usuários. Um exemplo disso é o '''WebGL'''.&lt;br /&gt;
&lt;br /&gt;
'''Adobe Flash''' também é um recurso problemático. É um complemento habilitado por padrão, porém deve ser evitado porque é possível desabilita-lo nas configurações. Além disso, o Flash, por ser uma tecnologia defasada, não oferece muitas oportunidades para o desenvolvimento de funcionalidades que atendam às expectativas do usuário. Mais especificamente, o flash roda em um processo separado que está limitado a uma interface antiga (aquele dos anos 2010), o qual o desenvolvedor possui pouco controle sob ela. A alternativa recomendada é o ''HTML5'', porque além de ser amplamente adotada, possui uma ótima API para reprodução de áudio/vídeo (http://www.w3schools.com/tags/ref_av_dom.asp). Até mesmo há suporte a áudio 3D.&lt;br /&gt;
&lt;br /&gt;
=Uso Avançado=&lt;br /&gt;
Como a implementação do CEF não contempla o ''z-ordering'' por padrão, é necessária uma implementação própria. A especificação sobre esse mecanismo pode ser encontrada em: https://github.com/Jusonex/mtasa_cef_tools&lt;br /&gt;
Há também algumas funções auxiliares para integrar essas classes facilmente com sua própria interface usando OOP. Será também criado um tutorial de como usar o CEF com o CEGUI.&lt;br /&gt;
&lt;br /&gt;
=Desempenho=&lt;br /&gt;
Criar várias instâncias de navegador não afeta o MTA diretamente porque o CEF roda em um processo distinto. Porém, devido a limitações técnicas, o MTA necessita de uma cópia dos dados de texturas na ''thread'' principal do GTA.&lt;br /&gt;
&lt;br /&gt;
Caso não seja necessário manter o navegador visível, é recomendado encerra-lo para economizar recursos. Porém, caso ainda seja importante deixar o navegador rodando (e.g. manter o estado da página), é possível otimizar o desempenho desabilitando a renderização da página via [[setBrowserRenderingPaused]]. Isso faz com que o CEF pare de atualizar novos quadros e o MTA também irá pausar a cópia de textura.&lt;br /&gt;
&lt;br /&gt;
=Solução de Problemas=&lt;br /&gt;
===google.com não funciona===&lt;br /&gt;
Por padrão, ao acessar o endereço &amp;lt;code&amp;gt;google.com&amp;lt;/code&amp;gt;, o usuário é redirecionado para um site filial específico dependendo do país em que está. No Brasil, por exemplo, o internauta é transferido para o &amp;lt;code&amp;gt;google.com.br&amp;lt;/code&amp;gt;. É possível contornar esse problema ao acessar o seguinte endereço: https://www.google.com/ncr.&lt;br /&gt;
&lt;br /&gt;
=Funções de Scripting=&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
=Eventos de Scripting=&lt;br /&gt;
{{CEF_events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
[[en:CEF_Tutorial]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource_Web_Access&amp;diff=68356</id>
		<title>Resource Web Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource_Web_Access&amp;diff=68356"/>
		<updated>2021-01-21T15:57:26Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: add link to pt-br page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Multi Theft Auto Server provides a web interface that resources can use in a variety of ways. This document's purpose is to explain what these ways are and how to go about using them.&lt;br /&gt;
{{Note|If you are looking for a tutorial on how to use the in-game web browser and create websites using CEF, please visit [[CEF_Tutorial|CEF Tutorial]] instead.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
There are two key parts that make up this system. The first is a standard web server that allows web browsers to request pages and files you have in a resource. The second is a system for allowing web browsers to call functions you have exported from your resource.&lt;br /&gt;
&lt;br /&gt;
==Pages==&lt;br /&gt;
===Specifying a file in the meta===&lt;br /&gt;
You can specify in your resource's meta file that certain files are accessible through the web server. To do this, you add a line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;filename.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can then access this file from your web browser by visiting: http://host:port/resourcename/filename.ext&amp;lt;br/&amp;gt;&lt;br /&gt;
For example, on a locally hosted server using default http port with webmap started: http://127.0.0.1:22005/webmap/map.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary files===&lt;br /&gt;
Despite the misleading name, files specified using the html node can be of any type. If they are binary files (like images, zip files) then you need to specify this in the meta file, by adding ''raw=&amp;quot;true&amp;quot;'' to the ''html'' node. This means that the files are not preprocessed before being sent to the web browser.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;image.gif&amp;quot; raw=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parsed files===&lt;br /&gt;
If a file is not specified in the metafile as &amp;quot;raw&amp;quot;, then it is passed through a pre-processor before it is returned to the client. This pre-processor works much like PHP or ASP but uses Lua. You can embed standard MTA scripts within HTML pages, controlling the output. Almost all standard MTA functions work, plus a number of special [[Template:HTTP functions|HTTP Functions]], such as [[httpWrite]], a function that outputs text to the buffer.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        This resource is called &amp;lt;* httpWrite( getResourceName(getThisResource()) ) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a shorthand (in common with PHP and ASP) for this code, meaning that you can also write the above code as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        This resource is called &amp;lt;* = getResourceName(getThisResource()) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Aside from HTTP functions, embedded Lua has access to the following environment variables that contain information about how the page was requested:&lt;br /&gt;
* table '''requestHeaders''': This is a table containing all the headers that were requested with the page. You can set returned headers using [[httpSetResponseHeader]]. &lt;br /&gt;
* table '''form''': This is a table containing all the form data submitted to the page using HTTP POST combined with any variables passed in the querystring with HTTP GET.&lt;br /&gt;
* table '''cookies''': This is a table of all the cookies. You can modify cookies using [[httpSetResponseCookie]].&lt;br /&gt;
* string '''hostname''': This is a string containing the IP address or hostname that requested the page.&lt;br /&gt;
* string '''url''': This is the URL of the page.&lt;br /&gt;
* account '''user''': This is the account of the current user.&lt;br /&gt;
&lt;br /&gt;
It's important to note that parsed files are run in a separate virtual machine from the rest of your resource's code. As such, if you want to call a function in your resource's main code, you need to export the function and use the [[call]] function from your parsed file.&lt;br /&gt;
&lt;br /&gt;
==Calls==&lt;br /&gt;
You can specify that certain exported functions in your resource are able to be called from the HTTP interface. All the SDKs (listed below) allow you to call these functions from a remote location. &lt;br /&gt;
&lt;br /&gt;
To specify an exported http-accessible function, add the following to your meta.xml file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;export function='functionName' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can code your function just as you would any normal function, returning as many values as you want, including tables and resources and most important elements. You ''cannot'' however return other 'userdata' values such as [[xmlnode|xmlnodes]] or functions.&lt;br /&gt;
&lt;br /&gt;
===Protocol===&lt;br /&gt;
{{Note|You don't need to know this unless you're writing your own HTTP request code. You can just use one of the [[#SDK|SDKs listed below]].}}&lt;br /&gt;
&lt;br /&gt;
Calls are done by requesting ''&amp;lt;nowiki&amp;gt;http://&amp;lt;your IP&amp;gt;:&amp;lt;your port&amp;gt;/&amp;lt;resource_name&amp;gt;/call/&amp;lt;exported_function_name&amp;gt;&amp;lt;/nowiki&amp;gt;'' using HTTP POST. The body of the request should be a JSON array of the arguments for the function.&lt;br /&gt;
&lt;br /&gt;
The request will return a JSON array of the value(s) returned from the function as the HTTP response.&lt;br /&gt;
&lt;br /&gt;
The server supports HTTP Basic authentication and you can configure access via the ACL and the built-in accounts system.&lt;br /&gt;
&lt;br /&gt;
===Calls from the HTTP web interface===&lt;br /&gt;
Using calls is probably easiest from the web interface and can be done almost seamlessly.&lt;br /&gt;
&lt;br /&gt;
First, add this to your meta.xml file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, add the following to the &amp;lt;head&amp;gt; section of the page you want to call from:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, you can create a javascript block on your page and call your functions almost as if they were local. The only difference is that the calls are asynchronous - you should specify a callback function as the last argument for your call. This is called when the function returns.&lt;br /&gt;
&lt;br /&gt;
Here's a simple example.&lt;br /&gt;
&lt;br /&gt;
'''meta.xml'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;script src='code.lua' /&amp;gt;&lt;br /&gt;
   &amp;lt;html src='page.htm' default='true' /&amp;gt;&lt;br /&gt;
   &amp;lt;export function='showChatMessage' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''code.lua'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showChatMessage ( message )&lt;br /&gt;
    outputChatBox ( message )&lt;br /&gt;
    return 5;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''page.htm'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
        &amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;
            function say() {&lt;br /&gt;
                var message = document.getElementById('message')&lt;br /&gt;
                showChatMessage ( message.value, &lt;br /&gt;
                    function ( number ) {&lt;br /&gt;
                        // the function has been called and returned something&lt;br /&gt;
                        message.value = &amp;quot;The function returned &amp;quot; + number;&lt;br /&gt;
                    }&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;input type='text' id='message' /&amp;gt;&amp;lt;input type='button' value='say' onclick='say();' /&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see (fairly complex) examples of how this can be done in the resources ''resourcebrowser'', ''resourcemanager'' and ''webadmin''.&lt;br /&gt;
&lt;br /&gt;
==Securing the web interface==&lt;br /&gt;
The [[ACL]] has a number of rights that can affect what files can be accessed.&lt;br /&gt;
{{Deprecated feature|3.0139|1.3.1|&lt;br /&gt;
* general.http: If disabled, none of the HTTP files can be accessed (except by game clients)&lt;br /&gt;
** '''Important Note''': ''If 'general.http' is enabled, HTTP access to all resources (for that ACL) is enabled by default. To disable HTTP access you have to explicitly block access to resources that contain exported HTTP functions.''&lt;br /&gt;
** '''Important Note''': ''If 'general.http' is enabled on an ACL which has a user with no password (i.e. user.* or user.guest or user.http_guest), it is essential that you explicitly block access to resources that contain exported HTTP functions.''&lt;br /&gt;
* resource.'''ResourceName''': If disabled, none of the files in the resource can be accessed&lt;br /&gt;
* resource.'''ResourceName'''.file.'''FileName''': If disabled, the file named cannot be accessed&lt;br /&gt;
* resource.'''ResourceName'''.function.'''FunctionName''': If disabled, the function cannot be called&lt;br /&gt;
These work as with other ACL rights - you can disable them for normal users and just enable them for Admin users, or any other group of users you wish.&lt;br /&gt;
}}&lt;br /&gt;
{{New_feature|3.0139|1.3.1|&lt;br /&gt;
* '''resource.ResourceName.http''': If enabled, the resource will be accessible from http://server_ip:22005/ResourceName/&lt;br /&gt;
This works as with other ACL rights - You can enable it just for Admin users, or any other group of users you wish.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==SDK==&lt;br /&gt;
There are a number of so-called 'SDKs' available that allow you to interface with the server from other programming languages. With these, you could (in theory) write whole gamemodes. In practice, this is probably a bad idea, but it is useful for statistics and administration. The PHP SDK is the most developed version. Feel free to modify or create your own SDKs - if you do please send us a copy.&lt;br /&gt;
&lt;br /&gt;
* [[JavaSDK|Java SDK]]&lt;br /&gt;
* [[Javascript SDK]]&lt;br /&gt;
* [https://www.npmjs.com/package/mtasa Node.js SDK]&lt;br /&gt;
* [[Perl SDK]]&lt;br /&gt;
* [[PHP SDK]]&lt;br /&gt;
* [[CSharp SDK|C# SDK]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[callRemote]] - Allows game servers to call functions on PHP pages (with the PHP SDK) and on other game servers.&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[hu:Resource Web Access]]&lt;br /&gt;
[[ru:Resource Web Access]]&lt;br /&gt;
[[pt-br:Acesso_web_via_recursos]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=62317</id>
		<title>Depuração</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=62317"/>
		<updated>2019-02-28T20:16:43Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: [add] [fix] nova introdução; erro de consistência no primeiro exemplo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;É comum ao programar cometer erros de sintaxe e semântica. O primeiro deles acontece porque o computador não tem a sensibilidade do ser humano para compreender um texto, mesmo que tenha erros de ortografia. Já o segundo, é basicamente culpa sua, não do computador. Por exemplo, em um complexo algoritmo para distribuir jogadores pelo mapa, ocorre uma [https://pt.wikipedia.org/wiki/Divis%C3%A3o_por_zero divisão por zero]. De fato, até este ponto, a máquina só seguiu suas instruções, que eventualmente, em um caso específico chegou a uma operação matemática inválida.&lt;br /&gt;
&lt;br /&gt;
A depuração (debug, em inglês) ajuda o programador a encontrar erros apontando o que são eles são e onde estão, poupando seu valioso tempo. Esta página irá ensinar como ativar a depuração e dar alguns exemplos de como corrigir erros comuns.&lt;br /&gt;
&lt;br /&gt;
==Debug no Console==&lt;br /&gt;
O MTA vem com um sistema no console onde mensagens de ''debug'' relacionadas às funções e scripts são mostradas. Lembrando que é necessário ter uma permissão de administrador para ativá-lo (a não ser se você modificar o ACL). Para fazer isso, digite &amp;lt;code&amp;gt;debugscript X&amp;lt;/code&amp;gt; no console, em que ''X'' é o nível:&lt;br /&gt;
&lt;br /&gt;
* '''1:''' mostra somente os erros&lt;br /&gt;
* '''2:''' erros e avisos&lt;br /&gt;
* '''3:''' erros, avisos e mensagens informativas&lt;br /&gt;
Ao digitar &amp;lt;code&amp;gt;debugscript 3&amp;lt;/code&amp;gt;, todas as ocorrências serão mostradas. O nível 3 ou o 2 são os recomendados para a maioria dos casos. É recomendado ativar o ''debugscript' para testar seu script e detectar os erros de digitação.&lt;br /&gt;
&lt;br /&gt;
===Exemplo===&lt;br /&gt;
Neste código há dois erros. Consegue encontra-los?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;)&lt;br /&gt;
        outputChatbox(&amp;quot;Olá, Cebola!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando este script for carregado, no console irá aparecer algo assim:&lt;br /&gt;
:{{Debug info|Loading script failed: meuRecurso\script.lua:2: 'then' expected near ´outputChatbox'}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Isso significa que o script não pode ser executado porque há um erro de sintaxe. Nesta mensagem, primeiramente aparece qual script de qual recurso deu problema. Depois disso, há dois pontos e um número mostrando a linha onde está o erro; para facilitar o trabalho do programador quando se trata de scripts maiores. Depois disso, a mensagem irá variar de acordo com o tipo de erro. Neste caso, é fácil concluir que o erro está localizado no '''meuRecurso''' e na linha dois do arquivo '''script.lua'''. Desta vez está na cara: precisamos colocar o &amp;quot;then&amp;quot; na cláusula ''if''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;) then&lt;br /&gt;
        outputChatbox(&amp;quot;Olá, Cebola!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo será carregado com sucesso e nenhum erro aparecerá até que um jogador apelidado &amp;quot;Cebola&amp;quot; dizer algo no chat. Aí no console irá aparecer:&lt;br /&gt;
:{{Debug error|myResource\script.lua:2: attempt to call global 'outputChatbox' (a nil value)}}&lt;br /&gt;
Isso significa que a função '''outputChatbox''' é um valor ''nil'', ou seja, ele não existe! Isso porque a função na verdade se chama [[outputChatBox]], e não [[outputChatbox]]. Então, tome cuidado com a letra maiúscula B.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;) then&lt;br /&gt;
        outputChatBox(&amp;quot;Olá, Cebola!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lembrando que isso é só ''um exemplo'' e não será sempre desse jeito, pois há vários tipos de erros que podem acontecer.&lt;br /&gt;
&lt;br /&gt;
==Log de debug do Cliente e Servidor==&lt;br /&gt;
====Servidor====&lt;br /&gt;
Na pasta ''../server/mods/deathmatch'', haverá dois arquivos com funções parecidas:&lt;br /&gt;
&lt;br /&gt;
*''local.conf'' - são as configurações oriundas do item &amp;quot;host game&amp;quot; no menu principal do MTA. Isto é uma maneira rápida de iniciar um servidor de testes dentro do próprio programa. Quando o usuário fecha o jogo, ele é automaticamente desligado também.&lt;br /&gt;
&lt;br /&gt;
*''mtaserver.conf'' - é usado quando se inicia o &amp;quot;MTA Server.exe&amp;quot; dentro da pasta ''../server/''. Em outras palavras, o servidor é rodado em prompt de comando e não necessita de o MTA estar executando junto. Isso é muito útil para os interessados em montar um servidor dedicado ou mesmo experimentar como é mexer em um servidor de verdade.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dependendo das suas necessidades, com certeza irá querer alterar essas configurações abaixo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Indica o nome e a localização do arquivo usado pelo debugscript. Se for deixado em branco, o servidor não o salvará. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Indica o nível de debugscript para este arquivo. Todos os níveis 0,1,2,3 estão disponíveis. Quando não especificado, zero é o padrão. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Como as descrições acima já dizem, é opcional salvar um arquivo de log de acordo com o nível desejado. Os três níveis estão descritos acima, sendo neste caso o zero como a não ativação do debugscript - fazendo o arquivo ficar em branco. Se 3 for ativado, todos os erros encontrados no '''lado do servidor''' serão salvos em: ''../server/mods/deathmatch/logs/scripts.log''&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
Todos os erros '''do cliente''' serão salvos na pasta ''../server/clientscript.log''. Isso já é definido por padrão, então nenhuma configuração é necessária.&lt;br /&gt;
&lt;br /&gt;
==Habilidades em Deubug==&lt;br /&gt;
&lt;br /&gt;
Em vez de ficar procurando no código os erros cometidos, há algumas coisas a serem feitas para ajudar a encontrar-los. A maioria delas estão relacionadas com a adição de alguma mensagem de debug informando o que está ocorrendo no script.&lt;br /&gt;
&lt;br /&gt;
===Funções Úteis===&lt;br /&gt;
As funções abaixo podem lhe ajudar com o debug:&lt;br /&gt;
* [[outputDebugString]] ou [[outputChatBox]] para escrever qualquer informação na tela (de preferência outputDebugString para suporte técnico)&lt;br /&gt;
* [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()] para tornar qualquer variável em uma ''string''. Muito útil para saber o que ela é, escrevendo na tela. Não será necessário usa-la se a variável já uma string ou um número.&lt;br /&gt;
* [[getElementType]] verifica o tipo de elemento do MTA em questão.&lt;br /&gt;
* [[isElement]] verifica se elemento existe.&lt;br /&gt;
&lt;br /&gt;
===Adicionando mensagens de debug para verificar ''se'', ''quando'' ou por qual ''frequência'' um código é executado===&lt;br /&gt;
Se você terminou de escrever um código e percebe que algo esperado não acontece e fica em dúvida se as instruções foram executadas ou não; nesse caso é recomendado adicionar mensagens de debug para verificar os passos.&amp;lt;br&amp;gt;&lt;br /&gt;
Um exemplo típico seria checar se uma clausula ''if'' foi atendida ou não:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (variable1 == variable2) then&lt;br /&gt;
	outputDebugString(&amp;quot;A variável 1 é igual a 2.&amp;quot;)&lt;br /&gt;
	-- portanto, faça alguma coisa&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outra maneira semelhante seria verificar se alguma variável muda. Em outras palavras, é só adicionar uma mensagem de debug depois de cada vez que isso acontece.&lt;br /&gt;
&lt;br /&gt;
===Adicionando uma mensagem de debug para verificar o ''valor'' de uma variável===&lt;br /&gt;
Digamos que desejas criar um marcador (marker), mas ele não aparece na posição esperada. A primeira coisa a ser feita é verificar se a função [[createMarker]] foi executada com sucesso. Depois disso, só precisamos verificar os valores usados nela.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local marker = createMarker(x,y,z)&lt;br /&gt;
	if not marker then&lt;br /&gt;
		outputChatBox(&amp;quot;O marcador não pode ser criado.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
outputChatBox(&amp;quot;A posX é &amp;quot;..x..&amp;quot;, posY &amp;quot;..y..&amp;quot;, e posZ &amp;quot;..z)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Feito isso, as variáveis usadas como coordenadas serão mostradas. Lembrando que se uma variável não for uma frase ou número, é recomendado usar a função [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()], pois ela torna qualquer variável agrupável em uma ''string'', mesmo se for uma ''bool'' ou tabela.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Imagine que você criou um [[Colshape|detector de colisão]] e se o jogador ficar dez segundos dentro dele, algo vai acontecer:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, root, colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando o jogador entrar no colshape, o debugscript irá escrever a seguinte mensagem:&lt;br /&gt;
:{{Debug error|..[path]: attempt to index global 'colshapeTimer' (a nil value)}}&lt;br /&gt;
Isso significa que você tentou endereçar uma tabela não existente quando tentou colocar o timer dentro dela; ou seja, ela é um valor ''nil'' - portanto, não existe. Para corrigir isso, precisamos verificar se a tabela não existe, e caso a resposta for positiva; a criaremos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,root,colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Desta vez receberemos um aviso quando o jogador entrar no colshape, esperar a mensagem e sair de lá:&lt;br /&gt;
&lt;br /&gt;
:{{Debug warning|[..]: Bad argument @ 'killTimer' Line: ..}}&lt;br /&gt;
&lt;br /&gt;
Tirando isso (vamos corrigir mais tarde!), tudo parece funcionar bem. O jogador entra no colshape e o ''timer'' começa a contar: se ele esperar, a mensagem é escrita, caso contrário o ''timer'' é destruído. Mas...&lt;br /&gt;
&lt;br /&gt;
===Um erro imperceptível===&lt;br /&gt;
Por alguma razão, quando o jogador entra no colshape usando um veículo, a mensagem é escrita duas vezes; como se o código tivesse sido executado duas vezes. Então, adicionamos uma mensagem de debug para verificar isso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave&amp;quot;)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora dá pra ter certeza que as funções são executadas duas vezes quando entramos com um veículo, mas só uma quando se está a pé. É possível que o veículo seja um elemento a parte e ativa a função de forma independente ao jogador. Para confirmar essa teoria, verificamos se a variável ''player'' realmente se refere ao jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A mensagem de debug nos diz que uma referência da variável ''player'' é realmente o jogador, mas outra é o veículo. Já que nós destinamos o evento especificamente ao boneco dele, adicionaremos uma cláusula ''if'', obrigando o término da execução do código caso a variável '''não''' for o jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo está funcionando como o planejado, mas aquela mensagem de aviso mencionada acima ainda aparece. Isso porque quando tentamos destruir o timer depois que o jogador saí do colshape, ele não existe mais, já que os 10 segundos se passaram. Em outras palavras, o timer é automaticamente destruído quando ele conta os 10 segundos. Há diversas formas de se livrar do aviso, uma vez que temos conhecimento da não existência do ''timer''. Uma delas seria verificar se ele existe na tabela. Para fazer isto, usamos a função [[isTimer]] na hora de destruí-lo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Então o código completo ficará assim:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
		killTimer(colshapeTimer[player])&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verificando problemas na performance==&lt;br /&gt;
Se o seu servidor estiver trabalhando muito além da conta ou você deseja se certificar que seus scripts são eficientes, é possível matar o problema pela raiz usando uma boa ferramenta inclusa na instalação: [[Resource:Performancebrowser|performancebrowser]]. É só inicia-lo usando ''''start performancebrowser''''. Caso ele não exista, pode encontrá-lo no último pacote de recursos hospedado no [https://github.com/multitheftauto/mtasa-resources GitHub]. Esta ferramenta inclui uma série de informações relativas a performance, como:&lt;br /&gt;
* Memory leaks - uso excessivo de memória&lt;br /&gt;
* Element leaks - criação excessiva de elementos&lt;br /&gt;
* CPU usage - uso excessivo de CPU&lt;br /&gt;
&lt;br /&gt;
Para acessar o performancebrowser, é preciso ir até o navegador e digitar o endereço: &amp;lt;nowiki&amp;gt;http://&amp;lt;ip-do-servidor&amp;gt;:&amp;lt;porta&amp;gt;/performancebrowser/&amp;lt;/nowiki&amp;gt;. Um exemplo seria o endereço do servidor local: http://127.0.0.1:22005/performancebrowser/. Lembrando que é preciso:&lt;br /&gt;
* colocar a barra (/) no final do endereço&lt;br /&gt;
* logar no jogo com uma conta de administrador ou outra que tenha acesso no ACL a:&lt;br /&gt;
:* '''resource.performancebrowser.http''' e '''resource.ajax.http'''&lt;br /&gt;
&lt;br /&gt;
{{Dica|A maioria das informações relevantes estão nas categorias ''Lua timing'' e ''Lua memory''. E, o problema está nos valores mais altos apresentados.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exemplos de scripts problemáticos===&lt;br /&gt;
&lt;br /&gt;
Um deles seria adicionar dados a alguma tabela, mas não remover posteriormente. Porém, isso levaria alguns meses ou até anos para danificar o funcionamento do servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local someData = {}&lt;br /&gt;
&lt;br /&gt;
function storeData()&lt;br /&gt;
	someData[source] = true&lt;br /&gt;
	-- não há nenhum evento para retirar os dados quando o jogador sair. Isso é considerado memory leak&lt;br /&gt;
	-- Entrando na aba Lua timing, você pode verificar o uso de RAM de cada recurso.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, storeData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Um caso possível de ''Element leak'' é criar colisores temporários e nunca destruí-los mais tarde. Isso aumenta muito o uso de transferência dados (bandwidth), CPU e memória pelo servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function useTemporaryCol()&lt;br /&gt;
	local col = createColCircle(some code here)&lt;br /&gt;
	if (algo que deveria acontecer...) then&lt;br /&gt;
		destroyElement(col)&lt;br /&gt;
	end&lt;br /&gt;
	-- E as vezes não acontece, fazendo o colisor permanecer no mapa pra sempre...&lt;br /&gt;
	-- Criando de centenas à milhares de coliores sem função alguma.&lt;br /&gt;
	-- Na aba Lua timing é possível ver quantos elementos cada script criou.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O alto uso de CPU resulta na queda de FPS, fazendo o servidor um lugar ruim para se jogar. Em 24 horas, isso pode causar sérios prejuízos. O número de elementos criados detectados na aba ''Lua timing'' não ajudará neste caso, mas o ''Lua memory'' sim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, function()&lt;br /&gt;
	-- [Código para o novo jogador]&lt;br /&gt;
	-- Até que um evento é adicionado para quando ele sair&lt;br /&gt;
	addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, function()&lt;br /&gt;
	-- Encontrou o problema? Esse evento além de usar o root como o seu causador, é criado infinitamente...&lt;br /&gt;
    end)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Uma função usa muito o CPU quando ela demora para terminar de ser executada. O exemplo abaixo é uma delas. Sem o performancebrowser, você não perceberia tão cedo que esta é a causa do problema. Mas com ele, verá na aba ''Lua timing'' que o seu recurso usa muito o potencial do CPU. Ficará mais fácil descobrir isso se usar o parâmetro ''''d'''' na caixa de entrada ''Options''. Isso porque ela lhe dirá também a linha em que está o código problemático.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function umaFuncaoPoucoEficaz()&lt;br /&gt;
	-- para cada cem mil coisas quaisquer&lt;br /&gt;
	for i=1, 100000 do&lt;br /&gt;
		-- [código abaixo]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[en:Debugging]]&lt;br /&gt;
[[it:Guida al Debug]]&lt;br /&gt;
[[ru:Debugging]]&lt;br /&gt;
[[Category:Conceitos de Scripting]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FindRotation3D&amp;diff=51702</id>
		<title>FindRotation3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FindRotation3D&amp;diff=51702"/>
		<updated>2017-07-19T23:56:57Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function takes two sets of XYZ coordinates. It returns the 3D direction from point A to point B. This can for example be used to make objects point at specified point&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float findRotation3D( float x1, float y1, float z1, float x2, float y2, float z2 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''x1''': The X coordinate of the starting point.&lt;br /&gt;
* '''y1''': The Y coordinate of the starting point.&lt;br /&gt;
* '''z1''': The Z coordinate of the starting point.&lt;br /&gt;
* '''x2''': The X coordinate of the target point.&lt;br /&gt;
* '''y2''': The Y coordinate of the target point.&lt;br /&gt;
* '''z2''': The Z coordinate of the target point.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function findRotation3D( x1, y1, z1, x2, y2, z2 ) &lt;br /&gt;
	local rotx = math.atan2 ( z2 - z1, getDistanceBetweenPoints2D ( x2,y2, x1,y1 ) )&lt;br /&gt;
	rotx = math.deg(rotx)&lt;br /&gt;
	local rotz = -math.deg( math.atan2( x2 - x1, y2 - y1 ) )&lt;br /&gt;
	rotz = rotz &amp;lt; 0 and rotz + 360 or rotz&lt;br /&gt;
	return rotx, 0,rotz&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This command makes the player's vehicle to rotate at vehicle near it.&lt;br /&gt;
''Note: This example needs [[OOP]] to be enabled in order to work''&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client-side example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function setRotationAtNearestVehicle()&lt;br /&gt;
&lt;br /&gt;
	if not localPlayer.vehicle then return end&lt;br /&gt;
&lt;br /&gt;
	local nearestVehicle = false&lt;br /&gt;
	local dist = 10000&lt;br /&gt;
	for index,vehicle in ipairs(getElementsByType(&amp;quot;vehicle&amp;quot;,root,true)) do&lt;br /&gt;
		if getDistanceBetweenPoints3D(localPlayer.vehicle.position,vehicle.position) &amp;lt; dist and localPlayer.vehicle ~= vehicle then&lt;br /&gt;
			nearestVehicle = vehicle&lt;br /&gt;
			dist = getDistanceBetweenPoints3D(localPlayer.vehicle.position,vehicle.position)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local x1,y1,z1 = getElementPosition(localPlayer.vehicle)&lt;br /&gt;
	local x2,y2,z2 = getElementPosition(nearestVehicle)&lt;br /&gt;
	local rx,ry,rz = findRotation3D(x1,y1,z1,x2,y2,z2)&lt;br /&gt;
&lt;br /&gt;
	localPlayer.vehicle.rotation = Vector3(rx,ry,rz)&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
addCommandHandler(&amp;quot;lookatnearestveh&amp;quot;,setRotationAtNearestVehicle)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thanks for '''ccw''' for alternative [[getCameraRotation]] function which formula is used in this function. Also thanks for '''Doomed_Space_Marine''' for more accurate formula for z-axis which is used in [[findRotation]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:P%C3%A1gina_Inicial&amp;diff=50567</id>
		<title>Talk:Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:P%C3%A1gina_Inicial&amp;diff=50567"/>
		<updated>2017-03-21T20:25:30Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''&lt;br /&gt;
I want to create a script that I can change the server interface (hud and radar), but I can not create it, will someone help me ?, I want a panel that I can open and close (f2), cm 2 Option Interface, the first option in hud and radar other than option 2, Thanks'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''@RaceXtreme: Wrong Section'''&lt;br /&gt;
Please, post this in the [https://forums.mtasa.com forums].&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=48088</id>
		<title>Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=48088"/>
		<updated>2016-07-18T02:51:49Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding: 5px; height: 130px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px]]'''Bem vindo ao Wiki do Multi Theft Auto.''' Aqui você encontra tudo sobre o uso desta modificação.&lt;br /&gt;
&lt;br /&gt;
Há muitas [[How you can help|coisas em que você pode nos ajudar]] para melhorar este programa, como criar um mapa, um modo de jogo, documentar funções e eventos, escrever códigos úteis para outros usuários, fazer tutoriais, reportar bugs que encontrar ou somente jogar a vontade!&lt;br /&gt;
&lt;br /&gt;
Se você tem alguma dúvida a respeito do Multi Theft Auto, não se esqueça de perguntar à comunidade em nossos [http://forum.mtasa.com/ fóruns].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Jogar&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Baixe o Multi Theft Auto {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Onde_adquirir_o_GTASA|Onde adquirir o GTASA]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Cliente|Manual do usuário]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Novidades_na_versão_{{Current Version|full}}|Novidades da última versão ]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Soluções_de_Problemas_-_FAQ|Solução de problemas]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Migrando_do_MTA:Race_ao_MTA:SA_1.3|Migrando do MTA:Race para o MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Servidor|Manual do servidor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Recursos:Map_Manager|Gerenciador de mapas (''Map Manager'')]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Editor de mapas&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor|Manual do editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor-EDF|Ficheiro de definições do editor (EDF)]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor-Plugins|Extensões para o editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor#FAQ|Perguntas frequentes (FAQ)]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Banco de dados&amp;lt;/h3&amp;gt;&lt;br /&gt;
Aqui tem tudo relacionado às vantagens que Lua tem a oferecer ao MTA e seus recursos.&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[:Category:Resource|Catálogo de Recursos]] - Você deve aprender com eles para fazer scripts bons&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Scripts_do_Cliente|Scripts do Cliente]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Módulos|Módulos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Desenvolvimento do Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Últimas compilações]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA|Compilando o MTASA no Windows]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Mac_OS_X|Compilando o MTASA no Mac OS X]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Linux|Compilando o MTASA no Linux]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Guia_do_Desenvolvedor|Guia do Desenvolvedor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]      [https://github.com/multitheftauto/mtasa-blue Repositório Github]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Roadmap|Roteiro para versões futuras]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]      [http://bugs.mtasa.com/ Central de bugs]&lt;br /&gt;
* [[File:iUS.png|En Inglês|20px]]      [[Branches|Ramos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Como você pode nos ajudar&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Documentar funções ou eventos&lt;br /&gt;
* Criar exemplos funcionais e eficientes de funções e eventos&lt;br /&gt;
* Examinar e corrigir as páginas&lt;br /&gt;
* Escrever tutoriais para ajudar novatos&lt;br /&gt;
* Ajudar a traduzir as páginas da Wiki para outras linguagens&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Comunidade&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.multitheftauto.com/ Fóruns]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [irc://irc.multitheftauto.com/mta IRC]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://community.mtasa.com/ Comunidade]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://twitter.com/#!/MTAQA/ Twitter] &lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.youtube.com/user/MTAQA Youtube]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://plus.google.com/102014133442331779727/ Google]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introdução_ao_Scripting|Introdução a ''scripting'']]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introducao_ao_GUI_scripting|Introdução a ''scripting'' de UI]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[Depuração|Depuração]] - Encontre erros em seu Script&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Recursos|Introdução a recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Acesso web via recursos|Acesso web via recursos]] - Abra servidores web através de recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[:Category:PT-BR/Recursos|Lista de recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[O arquivo Meta|Meta.xml]] - Todo recurso possui um arquivo meta descrevendo a si próprio&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Lista de Controle de Acesso|Lista de controle de acesso (ACL)]] - Componente vital para recursos complexos&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Composição_de_Gamemodes|Composição de modos de jogo]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[PT-BR/Funções_Úteis|Funções Úteis]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Links dos fóruns&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [http://forum.mtasa.com/viewforum.php?f=152 Secção do fórum para dúvidas sobre ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewforum.php?f=148 Guias de ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Wiki ''offline'']&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Manuais sobre Lua&amp;lt;/h3&amp;gt;&lt;br /&gt;
Página muito útil para ajuda-lo a entender o funcionamento do Lua&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/portugues.html Introdução à linguagem]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html Manual básico]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/manual/5.1/pt/ Manual de referência]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://lua-users.org/wiki/TutorialDirectory Outra wiki, somente de Lua]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Referência&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Functions|Funções do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Events|Eventos do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Functions|Funções do servidor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Events|Eventos do servidor]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[MTA Classes|Classes do Multi Theft Auto]] - Informações detalhadas sobre todas as classes do MTA&lt;br /&gt;
** [[File:iUS.png|Em Inglês|20px]] [[Element tree|Árvore dos elementos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|Lista de IDs de objetos e texturas]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animações]]&lt;br /&gt;
*[[Character Skins|''Skins'' de pedestres]]&lt;br /&gt;
*[[Roupas do CJ|Roupas do CJ]]&lt;br /&gt;
*[[Garage|Garagens]]&lt;br /&gt;
*[[Interior IDs|Interiores]]&lt;br /&gt;
*[[Material IDs|Materiais]]&lt;br /&gt;
*[[Projectiles|Projéteis]]&lt;br /&gt;
*[[Radar Blips|''Blips'']]&lt;br /&gt;
*[[Sounds|Efeitos sonoros]]&lt;br /&gt;
*[[Vehicle IDs|Veículos]]&lt;br /&gt;
*[[Vehicle Colors|Cores dos veículos]]&lt;br /&gt;
*[[Vehicle Upgrades|Acessórios dos veículos]]&lt;br /&gt;
*[[Vehicle variants|Variantes dos veículos]]&lt;br /&gt;
*[[Weapons|Armas]]&lt;br /&gt;
*[[Weather|Ambientação]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:pBR.png|32px]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Sobre a Tradução&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Tradutores:&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=50642|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;RaceXtreme&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=59023|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;StanleySathler&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=55744|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;DNL291&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=62091|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Ninguem&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=63192|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Anderl&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
É importante que todos colaborem para que nossa página em português fique melhor a cada dia!&lt;br /&gt;
&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/]]&lt;br /&gt;
'''Multi Theft Auto''' é um projeto '''open source'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Sobre o Multi Theft Auto'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive|Arquivos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage|Eventos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Desenvolvedores]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Baixe-o]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Solução de problemas]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Status da Wiki'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} artigos&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} páginas&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} usuários registrados&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|pt-br}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=45394</id>
		<title>Compiling MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compiling_MTASA&amp;diff=45394"/>
		<updated>2015-07-06T05:20:07Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added PT-BR page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In order to successfully build Multi Theft Auto from source, it is necessary to perform a number of steps, which we will explain below.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
Before you can build Multi Theft Auto, make sure you have the following software and SDKs installed:&lt;br /&gt;
* Microsoft Visual Studio 2008 ([http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en SP1 required])&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;amp;id=6812 Microsoft DirectX SDK] (only the Direct3D related components are required)&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?id=6510 Microsoft Platform SDK] (not required on Windows 7, only the DirectShow components are required)&lt;br /&gt;
&lt;br /&gt;
If you haven't already done so, install a client such as [https://www.sourcetreeapp.com/ SourceTree] or [https://windows.github.com/ GitHub for Windows], which can be used to download and manage the code.&lt;br /&gt;
&lt;br /&gt;
=== Getting the latest source code ===&lt;br /&gt;
&lt;br /&gt;
To get the latest code, you will have to download the latest copy of our Git repository - you can get it [https://github.com/multitheftauto/mtasa-blue here] ([https://github.com/multitheftauto/mtasa-blue/archive/master.zip zip]|[https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz tar.gz])&lt;br /&gt;
&lt;br /&gt;
=== Before building the software ===&lt;br /&gt;
&lt;br /&gt;
To ensure the target directories have the correct permissions it is '''vital''' to install [http://nightly.mtasa.com/ the latest unstable nightly] into this '''exact''' directory:&lt;br /&gt;
    C:\Program Files\MTA San Andreas x.x\&lt;br /&gt;
Where x.x is the version you are compiling for. If you have 64 bit windows, be sure to remove (x86) from the path.&lt;br /&gt;
&lt;br /&gt;
=== Building the software ===&lt;br /&gt;
&lt;br /&gt;
In order to build the source, you will need Microsoft Visual Studio. Open the project file in '''Shared/Core 2008.sln''' and build using one of the project configurations ''Debug'' or ''Release''. Note that everything will run significantly slower in ''Debug'' mode.&lt;br /&gt;
&lt;br /&gt;
=== Target directory and permissions ===&lt;br /&gt;
&lt;br /&gt;
By default, the current version compiles the binaries into 'C:\Program Files\MTA San Andreas 1.5\'. To ensure the correct permissions, registry entries and support files are present, you should install [http://nightly.mtasa.com/ the latest unstable nightly] and [http://mirror.mtasa.com/mtasa/data/ the latest data files] into that directory. Also make sure to add write permissions for your user to that directory.&lt;br /&gt;
&lt;br /&gt;
=== Getting the latest network module ===&lt;br /&gt;
&lt;br /&gt;
Since the '''netc.dll'''/'''net.dll''' network modules for the client are covered by a different license, you will have to use the binary files that get installed with the latest nightly. If you want to run a debug version of MTA, MTA expects a debug version of the net dll. As we don't provide this, you can append '_d' to the filename of a release dll.&lt;br /&gt;
&lt;br /&gt;
= Running the software =&lt;br /&gt;
&lt;br /&gt;
You are almost ready to run your build of the Multi Theft Auto software.&lt;br /&gt;
&lt;br /&gt;
=== Running the game client ===&lt;br /&gt;
&lt;br /&gt;
Double check you have installed [http://nightly.mtasa.com/ the latest unstable nightly] and [http://mirror.mtasa.com/mtasa/data/ the latest data files].&lt;br /&gt;
&lt;br /&gt;
=== Running the dedicated server ===&lt;br /&gt;
&lt;br /&gt;
If you want to run the Multi Theft Auto dedicated server, you will have to install the required resources. These are required because they implement the most basic functionality (e.g. spawning players) in order to play.&lt;br /&gt;
&lt;br /&gt;
Our official resources repository is hosted on GitHub: [https://github.com/multitheftauto/mtasa-resources]. It's recommended that you check out the latest resources from here or download a zipped revision from the [http://mirror.mtasa.com/mtasa/resources/ Downloads] tab on the resources project. Make sure that you are not using any of our resources from any previous versions of Multi Theft Auto, as this '''will''' cause issues.&lt;br /&gt;
&lt;br /&gt;
If you have any problems with missing DLL files (e.g. libcurl.dll), simply copy these over from the client's data archive described above.&lt;br /&gt;
&lt;br /&gt;
= Getting involved =&lt;br /&gt;
Please see our [[Coding guidelines]] for information on coding practice.&lt;br /&gt;
&lt;br /&gt;
= Additional information =&lt;br /&gt;
&lt;br /&gt;
If you need more information, try our [http://bugs.mtasa.com/ bug tracker], [irc://irc.multitheftauto.com IRC channel].&lt;br /&gt;
&lt;br /&gt;
[[pt-br:Compilando o MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Compilando_o_MTASA&amp;diff=45393</id>
		<title>PT-BR/Compilando o MTASA</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Compilando_o_MTASA&amp;diff=45393"/>
		<updated>2015-07-06T05:16:47Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Updated Github links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Para se conseguir compilar o Multi Theft Auto a partir de seu código fonte, é necessário seguir alguns passos, os quais estão descritos a seguir.&lt;br /&gt;
&lt;br /&gt;
=== Pré-requisitos ===&lt;br /&gt;
Antes de você poder fazer isso, certifique-se que os seguintes softwares e SDK's estão instalados:&lt;br /&gt;
&lt;br /&gt;
* Microsoft Visual Studio 2008 ([http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en incluindo o SP1])&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;amp;id=6812 Microsoft DirectX SDK] (só precisa dos componentes do Direct3D)&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?id=6510 Microsoft Platform SDK] (não é preciso instalar tudo se tiver o Windows 7, somente os componentes do DirectShow)&lt;br /&gt;
&lt;br /&gt;
Se não tiver feito ainda, instale um cliente como o [https://www.sourcetreeapp.com/ SourceTree] ou [https://windows.github.com/ GitHub para Windows] a fim de fazer o download e gerenciar o código.&lt;br /&gt;
&lt;br /&gt;
=== Adquirindo o último código fonte ===&lt;br /&gt;
Para fazer o download da última alteração no código fonte, você tem de fazer o download da última cópia de nosso repositório Git&lt;br /&gt;
disponível [https://github.com/multitheftauto/mtasa-blue aqui] ([https://github.com/multitheftauto/mtasa-blue/archive/master.zip zip]|[https://github.com/multitheftauto/mtasa-blue/archive/master.tar.gz tar.gz]).&lt;br /&gt;
&lt;br /&gt;
=== Antes de Compilar ===&lt;br /&gt;
Para ter certeza que os diretórios-destino tem as permissões corretas, é '''vital''' instalar a última [http://nightly.mtasa.com/ nightly] neste '''exato''' diretório:&lt;br /&gt;
    C:\Program Files\MTA San Andreas x.x\&lt;br /&gt;
Em que x.x é a versão a qual está compilando. Se um windows 64-bit estiver rodando, certifique-se de inserir o &amp;quot;x86&amp;quot; no caminho.&lt;br /&gt;
&lt;br /&gt;
=== Agora como Compilar? ===&lt;br /&gt;
Para compilar o programa a partir do código fonte, é necessário ter instalado o Microsoft Visual Studio. Abra o projeto em '''Shared/Core 2008.sln''' e faça-o usando uma das configurações (Debug/Release) disponíveis no mesmo. Note que tudo irá rodar mais lento no modo ''Debug''.&lt;br /&gt;
&lt;br /&gt;
=== Diretório-destino e permissões ===&lt;br /&gt;
Por padrão, a versão atual compila os binários em 'C:\Program Files\MTA San Andreas 1.3\'. Para ter certeza que estão corretos as permissões e os registros; e os arquivos de suporte estão presentes, é recomendado instalar ambos os [http://nightly.mtasa.com/ nightly] e [http://code.google.com/p/mtasa-blue/downloads/list?q=label:Data arquivos periféricos] neste diretório.&lt;br /&gt;
&lt;br /&gt;
=== Adquirindo o último módulo de rede===&lt;br /&gt;
Já que os módulos de rede '''netc.dll'''/'''net.dll''' destinados ao cliente estão sob uma licença diferente, você deve utilizar os que vem com a última nightly. Se desejar rodar a versão de debug do MTA, ele também vai precisar de uma versão-debug desses módulos. Como não podemos providenciar isso, é só adicionar ao final do nome um &amp;quot;_d&amp;quot; nos já existentes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Rodando o programa =&lt;br /&gt;
Está quase acabando, só mais uns passos:&lt;br /&gt;
&lt;br /&gt;
=== Rodando o cliente ===&lt;br /&gt;
Reveja se está instalado ambos os [http://nightly.mtasa.com/ nightly] e [http://code.google.com/p/mtasa-blue/downloads/list?q=label:Data arquivos periféricos].&lt;br /&gt;
&lt;br /&gt;
=== Rodando o servidor dedicado ===&lt;br /&gt;
Se quiser rodar o servidor dedicado, precisará de alguns recursos. Esses são precisos porque incrementa o mais fundamental de um servidor (ex: fazer o jogador nascer) a fim de se poder jogar.&lt;br /&gt;
&lt;br /&gt;
O SVN oficial dos recursos está hospedado no GitHub: [https://github.com/multitheftauto/mtasa-resources]. É recomendado dar uma olhada nas últimas versões ou fazer um download de um zip na aba [http://code.google.com/p/mtasa-resources/downloads/list Downloads] do site. Certifique-se que não esteja rodando nenhum recurso de versões anteriores, porque '''vai''' dar problema.&lt;br /&gt;
&lt;br /&gt;
Se você enfrentar algum confusão por falta de DLL's (ex: libcurl.dll), só é preciso baixar-los nos arquivos periféricos mencionados acima.&lt;br /&gt;
&lt;br /&gt;
= Como se envolver? =&lt;br /&gt;
Para começar a contribuir para o MTA, veja mais no [[Coding guidelines|Guia de Programação]] (Em Inglês)&lt;br /&gt;
&lt;br /&gt;
= Informações Adicionais =&lt;br /&gt;
Se precisar de mais alguma coisa, tente entrar no [http://bugs.mtasa.com/ bug tracker] ou em nosso [irc://irc.multitheftauto.com canal IRC]&lt;br /&gt;
&lt;br /&gt;
[[en:Compiling MTASA]]&lt;br /&gt;
[[ru:Compiling MTASA]]&lt;br /&gt;
[[Category: Development]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Advanced_Topics&amp;diff=44435</id>
		<title>Advanced Topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Advanced_Topics&amp;diff=44435"/>
		<updated>2015-02-10T13:00:33Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains some advanced things you can do with scripts, this page should probably be changed later, depending how useful it is.&lt;br /&gt;
&lt;br /&gt;
==Custom element types==&lt;br /&gt;
===Forward===&lt;br /&gt;
One of the most powerful areas of MTA scripting is custom element types. That is, they are nothing else than new objects you add to extend GTA's world diversity. For instance, the race gamemode uses the spawnpoint and pickup elements to make player matches possible by providing spawn locations and pickups to help them during the track.&lt;br /&gt;
&lt;br /&gt;
By simply defining the element type in any map file entry, MTA automatically recognizes it as a custom one when it starts. Its up to the script to decide how to deal with the information provided. In this section, we're going over the steps how to implement part of the capture-the-flag's system, but this same method can be used for many different things.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implemention of an imaginary flag===&lt;br /&gt;
First of all, we can't possibly code without thinking how our system going to work first. Lets say we have an imaginary flag around the city created by an ordinary map file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;[pua,N]&lt;br /&gt;
&amp;lt;flag id=&amp;quot;redFlag&amp;quot; name=&amp;quot;red team flag&amp;quot; posX=&amp;quot;1210.0&amp;quot; posY=&amp;quot;-2241.34&amp;quot; posZ=&amp;quot;18.4332&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Why this way? Because it must have an ID to differ from others, a name to be displayed in the game and world position. What we just did was to outline the flag's basic information that our ctf system will require. From that point, we can start coding.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To keep things simple, we'll create a tiny resource for this tutorial, and you should already know [[Scripting_Introduction#Creating_a_simple_script|how to spawn a player]] and [[Scripting_Introduction#Events|make use of events]]. That resource ''will spawn people and handle any flag element created by the current running map'' and it only needs one server-side script called ctf.lua or just whatever name you want to give to it.&lt;br /&gt;
&lt;br /&gt;
With the player spawn code in the script, lets add an custom event that happens when someone pick a flag up, called ''onFlagPickup''. It may be defined anywhere in your script, but it should already exists if you want to use it (i.e. addEventHandler). So, our script will look like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
addEvent (&amp;quot;onFlagPickup&amp;quot;, true) –- event added here just to ensure it can be used by hole script&lt;br /&gt;
&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function flagPickup ( player )&lt;br /&gt;
	flagName = getElementData ( source, &amp;quot;name&amp;quot; )&lt;br /&gt;
	playerName = getPlayerName ( player )&lt;br /&gt;
	outputChatBox ( playerName .. &amp;quot; picked up the flag &amp;quot; .. flagName )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
addEventHandler(&amp;quot;onFlagPickup&amp;quot;, getRootElement(), flagPickup)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Easy enough! We've added an event-driven function (flagPickup). To put it in another way, when the event triggers that function will output who got the flag. We also attached the event to the server root because our gamemode have to function to any flag in the server. We can optimize our script by attaching to the map root, but it requires more code and it is not the our goal yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The final part of the puzzle is to trigger the event when the player gets in the flag. To do this, we need to create a timer-driven function that will be used to check if a player is trying to pick it up. So we add the following code to our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function flagCheckPulse ( )&lt;br /&gt;
	local flags = getElementsByType ( &amp;quot;flag&amp;quot; )&lt;br /&gt;
	local players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
	local flagPositionX, flagPositionY, flagPositionZ&lt;br /&gt;
	for flagKey,flagValue in ipairs(flags) do&lt;br /&gt;
		flagX = getElementData ( flagValue, &amp;quot;posX&amp;quot; )&lt;br /&gt;
		flagY = getElementData ( flagValue, &amp;quot;posY&amp;quot; )&lt;br /&gt;
		flagZ = getElementData ( flagValue, &amp;quot;posZ&amp;quot; )       &lt;br /&gt;
		for playerKey,playerValue in ipairs(players) do&lt;br /&gt;
			playerX, playerY, playerZ = getElementPosition ( playerValue )&lt;br /&gt;
			distance = getDistanceBetweenPoints3D ( flagX, flagY, flagZ, playerX, playerY, playerZ )&lt;br /&gt;
			if ( distance &amp;lt; 1) then&lt;br /&gt;
				triggerEvent ( &amp;quot;onFlagPickup&amp;quot;, flagValue, playerValue )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
setTimer (flagCheckPulse,1000,0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we've done here was to create a simple gamemode which reconizes and listen to a custom element (the flag) in the server's environment (the root). To put simply, it has an abstract capture-the-flag game algorithm. In theory, it would works just great, but the flag doesn't really exists in the world space - nobody even know where it is. &lt;br /&gt;
&lt;br /&gt;
I suppose you just have an meta.xml and ctf.lua in your resource. So if it runs in the server (no conflicting gamemode or errors) we can take the next step to spawn and represent our flag in GTA's world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Flag World Represetation===&lt;br /&gt;
Soon...&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=44433</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=44433"/>
		<updated>2015-02-09T19:17:05Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a meta file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.&lt;br /&gt;
&lt;br /&gt;
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as maplimits to keep playings within a playing area or deathpickups to create weapon pickups.&lt;br /&gt;
{{tip|Your first step to begin Lua scripting should be using an Lua editor. This makes scripting much easier. We recommend [http://www.sublimetext.com/ Sublime Text], [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [http://luaedit.sourceforge.net/ LuaEdit]. There is also an unofficial [[MTASE|MTA Script Editor]] (in work-in-progress state) that you can test out.}}&lt;br /&gt;
&lt;br /&gt;
==Creating a working script==&lt;br /&gt;
We will first learn how to make a basic script that lets the player walk around in the city, step by step.&lt;br /&gt;
===Where are all the scripts?===&lt;br /&gt;
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:&lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a &amp;quot;resource&amp;quot;, and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use &amp;quot;myserver&amp;quot; for this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now you should be under this directory: &lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
===Identifying your resource===&lt;br /&gt;
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the &amp;quot;myserver&amp;quot; folder in our case. So create a text file and name it &amp;quot;meta.xml&amp;quot;, and open it with notepad.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;YourName&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;My Server&amp;quot; description=&amp;quot;My first MTA server&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the ''&amp;lt;info /&amp;gt;'' tag, there's a &amp;quot;type&amp;quot; field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. &lt;br /&gt;
&lt;br /&gt;
The ''&amp;lt;script /&amp;gt;'' tag indicates the script files contained in the resource, which we will create next.&lt;br /&gt;
===Creating a simple script===&lt;br /&gt;
Note that in the ''&amp;lt;script /&amp;gt;'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will spawn you at the coordinate (x, y, z) specified above, when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the player will see is blue sky).&lt;br /&gt;
&lt;br /&gt;
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!&lt;br /&gt;
&lt;br /&gt;
===Running the script===&lt;br /&gt;
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then &amp;quot;ready to accept connections!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Before you connect to the server, you must run the gamemode. Type &amp;quot;start myserver&amp;quot; and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and &amp;quot;Quick Connect&amp;quot; using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.&lt;br /&gt;
&lt;br /&gt;
Next we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how Graphical User Interface in MTA is drawn and scripted.&lt;br /&gt;
&lt;br /&gt;
==Creating a simple command==&lt;br /&gt;
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- create a vehicle and stuff&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- create a command handler&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''&lt;br /&gt;
&lt;br /&gt;
====About command handlers====&lt;br /&gt;
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.&lt;br /&gt;
&lt;br /&gt;
If you have already experience in scripting, you will know that you call a function like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example: Someone types &amp;quot;createvehicle 468&amp;quot; ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similiar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
[[Event|Events]] are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[OOP_Introduction|OOP Scripting Introduction]]&lt;br /&gt;
* [[Advanced Topics]]&lt;br /&gt;
* [[Script_security|Script security]]&lt;br /&gt;
* [[Scripting Introduction Urdu]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[nl:Scripting_introductie]]&lt;br /&gt;
[[pt-br:Introdução ao Scripting]]&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[ar:مقدمه_في_البرمجه]]&lt;br /&gt;
[[zh-cn:脚本编写介绍]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Advanced_Topics&amp;diff=44432</id>
		<title>Advanced Topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Advanced_Topics&amp;diff=44432"/>
		<updated>2015-02-09T19:11:19Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: A tiny review in advanced topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains some advanced things you can do with scripts, this page should probably be changed later, depending how useful it is.&lt;br /&gt;
&lt;br /&gt;
==Custom element types==&lt;br /&gt;
===Forward===&lt;br /&gt;
One of the most powerful areas of MTA scripting is custom element types. That is, they are nothing else then new objects you add to extend GTA's world diversity. For instance, the race gamemode uses the spawnpoint and pickup elements to make player matches possible by providing spawn locations and pickups to help them during the track.&lt;br /&gt;
&lt;br /&gt;
By simply defining the element type in any map file entry, MTA automatically recognizes it as a custom one when it starts. Its up to the script to decide how to deal with the information provided. In this section, we're going over the steps how to implement part of the capture-the-flag's system, but this same method can be used for many different things.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Implemention of an imaginary flag===&lt;br /&gt;
First of all, we can't possibly code without thinking how our system going to work first. Lets say we have an imaginary flag around the city created by an ordinary map file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;[pua,N]&lt;br /&gt;
&amp;lt;flag id=&amp;quot;redFlag&amp;quot; name=&amp;quot;red team flag&amp;quot; posX=&amp;quot;1210.0&amp;quot; posY=&amp;quot;-2241.34&amp;quot; posZ=&amp;quot;18.4332&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Why this way? Because it must have an ID to differ from others, a name to be displayed in the game and world position. What we just did was to outline the flag's basic information that our ctf system will require. From that point, we can start coding.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To keep things simple, we'll create a tiny resource for this tutorial, and you should already know [[Scripting_Introduction#Creating_a_simple_script|how to spawn a player]] and [[Scripting_Introduction#Events|make use of events]]. That resource ''will spawn people and handle any flag element created by the current running map'' and it only needs one server-side script called ctf.lua or just whatever name you want to give to it.&lt;br /&gt;
&lt;br /&gt;
With the player spawn code in the script, lets add an custom event that happens when someone pick a flag up, called ''onFlagPickup''. It may be defined anywhere in your script, but it should already exists if you want to use it (i.e. addEventHandler). So, our script will look like this: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
addEvent (&amp;quot;onFlagPickup&amp;quot;, true) –- event added here just to ensure it can be used by hole script&lt;br /&gt;
&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function flagPickup ( player )&lt;br /&gt;
	flagName = getElementData ( source, &amp;quot;name&amp;quot; )&lt;br /&gt;
	playerName = getPlayerName ( player )&lt;br /&gt;
	outputChatBox ( playerName .. &amp;quot; picked up the flag &amp;quot; .. flagName )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
addEventHandler(&amp;quot;onFlagPickup&amp;quot;, getRootElement(), flagPickup)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Easy enough! We've added an event-driven function (flagPickup). To put it in another way, when the event triggers that function will output who got the flag. We also attached the event to the server root because our gamemode have to function to any flag in the server. We can optimize our script by attaching to the map root, but it requires more code and it is not the our goal yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The final part of the puzzle is to trigger the event when the player gets in the flag. To do this, we need to create a timer-driven function that will be used to check if a player is trying to pick it up. So we add the following code to our script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function flagCheckPulse ( )&lt;br /&gt;
	local flags = getElementsByType ( &amp;quot;flag&amp;quot; )&lt;br /&gt;
	local players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
	local flagPositionX, flagPositionY, flagPositionZ&lt;br /&gt;
	for flagKey,flagValue in ipairs(flags) do&lt;br /&gt;
		flagX = getElementData ( flagValue, &amp;quot;posX&amp;quot; )&lt;br /&gt;
		flagY = getElementData ( flagValue, &amp;quot;posY&amp;quot; )&lt;br /&gt;
		flagZ = getElementData ( flagValue, &amp;quot;posZ&amp;quot; )       &lt;br /&gt;
		for playerKey,playerValue in ipairs(players) do&lt;br /&gt;
			playerX, playerY, playerZ = getElementPosition ( playerValue )&lt;br /&gt;
			distance = getDistanceBetweenPoints3D ( flagX, flagY, flagZ, playerX, playerY, playerZ )&lt;br /&gt;
			if ( distance &amp;lt; 1) then&lt;br /&gt;
				triggerEvent ( &amp;quot;onFlagPickup&amp;quot;, flagValue, playerValue )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
setTimer (flagCheckPulse,1000,0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we've done here was to create a simple gamemode which reconizes and listen to a custom element (the flag) in the server's environment (the root). To put simply, it has an abstract capture-the-flag game algorithm. In theory, it would works just great, but the flag doesn't really exists in the world space - nobody even know where it is. &lt;br /&gt;
&lt;br /&gt;
I suppose you just have an meta.xml and ctf.lua in your resource. So if it runs in the server (no conflicting gamemode or errors) we can take the next step to spawn and represent our flag in GTA's world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Flag World Represetation===&lt;br /&gt;
Soon...&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Changelogs&amp;diff=44407</id>
		<title>Template:PT-BR/Changelogs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Changelogs&amp;diff=44407"/>
		<updated>2015-02-08T22:39:42Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #FFF; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=140 style=&amp;quot;background-color: #D6DCFF; border-style: solid; border-width: 1px; border-color: #FFF; color:#00000;&amp;quot;| Versão do MTA:SA&lt;br /&gt;
!width=400 style=&amp;quot;white-space: nowrap; background-color: #D6DCFF; border-style: solid; border-width: 1px; border-color: #FFF;&amp;quot;| Novidades&lt;br /&gt;
{{Changelogsrow|1.0|1.0.0 &amp;amp;bull; 1.0.1 &amp;amp;bull; 1.0.2 &amp;amp;bull; 1.0.3 &amp;amp;bull; 1.0.4}}&lt;br /&gt;
{{Changelogsrow|1.1|1.1.0 &amp;amp;bull; 1.1.1}}&lt;br /&gt;
{{Changelogsrow|1.2|1.2.0}}&lt;br /&gt;
{{Changelogsrow|1.3|[[PT-BR/Novidades na versão 1.3|1.3.0]] &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.1|1.3.1]] &amp;amp;bull; 1.3.2 &amp;amp;bull; 1.3.3 &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.4|1.3.4]] &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.5|1.3.5]]}}&lt;br /&gt;
{{Changelogsrow|1.4|[[PT-BR/Novidades_na_versão_1.4.0|1.4.0]] &amp;amp;bull; [[PT-BR/Novidades na versão 1.4.1|1.4.1]]}}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Changes_in_1.4.1&amp;diff=44406</id>
		<title>Changes in 1.4.1</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Changes_in_1.4.1&amp;diff=44406"/>
		<updated>2015-02-08T22:37:25Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Main Additions / Changes ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New functions ===&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* Added [[hash]]&lt;br /&gt;
* Added 'sourceTimer' global variable to timer function&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New Events ===&lt;br /&gt;
&lt;br /&gt;
==== Client ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Scripting: Changes, Bugfixes and Additions ===&lt;br /&gt;
* Now [[forcePlayerMap]] is a client-side and server-side function&lt;br /&gt;
* Fixed a bug when redefining [[Vector|Vectors]] and [[Matrix|Matrices]] (issue [http://bugs.multitheftauto.com/view.php?id=8660 #8660])&lt;br /&gt;
* Fixed a crash when trying to get the key of a control bound to a function clientside (issue [http://bugs.multitheftauto.com/view.php?id=8474 #8474])&lt;br /&gt;
* Fixed setWeaponFlags(weapon, &amp;quot;flags&amp;quot;) returning ''false'' (issue [http://bugs.multitheftauto.com/view.php?id=8686 #8686])&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
=== Client: Additions ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
=== Client: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== Server: Additions ===&lt;br /&gt;
&lt;br /&gt;
=== Server: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Extra information ==&lt;br /&gt;
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and Google Code repositories:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[pt-br:Novidades_na_versão_1.4.1]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.1&amp;diff=44405</id>
		<title>PT-BR/Novidades na versão 1.4.1</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.1&amp;diff=44405"/>
		<updated>2015-02-08T22:36:04Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Created page with &amp;quot;{{PT-BR/Changelogs}}  == Principais Mudanças == * Nada até agora  == Scripting ==  === Novas funções ===  ====Cliente==== * Nada até agora  ====Servidor==== * Nada até a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Principais Mudanças ==&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Novas funções ===&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
====Servidor====&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* Adicionada [[hash]]&lt;br /&gt;
* Adicionada a variável global &amp;quot;sourceTimer&amp;quot; para a funções de tempo&lt;br /&gt;
&lt;br /&gt;
=== Novos Eventos ===&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
====Servidor====&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
=== Mudanças, correções de bugs ===&lt;br /&gt;
* A função [[forcePlayerMap]] funciona tanto no lado do cliente, quanto servidor.&lt;br /&gt;
* Corrigido bug ao redefinir [[Vector|Vetores]] and [[Matrix|Matrizes]] (problema [http://bugs.multitheftauto.com/view.php?id=8660 #8660])&lt;br /&gt;
* Corrigido travamento ao tentar obter a tecla vinculada a uma função do cliente (problema [http://bugs.multitheftauto.com/view.php?id=8474 #8474])&lt;br /&gt;
* Corrigido o fato da função setWeaponFlags(weapon, &amp;quot;flags&amp;quot;) estar retornado &amp;quot;falso&amp;quot; (problema [http://bugs.multitheftauto.com/view.php?id=8686 #8686])&lt;br /&gt;
&lt;br /&gt;
==Cliente==&lt;br /&gt;
&lt;br /&gt;
===Novidades===&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
===Correções de bugs e mudanças===&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
==Servidor==&lt;br /&gt;
&lt;br /&gt;
===Novidades===&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
===Correções de bugs e mudanças===&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
==Recursos==&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
==Editor==&lt;br /&gt;
* Nada até agora&lt;br /&gt;
&lt;br /&gt;
== Informações extras ==&lt;br /&gt;
''Informações mais detalhadas estão disponíveis em nosso Changelog do [https://bugs.multitheftauto.com/changelog_page.php Bug tracker] e no Google Code:''&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.1]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=44404</id>
		<title>Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=44404"/>
		<updated>2015-02-08T22:16:17Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding: 5px; height: 130px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px]]'''Bem vindo ao Wiki do Multi Theft Auto.''' Aqui você encontra tudo sobre o uso desta modificação.&lt;br /&gt;
&lt;br /&gt;
Há muitas [[How you can help|coisas em que você pode nos ajudar]] para melhorar este programa, como criar um mapa, um modo de jogo, documentar funções e eventos, escrever códigos úteis para outros usuários, fazer tutoriais, reportar bugs que encontrar ou somente jogar a vontade!&lt;br /&gt;
&lt;br /&gt;
Se você tem alguma dúvida a respeito do Multi Theft Auto, não se esqueça de perguntar à comunidade em nossos [http://forum.mtasa.com/ fóruns].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Jogar&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Baixe o Multi Theft Auto {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Onde_adquirir_o_GTASA|Onde adquirir o GTASA]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Cliente|Manual do usuário]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Novidades_na_versão_{{Current Version|full}}|Novidades da última versão ]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Soluções_de_Problemas_-_FAQ|Solução de problemas]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Migrando_do_MTA:Race_ao_MTA:SA_1.3|Migrando do MTA:Race para o MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Servidor|Manual do servidor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Recursos:Map_Manager|Gerenciador de mapas (''Map Manager'')]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Editor de mapas&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor|Manual do editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor-EDF|Ficheiro de definições do editor (EDF)]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor-Plugins|Extensões para o editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor#FAQ|Perguntas frequentes (FAQ)]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Banco de dados&amp;lt;/h3&amp;gt;&lt;br /&gt;
Aqui tem tudo relacionado às vantagens que Lua tem a oferecer ao MTA e seus recursos.&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[:Category:Resource|Catálogo de Recursos]] - Você deve aprender com eles para fazer scripts bons&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Scripts_do_Cliente|Scripts do Cliente]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Módulos|Módulos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Desenvolvimento do Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Últimas compilações]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA|Compilando o MTASA no Windows]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Mac_OS_X|Compilando o MTASA no Mac OS X]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Linux|Compilando o MTASA no Linux]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Guia_do_Desenvolvedor|Guia do Desenvolvedor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://code.google.com/p/mtasa-blue Código fonte no Google Code]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Roadmap|Roteiro para versões futuras]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://bugs.mtasa.com/ Central de bugs]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Como você pode nos ajudar&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Documentar funções ou eventos&lt;br /&gt;
* Criar exemplos funcionais e eficientes de funções e eventos&lt;br /&gt;
* Examinar e corrigir as páginas&lt;br /&gt;
* Escrever tutoriais para ajudar novatos&lt;br /&gt;
* Ajudar a traduzir as páginas da Wiki para outras linguagens&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Comunidade&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.multitheftauto.com/ Fóruns]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [irc://irc.multitheftauto.com/mta IRC]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://community.mtasa.com/ Comunidade]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://twitter.com/#!/MTAQA/ Twitter] &lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.youtube.com/user/MTAQA Youtube]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://plus.google.com/102014133442331779727/ Google]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introdução_ao_Scripting|Introdução a ''scripting'']]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introducao_ao_GUI_scripting|Introdução a ''scripting'' de UI]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[Depuração|Depuração]] - Encontre erros em seu Script&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Recursos|Introdução a recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Acesso web via recursos|Acesso web via recursos]] - Abra servidores web através de recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[:Category:PT-BR/Recursos|Lista de recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[O arquivo Meta|Meta.xml]] - Todo recurso possui um arquivo meta descrevendo a si próprio&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[Lista de Controle de Acesso|Lista de controle de acesso (ACL)]] - Componente vital para recursos complexos&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Composição_de_Gamemodes|Composição de modos de jogo]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[PT-BR/Funções_Úteis|Funções Úteis]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Links dos fóruns&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [http://forum.mtasa.com/viewforum.php?f=152 Secção do fórum para dúvidas sobre ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewforum.php?f=148 Guias de ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Wiki ''offline'']&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Manuais sobre Lua&amp;lt;/h3&amp;gt;&lt;br /&gt;
Página muito útil para ajuda-lo a entender o funcionamento do Lua&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/portugues.html Introdução à linguagem]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html Manual básico]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/manual/5.1/pt/ Manual de referência]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://lua-users.org/wiki/TutorialDirectory Outra wiki, somente de Lua]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Referência&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Functions|Funções do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Events|Eventos do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Functions|Funções do servidor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Events|Eventos do servidor]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[MTA Classes|Classes do Multi Theft Auto]] - Informações detalhadas sobre todas as classes do MTA&lt;br /&gt;
** [[File:iUS.png|Em Inglês|20px]] [[Element tree|Árvore dos elementos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|Lista de IDs de objetos e texturas]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animações]]&lt;br /&gt;
*[[Character Skins|''Skins'' de pedestres]]&lt;br /&gt;
*[[Roupas do CJ|Roupas do CJ]]&lt;br /&gt;
*[[Garage|Garagens]]&lt;br /&gt;
*[[Interior IDs|Interiores]]&lt;br /&gt;
*[[Material IDs|Materiais]]&lt;br /&gt;
*[[Projectiles|Projéteis]]&lt;br /&gt;
*[[Radar Blips|''Blips'']]&lt;br /&gt;
*[[Sounds|Efeitos sonoros]]&lt;br /&gt;
*[[Vehicle IDs|Veículos]]&lt;br /&gt;
*[[Vehicle Colors|Cores dos veículos]]&lt;br /&gt;
*[[Vehicle Upgrades|Acessórios dos veículos]]&lt;br /&gt;
*[[Vehicle variants|Variantes dos veículos]]&lt;br /&gt;
*[[Weapons|Armas]]&lt;br /&gt;
*[[Weather|Ambientação]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:pBR.png|32px]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Sobre a Tradução&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Tradutores:&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=50642|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;RaceXtreme&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=59023|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;StanleySathler&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=55744|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;DNL291&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=62091|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Ninguem&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=63192|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Anderl&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
É importante que todos colaborem para que nossa página em português fique melhor a cada dia!&lt;br /&gt;
&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/]]&lt;br /&gt;
'''Multi Theft Auto''' é um projeto '''open source'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Sobre o Multi Theft Auto'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive|Arquivos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage|Eventos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Desenvolvedores]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Baixe-o]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Solução de problemas]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Status da Wiki'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} artigos&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} páginas&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} usuários registrados&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|pt-br}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Roupas_do_CJ&amp;diff=44403</id>
		<title>Roupas do CJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Roupas_do_CJ&amp;diff=44403"/>
		<updated>2015-02-08T22:11:47Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta página contem uma lista com todo o vestuário do CJ, incluindo o ID e uma imagem para melhor identificação de cada peça.&lt;br /&gt;
&lt;br /&gt;
*[[CJ Clothes\Shirt (0)|Tipo 0 - Camisas]]&lt;br /&gt;
*[[CJ Clothes\Head (1)|Tipo 1 - Cabelo e/ou Barba]]&lt;br /&gt;
*[[CJ Clothes\Trousers (2)|Tipo 2 - Calças]]&lt;br /&gt;
*[[CJ Clothes\Shoes (3)|Tipo 3 - Sapatos]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Upper Arm (4)|Tipo 4 - Tatuagens na parte superior do braço esquerdo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Lower Arm (5)|Tipo 5 - Tatuagens na parte inferior do braço esquerdo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Upper Arm (6)|Tipo 6 - Tatuagens na parte superior do braço direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Lower Arm (7)|Tipo 7 - Tatuagens na parte inferior do braço direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Back (8)|Tipo 8 - Tatuagens nas costas]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Chest (9)|Tipo 9 - Tatuagens no peito esquedo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Chest (10)|Tipo 10 - Tatuagens no peito direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Stomach (11)|Tipo 11 - Tatuagens na barriga]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Lower Back (12)|Tipo 12 - Tatuagens nas costas]]&lt;br /&gt;
*[[CJ Clothes\Necklace (13)|Tipo 13 - Colares]]&lt;br /&gt;
*[[CJ Clothes\Watches (14)|Tipo 14 - Relógios]]&lt;br /&gt;
*[[CJ Clothes\Glasses (15)|Tipo 15 - Óculos]]&lt;br /&gt;
*[[CJ Clothes\Hats (16)|Tipo 16 - Chapéus]]&lt;br /&gt;
*[[CJ Clothes\Extra (17)|Tipo 17 - Diversos]]&lt;br /&gt;
&lt;br /&gt;
==Funções relacionadas==&lt;br /&gt;
Estão listadas abaixo as funções que podem interagir com esse tipo de elemento (vestimentos do personagem).&lt;br /&gt;
{{Client_Clothes and body functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CJ Clothes]]&lt;br /&gt;
[[it:Vestiti di CJ]]&lt;br /&gt;
[[ru:CJ Clothes]]&lt;br /&gt;
[[de:CJ Kleider]]&lt;br /&gt;
[[Category:Conceitos de Scripting]]&lt;br /&gt;
[[Category:Translated/ID Lists]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Roupas_do_CJ&amp;diff=44402</id>
		<title>PT-BR/Roupas do CJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Roupas_do_CJ&amp;diff=44402"/>
		<updated>2015-02-08T22:11:24Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Roupas do CJ to Roupas do CJ&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Roupas do CJ]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Roupas_do_CJ&amp;diff=44401</id>
		<title>Roupas do CJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Roupas_do_CJ&amp;diff=44401"/>
		<updated>2015-02-08T22:11:24Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Roupas do CJ to Roupas do CJ&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta página contem uma lista com todo o vestuário do CJ, incluindo o ID e uma imagem para melhor identificação de cada peça.&lt;br /&gt;
&lt;br /&gt;
*[[CJ Clothes\Shirt (0)|Tipo 0 - Camisas]]&lt;br /&gt;
*[[CJ Clothes\Head (1)|Tipo 1 - Cabelo e/ou Barba]]&lt;br /&gt;
*[[CJ Clothes\Trousers (2)|Tipo 2 - Calças]]&lt;br /&gt;
*[[CJ Clothes\Shoes (3)|Tipo 3 - Sapatos]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Upper Arm (4)|Tipo 4 - Tatuagens na parte superior do braço esquerdo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Lower Arm (5)|Tipo 5 - Tatuagens na parte inferior do braço esquerdo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Upper Arm (6)|Tipo 6 - Tatuagens na parte superior do braço direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Lower Arm (7)|Tipo 7 - Tatuagens na parte inferior do braço direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Back (8)|Tipo 8 - Tatuagens nas costas]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Left Chest (9)|Tipo 9 - Tatuagens no peito esquedo]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Right Chest (10)|Tipo 10 - Tatuagens no peito direito]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Stomach (11)|Tipo 11 - Tatuagens na barriga]]&lt;br /&gt;
*[[CJ Clothes\Tattoos: Lower Back (12)|Tipo 12 - Tatuagens nas costas]]&lt;br /&gt;
*[[CJ Clothes\Necklace (13)|Tipo 13 - Colares]]&lt;br /&gt;
*[[CJ Clothes\Watches (14)|Tipo 14 - Relógios]]&lt;br /&gt;
*[[CJ Clothes\Glasses (15)|Tipo 15 - Óculos]]&lt;br /&gt;
*[[CJ Clothes\Hats (16)|Tipo 16 - Chapéus]]&lt;br /&gt;
*[[CJ Clothes\Extra (17)|Tipo 17 - Diversos]]&lt;br /&gt;
&lt;br /&gt;
==Funções relacionadas==&lt;br /&gt;
Estão listadas abaixo as funções que podem interagir com esse tipo de elemento (vestimentos do personagem).&lt;br /&gt;
{{Client_Clothes and body functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:CJ Clothes]]&lt;br /&gt;
[[it:Vestiti di CJ]]&lt;br /&gt;
[[ru:CJ Clothes]]&lt;br /&gt;
[[de:CJ Kleider]]&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
[[Category:Translated/ID Lists]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=O_arquivo_Meta&amp;diff=44400</id>
		<title>O arquivo Meta</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=O_arquivo_Meta&amp;diff=44400"/>
		<updated>2015-02-08T22:09:17Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O ''meta.xml'' é um arquivo de metadados que define ao MTA os conceitos iniciais de um recurso. Exemplos seriam seu nome, os scripts a serem usados e quais devem ser pré-carregados para serem transferidos ao cliente; junto a outros de sua natureza. Ele também transforma arquivos em elementos, a exemplo de sons, imagens e modelos. É escrito em XML, o qual é baseado em HTML e é pai do XHTML.&lt;br /&gt;
&lt;br /&gt;
''obs'': Metadados são dados sobre outros dados. O termo é estranho, mas o próprio nome já diz. No caso do MTA eles seriam metadados descritivos, pois se referem ao conteúdo do jogo.&lt;br /&gt;
&lt;br /&gt;
=Tags=&lt;br /&gt;
O XML é um formato de texto muito usado para representar dados, inclusive pelo MTA. As tags a seguir são todas as possibilidades: &lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;info /&amp;gt;''' Representa informações sobre o recurso que podem ser usados de forma opcional, e lidos pela função [[getResourceInfo]], caso necessário:&lt;br /&gt;
** '''author:''' O autor do recurso&lt;br /&gt;
** '''version:''' A versão do recurso&lt;br /&gt;
** '''name:'''' O nome do recurso&lt;br /&gt;
** '''description:''' Uma breve descrição do recurso&lt;br /&gt;
** '''type:''' Qual é o tipo do recurso, pode ser um &amp;quot;gamemode&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;map&amp;quot;, ou &amp;quot;misc&amp;quot;.&lt;br /&gt;
* '''&amp;lt;script /&amp;gt;''' O código fonte do recurso, os possíveis parâmetros são:&lt;br /&gt;
** '''src:''' O nome do arquivo do código fonte&lt;br /&gt;
** '''type:''' O tipo de código-fonte: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; ou &amp;quot;shared&amp;quot;.&lt;br /&gt;
** '''cache:''' Quando o script é do tipo client, esse atributo diz se o arquivo será salvo ou não no disco rígido dele. O padrão é &amp;quot;true&amp;quot;, se for usado o contrário, será apagado quando o recurso parar.&lt;br /&gt;
** '''validate:''' Se for definido como falso, o MTA não verificará se é compatível&lt;br /&gt;
* '''&amp;lt;map /&amp;gt;''' Define mapa do gamemode, os possíveis atributos são:&lt;br /&gt;
** '''src:''' o nome do arquivo .map (pode também ser o diretório, ex: ''maps/nome-do-mapa.map)&lt;br /&gt;
** '''dimension:''' Dimensão em que o mapa será carregado (opcional)&lt;br /&gt;
* '''&amp;lt;File /&amp;gt;''' Um arquivo do lado do cliente. Geralmente são imagens, .txd, .col, .dff ou arquivos .xml. Eles vão ser baixado pelos clientes quando o recurso é iniciado (ou quando ele entrar no servidor)&lt;br /&gt;
** '''src:''' nome do arquivo do lado do cliente (pode ser outro caminho por exemplo, &amp;quot;images/imagem.png&amp;quot;.)&lt;br /&gt;
** '''download:''' Vai ou não ser enviado para o cliente automaticamente(opcional). O padrão é &amp;quot;true&amp;quot;. Usando &amp;quot;false&amp;quot; significa que eles não são enviados no início de recursos, mas poderia ser usado posteriormente por DownloadFile (a partir da versão 1.4)&lt;br /&gt;
*'''&amp;lt;include /&amp;gt;''' Inclui os recursos necessários a estarem rodando&lt;br /&gt;
**'''resource:''' Nome do recurso que você quer iniciar junto com esse&lt;br /&gt;
**'''minversion:''' A versão mínima desse recurso (opcional)&lt;br /&gt;
**'''maxversion:''' A versão máxima desse recurso (opcional)&lt;br /&gt;
*'''&amp;lt;config /&amp;gt;''' O arquivo de configuração em XML a ser usado pelo recurso:&lt;br /&gt;
**'''src:''' Seu nome&lt;br /&gt;
**'''type:''' Seu tipo: &amp;quot;client&amp;quot; ou &amp;quot;server&amp;quot;&lt;br /&gt;
*'''&amp;lt;export /&amp;gt;''' Exporta uma função do seu recurso, para que outros possam usa-la com o [[call]]&lt;br /&gt;
**'''function:''' O nome da função&lt;br /&gt;
**'''type:''' Diz se será exportado para o lado do cliente ou servidor (valores válidos são: &amp;quot;server&amp;quot; ou &amp;quot;client&amp;quot;)&lt;br /&gt;
**'''http:''' Indica se ele pode ser chamado via HTTP (&amp;quot;true&amp;quot; ou &amp;quot;false&amp;quot;)&lt;br /&gt;
*'''&amp;lt;html /&amp;gt;'''&lt;br /&gt;
**'''src:''' O nome do arquivo HTTP (pode ser um diretório)&lt;br /&gt;
**'''default:''' Qual arquivo html a ser mostrado por padrão ao acessar o caminho ''/nome-do-recurso/'' no servidor. Somente um html pode ser definido, os outros são ignorados (true/false)&lt;br /&gt;
**'''raw:''' O arquivo html não é interpretado pelo Lua e assim só passa como um dado binário. Deve ser usado para arquivos binários, como imagens principalmente (true/false)&lt;br /&gt;
*'''&amp;lt;settings&amp;gt; &amp;lt;setting name=&amp;quot;&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt; &amp;lt;/settings&amp;gt;:''' Muitos gamemodes usam o [[PT-BR/Sistema_de_Configurações|sistema de configurações]] para habilitar administradores do servidor configurá-los como desejarem. Um exemplo seria definir o tempo de duração da partida e usar o [[get]] e [[set]] para manipular o valor responsável por isso.&lt;br /&gt;
*'''&amp;lt;min_mta_version /&amp;gt;''' Versão mínima do MTA para o recurso rodar sem problemas. Quando estiver terminando um recurso, a versão mínima deve a mesma da versão do MTA:SA que está usando (a qual no momento é {{Current Version|full}}). Veja o exemplo abaixo.&lt;br /&gt;
**'''client:''' A versão mínima do cliente&lt;br /&gt;
**'''server:''' A versão mínima do servidor&lt;br /&gt;
*'''&amp;lt;aclrequest /&amp;gt;''' Indica uma lista de permissões do [[Access_Control_List|ACL]] a serem usados pelo recurso.&lt;br /&gt;
*'''&amp;lt;sync_map_element_data /&amp;gt;''' Indica se os dados de elemento como &amp;quot;PosX&amp;quot; e &amp;quot;DoubleSided&amp;quot; são tranferidos para o cliente. Esses geralmente não são necessários por muitos gamemodes ou recursos, exceto ''Map Editor'' e ''Interiors''; caso contrário, não funcionarão. Quando definido no recurso, se aplicará a todos os mapas carregados por ele.&lt;br /&gt;
**'''false:''' Desabilita essa transferência para todos os recursos. Isso pode reduzir a demora de download consideravelmente.&lt;br /&gt;
**'''true:''' Habilita essa tranferência. Se esses valores forem definidos de forma distinta entre os recursos, o que estiver configurado como &amp;quot;true&amp;quot; terá prioridade e todos os demais transferirão esse mesmo dado.&lt;br /&gt;
*'''&amp;lt;oop/&amp;gt;''' OOP - Veja mais informações na página: [[OOP]]&lt;br /&gt;
**'''false:''' Desabilita o OOP.&lt;br /&gt;
**'''true:''' Habilita-o&lt;br /&gt;
&lt;br /&gt;
== Exemplo ==&lt;br /&gt;
Aqui está um exemplo de um arquivo meta usando algumas das tags mencionadas:&lt;br /&gt;
{{#tag:code |&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Slothman&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Stealth&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;config src=&amp;quot;help.xml&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;min_mta_version client=&amp;quot;{{Current Version|full}}&amp;quot; server=&amp;quot;{{Current Version|full}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;sync_map_element_data&amp;gt;false&amp;lt;/sync_map_element_data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noiseblip.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;mission_timer.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_client.lua&amp;quot; type=&amp;quot;client&amp;quot; validate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noisebar.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;spycam.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;riemann_z_demonstration.lua&amp;quot; type=&amp;quot;client&amp;quot; cache=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;map src=&amp;quot;base.map&amp;quot; dimension=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.txd&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.dff&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.col&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;armor.png&amp;quot; download=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;camera.png&amp;quot; download=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;cloak.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;goggles.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;mine.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;radar.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;shield.png&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;scoreboard&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;killmessages&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;maplimits&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport1&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport2&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport3&amp;quot; type=&amp;quot;shared&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;settings&amp;gt;&lt;br /&gt;
         &amp;lt;setting name=&amp;quot;roundlimit&amp;quot; value=&amp;quot;[6]&amp;quot; /&amp;gt; &amp;lt;!-- duração da partida em minutos --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teamdamage&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!-- 0 para desligar a proteção de time e 1 para ligar --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teambalance&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!--  o limite de diferença entre o número de jogadores dos times --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;spazammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt; &amp;lt;!-- quantidade de munição --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;m4ammo&amp;quot; value=&amp;quot;[100]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;shotgunammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;sniperammo&amp;quot; value=&amp;quot;[20]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;ak47ammo&amp;quot; value=&amp;quot;[120]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;rifleammo&amp;quot; value=&amp;quot;[40]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;deserteagleammo&amp;quot; value=&amp;quot;[45]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;pistolammo&amp;quot; value=&amp;quot;[132]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;uziammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;tec9ammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;silencedammo&amp;quot; value=&amp;quot;[65]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;grenadeammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;satchelammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teargasammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;molatovammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;isAllowedToShoot&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/settings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;aclrequest&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/aclrequest&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
|lang=&amp;quot;xml&amp;quot;}}&lt;br /&gt;
[[Category:Conceitos de Scripting]]&lt;br /&gt;
[[en:Meta.xml]]&lt;br /&gt;
[[cs:Meta.xml]]&lt;br /&gt;
[[de:Meta.xml]]&lt;br /&gt;
[[es:Sobre el archivo &amp;quot;meta.xml&amp;quot;]]&lt;br /&gt;
[[it:Meta.xml]]&lt;br /&gt;
[[pl:Meta.xml]]&lt;br /&gt;
[[ru:Meta.xml]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Meta.xml&amp;diff=44399</id>
		<title>PT-BR/Meta.xml</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Meta.xml&amp;diff=44399"/>
		<updated>2015-02-08T22:08:37Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Meta.xml to O arquivo Meta&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[O arquivo Meta]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=O_arquivo_Meta&amp;diff=44398</id>
		<title>O arquivo Meta</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=O_arquivo_Meta&amp;diff=44398"/>
		<updated>2015-02-08T22:08:37Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Meta.xml to O arquivo Meta&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O ''meta.xml'' é um arquivo de metadados que define ao MTA os conceitos iniciais de um recurso. Exemplos seriam seu nome, os scripts a serem usados e quais devem ser pré-carregados para serem transferidos ao cliente; junto a outros de sua natureza. Ele também transforma arquivos em elementos, a exemplo de sons, imagens e modelos. É escrito em XML, o qual é baseado em HTML e é pai do XHTML.&lt;br /&gt;
&lt;br /&gt;
''obs'': Metadados são dados sobre outros dados. O termo é estranho, mas o próprio nome já diz. No caso do MTA eles seriam metadados descritivos, pois se referem ao conteúdo do jogo.&lt;br /&gt;
&lt;br /&gt;
=Tags=&lt;br /&gt;
O XML é um formato de texto muito usado para representar dados, inclusive pelo MTA. As tags a seguir são todas as possibilidades: &lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;info /&amp;gt;''' Representa informações sobre o recurso que podem ser usados de forma opcional, e lidos pela função [[getResourceInfo]], caso necessário:&lt;br /&gt;
** '''author:''' O autor do recurso&lt;br /&gt;
** '''version:''' A versão do recurso&lt;br /&gt;
** '''name:'''' O nome do recurso&lt;br /&gt;
** '''description:''' Uma breve descrição do recurso&lt;br /&gt;
** '''type:''' Qual é o tipo do recurso, pode ser um &amp;quot;gamemode&amp;quot;, &amp;quot;script&amp;quot;, &amp;quot;map&amp;quot;, ou &amp;quot;misc&amp;quot;.&lt;br /&gt;
* '''&amp;lt;script /&amp;gt;''' O código fonte do recurso, os possíveis parâmetros são:&lt;br /&gt;
** '''src:''' O nome do arquivo do código fonte&lt;br /&gt;
** '''type:''' O tipo de código-fonte: &amp;quot;client&amp;quot;, &amp;quot;server&amp;quot; ou &amp;quot;shared&amp;quot;.&lt;br /&gt;
** '''cache:''' Quando o script é do tipo client, esse atributo diz se o arquivo será salvo ou não no disco rígido dele. O padrão é &amp;quot;true&amp;quot;, se for usado o contrário, será apagado quando o recurso parar.&lt;br /&gt;
** '''validate:''' Se for definido como falso, o MTA não verificará se é compatível&lt;br /&gt;
* '''&amp;lt;map /&amp;gt;''' Define mapa do gamemode, os possíveis atributos são:&lt;br /&gt;
** '''src:''' o nome do arquivo .map (pode também ser o diretório, ex: ''maps/nome-do-mapa.map)&lt;br /&gt;
** '''dimension:''' Dimensão em que o mapa será carregado (opcional)&lt;br /&gt;
* '''&amp;lt;File /&amp;gt;''' Um arquivo do lado do cliente. Geralmente são imagens, .txd, .col, .dff ou arquivos .xml. Eles vão ser baixado pelos clientes quando o recurso é iniciado (ou quando ele entrar no servidor)&lt;br /&gt;
** '''src:''' nome do arquivo do lado do cliente (pode ser outro caminho por exemplo, &amp;quot;images/imagem.png&amp;quot;.)&lt;br /&gt;
** '''download:''' Vai ou não ser enviado para o cliente automaticamente(opcional). O padrão é &amp;quot;true&amp;quot;. Usando &amp;quot;false&amp;quot; significa que eles não são enviados no início de recursos, mas poderia ser usado posteriormente por DownloadFile (a partir da versão 1.4)&lt;br /&gt;
*'''&amp;lt;include /&amp;gt;''' Inclui os recursos necessários a estarem rodando&lt;br /&gt;
**'''resource:''' Nome do recurso que você quer iniciar junto com esse&lt;br /&gt;
**'''minversion:''' A versão mínima desse recurso (opcional)&lt;br /&gt;
**'''maxversion:''' A versão máxima desse recurso (opcional)&lt;br /&gt;
*'''&amp;lt;config /&amp;gt;''' O arquivo de configuração em XML a ser usado pelo recurso:&lt;br /&gt;
**'''src:''' Seu nome&lt;br /&gt;
**'''type:''' Seu tipo: &amp;quot;client&amp;quot; ou &amp;quot;server&amp;quot;&lt;br /&gt;
*'''&amp;lt;export /&amp;gt;''' Exporta uma função do seu recurso, para que outros possam usa-la com o [[call]]&lt;br /&gt;
**'''function:''' O nome da função&lt;br /&gt;
**'''type:''' Diz se será exportado para o lado do cliente ou servidor (valores válidos são: &amp;quot;server&amp;quot; ou &amp;quot;client&amp;quot;)&lt;br /&gt;
**'''http:''' Indica se ele pode ser chamado via HTTP (&amp;quot;true&amp;quot; ou &amp;quot;false&amp;quot;)&lt;br /&gt;
*'''&amp;lt;html /&amp;gt;'''&lt;br /&gt;
**'''src:''' O nome do arquivo HTTP (pode ser um diretório)&lt;br /&gt;
**'''default:''' Qual arquivo html a ser mostrado por padrão ao acessar o caminho ''/nome-do-recurso/'' no servidor. Somente um html pode ser definido, os outros são ignorados (true/false)&lt;br /&gt;
**'''raw:''' O arquivo html não é interpretado pelo Lua e assim só passa como um dado binário. Deve ser usado para arquivos binários, como imagens principalmente (true/false)&lt;br /&gt;
*'''&amp;lt;settings&amp;gt; &amp;lt;setting name=&amp;quot;&amp;quot; value=&amp;quot;&amp;quot;/&amp;gt; &amp;lt;/settings&amp;gt;:''' Muitos gamemodes usam o [[PT-BR/Sistema_de_Configurações|sistema de configurações]] para habilitar administradores do servidor configurá-los como desejarem. Um exemplo seria definir o tempo de duração da partida e usar o [[get]] e [[set]] para manipular o valor responsável por isso.&lt;br /&gt;
*'''&amp;lt;min_mta_version /&amp;gt;''' Versão mínima do MTA para o recurso rodar sem problemas. Quando estiver terminando um recurso, a versão mínima deve a mesma da versão do MTA:SA que está usando (a qual no momento é {{Current Version|full}}). Veja o exemplo abaixo.&lt;br /&gt;
**'''client:''' A versão mínima do cliente&lt;br /&gt;
**'''server:''' A versão mínima do servidor&lt;br /&gt;
*'''&amp;lt;aclrequest /&amp;gt;''' Indica uma lista de permissões do [[Access_Control_List|ACL]] a serem usados pelo recurso.&lt;br /&gt;
*'''&amp;lt;sync_map_element_data /&amp;gt;''' Indica se os dados de elemento como &amp;quot;PosX&amp;quot; e &amp;quot;DoubleSided&amp;quot; são tranferidos para o cliente. Esses geralmente não são necessários por muitos gamemodes ou recursos, exceto ''Map Editor'' e ''Interiors''; caso contrário, não funcionarão. Quando definido no recurso, se aplicará a todos os mapas carregados por ele.&lt;br /&gt;
**'''false:''' Desabilita essa transferência para todos os recursos. Isso pode reduzir a demora de download consideravelmente.&lt;br /&gt;
**'''true:''' Habilita essa tranferência. Se esses valores forem definidos de forma distinta entre os recursos, o que estiver configurado como &amp;quot;true&amp;quot; terá prioridade e todos os demais transferirão esse mesmo dado.&lt;br /&gt;
*'''&amp;lt;oop/&amp;gt;''' OOP - Veja mais informações na página: [[OOP]]&lt;br /&gt;
**'''false:''' Desabilita o OOP.&lt;br /&gt;
**'''true:''' Habilita-o&lt;br /&gt;
&lt;br /&gt;
== Exemplo ==&lt;br /&gt;
Aqui está um exemplo de um arquivo meta usando algumas das tags mencionadas:&lt;br /&gt;
{{#tag:code |&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
    &amp;lt;info author=&amp;quot;Slothman&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;Stealth&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;config src=&amp;quot;help.xml&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;min_mta_version client=&amp;quot;{{Current Version|full}}&amp;quot; server=&amp;quot;{{Current Version|full}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;sync_map_element_data&amp;gt;false&amp;lt;/sync_map_element_data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noiseblip.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;mission_timer.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_server.lua&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;gadgets_client.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;stealthmain_client.lua&amp;quot; type=&amp;quot;client&amp;quot; validate=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;noisebar.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;spycam.lua&amp;quot; type=&amp;quot;client&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;riemann_z_demonstration.lua&amp;quot; type=&amp;quot;client&amp;quot; cache=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;map src=&amp;quot;base.map&amp;quot; dimension=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.txd&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.dff&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;riot_shield.col&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;armor.png&amp;quot; download=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;camera.png&amp;quot; download=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;cloak.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;goggles.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;mine.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;radar.png&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;file src=&amp;quot;shield.png&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;scoreboard&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;killmessages&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;include resource=&amp;quot;maplimits&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport1&amp;quot; type=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport2&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;export function=&amp;quot;exampleExport3&amp;quot; type=&amp;quot;shared&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;settings&amp;gt;&lt;br /&gt;
         &amp;lt;setting name=&amp;quot;roundlimit&amp;quot; value=&amp;quot;[6]&amp;quot; /&amp;gt; &amp;lt;!-- duração da partida em minutos --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teamdamage&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!-- 0 para desligar a proteção de time e 1 para ligar --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teambalance&amp;quot; value=&amp;quot;[1]&amp;quot; /&amp;gt; &amp;lt;!--  o limite de diferença entre o número de jogadores dos times --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;spazammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt; &amp;lt;!-- quantidade de munição --&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;m4ammo&amp;quot; value=&amp;quot;[100]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;shotgunammo&amp;quot; value=&amp;quot;[25]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;sniperammo&amp;quot; value=&amp;quot;[20]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;ak47ammo&amp;quot; value=&amp;quot;[120]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;rifleammo&amp;quot; value=&amp;quot;[40]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;deserteagleammo&amp;quot; value=&amp;quot;[45]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;pistolammo&amp;quot; value=&amp;quot;[132]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;uziammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;tec9ammo&amp;quot; value=&amp;quot;[150]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;silencedammo&amp;quot; value=&amp;quot;[65]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;grenadeammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;satchelammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;teargasammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;molatovammo&amp;quot; value=&amp;quot;[4]&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;setting name=&amp;quot;isAllowedToShoot&amp;quot; value=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/settings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;aclrequest&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
	 &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/aclrequest&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
|lang=&amp;quot;xml&amp;quot;}}&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
[[en:Meta.xml]]&lt;br /&gt;
[[cs:Meta.xml]]&lt;br /&gt;
[[de:Meta.xml]]&lt;br /&gt;
[[es:Sobre el archivo &amp;quot;meta.xml&amp;quot;]]&lt;br /&gt;
[[it:Meta.xml]]&lt;br /&gt;
[[pl:Meta.xml]]&lt;br /&gt;
[[ru:Meta.xml]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=44397</id>
		<title>Depuração</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=44397"/>
		<updated>2015-02-08T22:07:53Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Quando você estiver fazendo seu script, certos problemas surgirão. O problema é que nem todos são tão aparentes assim, então esta página irá descrever algumas estratégias básicas para localiza-los.&lt;br /&gt;
&lt;br /&gt;
==Debug no console==&lt;br /&gt;
O MTA vem com um sistema no console onde mensagens de ''debug'' relacionadas às funções e scripts são mostradas. Lembrando que é necessário ter uma permissão de administrador para ativá-lo (a não ser se você modificar o ACL). Para fazer isso, digite ''debugscript *x*'' no console, em que ''x'' é o nível:&lt;br /&gt;
&lt;br /&gt;
* '''1:''' mostra somente os erros&lt;br /&gt;
* '''2:''' erros e avisos&lt;br /&gt;
* '''3:''' erros, avisos e mensagens informativas&lt;br /&gt;
Ao digitar ''debugscript 3'', todas as ocorrências serão mostradas. O nível 3 ou o 2 são os recomendados para a maioria dos casos. É de extrema importância estar com o ''debugscript'' ligado para testar seu script e detectar os erros de digitação. Como também, resolver outros eventuais problemas.&lt;br /&gt;
&lt;br /&gt;
===Exemplo===&lt;br /&gt;
Neste código há dois erros:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;)&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando este script for carregado, no console irá aparecer algo assim:&lt;br /&gt;
:{{Debug info|Loading script failed: meuRecurso\script.lua:2: 'then' expected near ´outputChatbox'}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Isso significa que o script não pode ser executado porque há um erro de sintaxe. Nesta mensagem, primeiramente aparece qual script de qual recurso deu problema. Depois disso, há dois pontos e um número mostrando a linha onde está o erro; para facilitar o trabalho do programador quando se trata de scripts maiores. Depois disso, a mensagem irá variar de acordo com o tipo de erro. Neste caso, é fácil concluir que o erro está localizado no '''meuRecurso''' e na linha dois do arquivo '''script.lua'''. Desta vez está na cara: precisamos colocar o &amp;quot;then&amp;quot; na cláusula ''if''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Fedor&amp;quot;) then&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo será carregado com sucesso e nenhum erro aparecerá até que um jogador apelidado &amp;quot;Cebola&amp;quot; dizer algo no chat. Aí no console irá aparecer:&lt;br /&gt;
:{{Debug error|myResource\script.lua:2: attempt to call global 'outputChatbox' (a nil value)}}&lt;br /&gt;
Isso significa que a função '''outputChatbox''' é um valor ''nil'', ou seja, ele não existe! Isso porque a função na verdade se chama [[outputChatBox]], e não [[outputChatbox]]. Então, tome cuidado com a letra maiúscula B.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;) then&lt;br /&gt;
        outputChatBox(&amp;quot;Bem vindo, Cebola!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
É óbvio que isso é só um exemplo e não será sempre desse jeito, pois há vários tipos de erros em diversos casos. Mas até aqui, uma boa base já foi ensinada.&lt;br /&gt;
&lt;br /&gt;
==Log de debug do Cliente e Servidor==&lt;br /&gt;
====Servidor====&lt;br /&gt;
Na pasta ''../server/mods/deathmatch'', haverá dois arquivos com funções parecidas:&lt;br /&gt;
&lt;br /&gt;
*''local.conf'' - são as configurações oriundas do item &amp;quot;host game&amp;quot; no menu principal do MTA. Isto é uma maneira rápida de iniciar um servidor de testes dentro do próprio programa. Quando o usuário fecha o jogo, ele é automaticamente desligado também.&lt;br /&gt;
&lt;br /&gt;
*''mtaserver.conf'' - é usado quando se inicia o &amp;quot;MTA Server.exe&amp;quot; dentro da pasta ''../server/''. Em outras palavras, o servidor é rodado em prompt de comando e não necessita de o MTA estar executando junto. Isso é muito útil para os interessados em montar um servidor dedicado ou mesmo experimentar como é mexer em um servidor de verdade.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dependendo das suas necessidades, com certeza irá querer alterar essas configurações abaixo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Indica o nome e a localização do arquivo usado pelo debugscript. Se for deixado em branco, o servidor não o salvará. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Indica o nível de debugscript para este arquivo. Todos os níveis 0,1,2,3 estão disponíveis. Quando não especificado, zero é o padrão. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Como as descrições acima já dizem, é opcional salvar um arquivo de log de acordo com o nível desejado. Os três níveis estão descritos acima, sendo neste caso o zero como a não ativação do debugscript - fazendo o arquivo ficar em branco. Se 3 for ativado, todos os erros encontrados no '''lado do servidor''' serão salvos em: ''../server/mods/deathmatch/logs/scripts.log''&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
Todos os erros '''do cliente''' serão salvos na pasta ''../server/clientscript.log''. Isso já é definido por padrão, então nenhuma configuração é necessária.&lt;br /&gt;
&lt;br /&gt;
==Habilidades em Deubug==&lt;br /&gt;
&lt;br /&gt;
Em vez de ficar procurando no código os erros cometidos, há algumas coisas a serem feitas para ajudar a encontrar-los. A maioria delas estão relacionadas com a adição de alguma mensagem de debug informando o que está ocorrendo no script.&lt;br /&gt;
&lt;br /&gt;
===Funções Úteis===&lt;br /&gt;
As funções abaixo podem lhe ajudar com o debug:&lt;br /&gt;
* [[outputDebugString]] ou [[outputChatBox]] para escrever qualquer informação na tela (de preferência outputDebugString para suporte técnico)&lt;br /&gt;
* [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()] para tornar qualquer variável em uma ''string''. Muito útil para saber o que ela é, escrevendo na tela. Não será necessário usa-la se a variável já uma string ou um número.&lt;br /&gt;
* [[getElementType]] verifica o tipo de elemento do MTA em questão.&lt;br /&gt;
* [[isElement]] verifica se elemento existe.&lt;br /&gt;
&lt;br /&gt;
===Adicionando mensagens de debug para verificar ''se'', ''quando'' ou por qual ''frequência'' um código é executado===&lt;br /&gt;
Se você terminou de escrever um código e percebe que algo esperado não acontece e fica em dúvida se as instruções foram executadas ou não; nesse caso é recomendado adicionar mensagens de debug para verificar os passos.&amp;lt;br&amp;gt;&lt;br /&gt;
Um exemplo típico seria checar se uma clausula ''if'' foi atendida ou não:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (variable1 == variable2) then&lt;br /&gt;
	outputDebugString(&amp;quot;A variável 1 é igual a 2.&amp;quot;)&lt;br /&gt;
	-- portanto, faça alguma coisa&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outra maneira semelhante seria verificar se alguma variável muda. Em outras palavras, é só adicionar uma mensagem de debug depois de cada vez que isso acontece.&lt;br /&gt;
&lt;br /&gt;
===Adicionando uma mensagem de debug para verificar o ''valor'' de uma variável===&lt;br /&gt;
Digamos que desejas criar um marcador (marker), mas ele não aparece na posição esperada. A primeira coisa a ser feita é verificar se a função [[createMarker]] foi executada com sucesso. Depois disso, só precisamos verificar os valores usados nela.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local marker = createMarker(x,y,z)&lt;br /&gt;
	if not marker then&lt;br /&gt;
		outputChatBox(&amp;quot;O marcador não pode ser criado.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
outputChatBox(&amp;quot;A posX é &amp;quot;..x..&amp;quot;, posY &amp;quot;..y..&amp;quot;, e posZ &amp;quot;..z)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Feito isso, as variáveis usadas como coordenadas serão mostradas. Lembrando que se uma variável não for uma frase ou número, é recomendado usar a função [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()], pois ela torna qualquer variável agrupável em uma ''string'', mesmo se for uma ''bool'' ou tabela.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Imagine que você criou um [[Colshape|detector de colisão]] e se o jogador ficar dez segundos dentro dele, algo vai acontecer:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, root, colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando o jogador entrar no colshape, o debugscript irá escrever a seguinte mensagem:&lt;br /&gt;
:{{Debug error|..[path]: attempt to index global 'colshapeTimer' (a nil value)}}&lt;br /&gt;
Isso significa que você tentou endereçar uma tabela não existente quando tentou colocar o timer dentro dela; ou seja, ela é um valor ''nil'' - portanto, não existe. Para corrigir isso, precisamos verificar se a tabela não existe, e caso a resposta for positiva; a criaremos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,root,colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Desta vez receberemos um aviso quando o jogador entrar no colshape, esperar a mensagem e sair de lá:&lt;br /&gt;
&lt;br /&gt;
:{{Debug warning|[..]: Bad argument @ 'killTimer' Line: ..}}&lt;br /&gt;
&lt;br /&gt;
Tirando isso (vamos corrigir mais tarde!), tudo parece funcionar bem. O jogador entra no colshape e o ''timer'' começa a contar: se ele esperar, a mensagem é escrita, caso contrário o ''timer'' é destruído. Mas...&lt;br /&gt;
&lt;br /&gt;
===Um erro imperceptível===&lt;br /&gt;
Por alguma razão, quando o jogador entra no colshape usando um veículo, a mensagem é escrita duas vezes; como se o código tivesse sido executado duas vezes. Então, adicionamos uma mensagem de debug para verificar isso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave&amp;quot;)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora dá pra ter certeza que as funções são executadas duas vezes quando entramos com um veículo, mas só uma quando se está a pé. É possível que o veículo seja um elemento a parte e ativa a função de forma independente ao jogador. Para confirmar essa teoria, verificamos se a variável ''player'' realmente se refere ao jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A mensagem de debug nos diz que uma referência da variável ''player'' é realmente o jogador, mas outra é o veículo. Já que nós destinamos o evento especificamente ao boneco dele, adicionaremos uma cláusula ''if'', obrigando o término da execução do código caso a variável '''não''' for o jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo está funcionando como o planejado, mas aquela mensagem de aviso mencionada acima ainda aparece. Isso porque quando tentamos destruir o timer depois que o jogador saí do colshape, ele não existe mais, já que os 10 segundos se passaram. Em outras palavras, o timer é automaticamente destruído quando ele conta os 10 segundos. Há diversas formas de se livrar do aviso, uma vez que temos conhecimento da não existência do ''timer''. Uma delas seria verificar se ele existe na tabela. Para fazer isto, usamos a função [[isTimer]] na hora de destruí-lo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Então o código completo ficará assim:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
		killTimer(colshapeTimer[player])&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verificando problemas na performance==&lt;br /&gt;
Se o seu servidor estiver trabalhando muito além da conta ou você deseja se certificar que seus scripts são eficientes, é possível matar o problema pela raiz usando uma boa ferramenta inclusa na instalação: [[Resource:Performancebrowser|performancebrowser]]. É só inicia-lo usando ''''start performancebrowser''''. Caso ele não exista, pode encontrá-lo no último pacote de recursos hospedado no [http://code.google.com/p/mtasa-resources Google Code]. Esta ferramenta inclui uma série de informações relativas a performance, como:&lt;br /&gt;
* Memory leaks - uso excessivo de memória&lt;br /&gt;
* Element leaks - criação excessiva de elementos&lt;br /&gt;
* CPU usage - uso excessivo de CPU&lt;br /&gt;
&lt;br /&gt;
Para acessar o performancebrowser, é preciso ir até o navegador e digitar o endereço: &amp;lt;nowiki&amp;gt;http://&amp;lt;ip-do-servidor&amp;gt;:&amp;lt;porta&amp;gt;/performancebrowser/&amp;lt;/nowiki&amp;gt;. Um exemplo seria o endereço do servidor local: http://127.0.0.1:22005/performancebrowser/. Lembrando que é preciso:&lt;br /&gt;
* colocar a barra (/) no final do endereço&lt;br /&gt;
* logar no jogo com uma conta de administrador ou outra que tenha acesso no ACL a:&lt;br /&gt;
:* '''resource.performancebrowser.http''' e '''resource.ajax.http'''&lt;br /&gt;
&lt;br /&gt;
{{Dica|A maioria das informações relevantes estão nas categorias ''Lua timing'' e ''Lua memory''. E, o problema está nos valores mais altos apresentados.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exemplos de scripts problemáticos===&lt;br /&gt;
&lt;br /&gt;
Um deles seria adicionar dados a alguma tabela, mas não remover posteriormente. Porém, isso levaria alguns meses ou até anos para danificar o funcionamento do servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local someData = {}&lt;br /&gt;
&lt;br /&gt;
function storeData()&lt;br /&gt;
	someData[source] = true&lt;br /&gt;
	-- não há nenhum evento para retirar os dados quando o jogador sair. Isso é considerado memory leak&lt;br /&gt;
	-- Entrando na aba Lua timing, você pode verificar o uso de RAM de cada recurso.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, storeData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Um caso possível de ''Element leak'' é criar colisores temporários e nunca destruí-los mais tarde. Isso aumenta muito o uso de transferência dados (bandwidth), CPU e memória pelo servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function useTemporaryCol()&lt;br /&gt;
	local col = createColCircle(some code here)&lt;br /&gt;
	if (algo que deveria acontecer...) then&lt;br /&gt;
		destroyElement(col)&lt;br /&gt;
	end&lt;br /&gt;
	-- E as vezes não acontece, fazendo o colisor permanecer no mapa pra sempre...&lt;br /&gt;
	-- Criando de centenas à milhares de coliores sem função alguma.&lt;br /&gt;
	-- Na aba Lua timing é possível ver quantos elementos cada script criou.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O alto uso de CPU resulta na queda de FPS, fazendo o servidor um lugar ruim para se jogar. Em 24 horas, isso pode causar sérios prejuízos. O número de elementos criados detectados na aba ''Lua timing'' não ajudará neste caso, mas o ''Lua memory'' sim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, function()&lt;br /&gt;
	-- [Código para o novo jogador]&lt;br /&gt;
	-- Até que um evento é adicionado para quando ele sair&lt;br /&gt;
	addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, function()&lt;br /&gt;
	-- Encontrou o problema? Esse evento além de usar o root como o seu causador, é criado infinitamente...&lt;br /&gt;
    end)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Uma função usa muito o CPU quando ela demora para terminar de ser executada. O exemplo abaixo é uma delas. Sem o performancebrowser, você não perceberia tão cedo que esta é a causa do problema. Mas com ele, verá na aba ''Lua timing'' que o seu recurso usa muito o potencial do CPU. Ficará mais fácil descobrir isso se usar o parâmetro ''''d'''' na caixa de entrada ''Options''. Isso porque ela lhe dirá também a linha em que está o código problemático.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function umaFuncaoPoucoEficaz()&lt;br /&gt;
	-- para cada cem mil coisas quaisquer&lt;br /&gt;
	for i=1, 100000 do&lt;br /&gt;
		-- [código abaixo]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[en:Debugging]]&lt;br /&gt;
[[it:Guida al Debug]]&lt;br /&gt;
[[ru:Debugging]]&lt;br /&gt;
[[Category:Conceitos de Scripting]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Depura%C3%A7%C3%A3o&amp;diff=44396</id>
		<title>PT-BR/Depuração</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Depura%C3%A7%C3%A3o&amp;diff=44396"/>
		<updated>2015-02-08T22:07:38Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Depuração to Depuração&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Depuração]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=44395</id>
		<title>Depuração</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Depura%C3%A7%C3%A3o&amp;diff=44395"/>
		<updated>2015-02-08T22:07:37Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Depuração to Depuração&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Quando você estiver fazendo seu script, certos problemas surgirão. O problema é que nem todos são tão aparentes assim, então esta página irá descrever algumas estratégias básicas para localiza-los.&lt;br /&gt;
&lt;br /&gt;
==Debug no console==&lt;br /&gt;
O MTA vem com um sistema no console onde mensagens de ''debug'' relacionadas às funções e scripts são mostradas. Lembrando que é necessário ter uma permissão de administrador para ativá-lo (a não ser se você modificar o ACL). Para fazer isso, digite ''debugscript *x*'' no console, em que ''x'' é o nível:&lt;br /&gt;
&lt;br /&gt;
* '''1:''' mostra somente os erros&lt;br /&gt;
* '''2:''' erros e avisos&lt;br /&gt;
* '''3:''' erros, avisos e mensagens informativas&lt;br /&gt;
Ao digitar ''debugscript 3'', todas as ocorrências serão mostradas. O nível 3 ou o 2 são os recomendados para a maioria dos casos. É de extrema importância estar com o ''debugscript'' ligado para testar seu script e detectar os erros de digitação. Como também, resolver outros eventuais problemas.&lt;br /&gt;
&lt;br /&gt;
===Exemplo===&lt;br /&gt;
Neste código há dois erros:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;)&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando este script for carregado, no console irá aparecer algo assim:&lt;br /&gt;
:{{Debug info|Loading script failed: meuRecurso\script.lua:2: 'then' expected near ´outputChatbox'}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Isso significa que o script não pode ser executado porque há um erro de sintaxe. Nesta mensagem, primeiramente aparece qual script de qual recurso deu problema. Depois disso, há dois pontos e um número mostrando a linha onde está o erro; para facilitar o trabalho do programador quando se trata de scripts maiores. Depois disso, a mensagem irá variar de acordo com o tipo de erro. Neste caso, é fácil concluir que o erro está localizado no '''meuRecurso''' e na linha dois do arquivo '''script.lua'''. Desta vez está na cara: precisamos colocar o &amp;quot;then&amp;quot; na cláusula ''if''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Fedor&amp;quot;) then&lt;br /&gt;
        outputChatbox(&amp;quot;Hello Fedor&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo será carregado com sucesso e nenhum erro aparecerá até que um jogador apelidado &amp;quot;Cebola&amp;quot; dizer algo no chat. Aí no console irá aparecer:&lt;br /&gt;
:{{Debug error|myResource\script.lua:2: attempt to call global 'outputChatbox' (a nil value)}}&lt;br /&gt;
Isso significa que a função '''outputChatbox''' é um valor ''nil'', ou seja, ele não existe! Isso porque a função na verdade se chama [[outputChatBox]], e não [[outputChatbox]]. Então, tome cuidado com a letra maiúscula B.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function SayHello(message, player)&lt;br /&gt;
    if (getPlayerName(player) == &amp;quot;Cebola&amp;quot;) then&lt;br /&gt;
        outputChatBox(&amp;quot;Bem vindo, Cebola!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onChatMessage&amp;quot;, root, SayHello)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
É óbvio que isso é só um exemplo e não será sempre desse jeito, pois há vários tipos de erros em diversos casos. Mas até aqui, uma boa base já foi ensinada.&lt;br /&gt;
&lt;br /&gt;
==Log de debug do Cliente e Servidor==&lt;br /&gt;
====Servidor====&lt;br /&gt;
Na pasta ''../server/mods/deathmatch'', haverá dois arquivos com funções parecidas:&lt;br /&gt;
&lt;br /&gt;
*''local.conf'' - são as configurações oriundas do item &amp;quot;host game&amp;quot; no menu principal do MTA. Isto é uma maneira rápida de iniciar um servidor de testes dentro do próprio programa. Quando o usuário fecha o jogo, ele é automaticamente desligado também.&lt;br /&gt;
&lt;br /&gt;
*''mtaserver.conf'' - é usado quando se inicia o &amp;quot;MTA Server.exe&amp;quot; dentro da pasta ''../server/''. Em outras palavras, o servidor é rodado em prompt de comando e não necessita de o MTA estar executando junto. Isso é muito útil para os interessados em montar um servidor dedicado ou mesmo experimentar como é mexer em um servidor de verdade.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dependendo das suas necessidades, com certeza irá querer alterar essas configurações abaixo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;!-- Indica o nome e a localização do arquivo usado pelo debugscript. Se for deixado em branco, o servidor não o salvará. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Indica o nível de debugscript para este arquivo. Todos os níveis 0,1,2,3 estão disponíveis. Quando não especificado, zero é o padrão. --&amp;gt;&lt;br /&gt;
	&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Como as descrições acima já dizem, é opcional salvar um arquivo de log de acordo com o nível desejado. Os três níveis estão descritos acima, sendo neste caso o zero como a não ativação do debugscript - fazendo o arquivo ficar em branco. Se 3 for ativado, todos os erros encontrados no '''lado do servidor''' serão salvos em: ''../server/mods/deathmatch/logs/scripts.log''&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
Todos os erros '''do cliente''' serão salvos na pasta ''../server/clientscript.log''. Isso já é definido por padrão, então nenhuma configuração é necessária.&lt;br /&gt;
&lt;br /&gt;
==Habilidades em Deubug==&lt;br /&gt;
&lt;br /&gt;
Em vez de ficar procurando no código os erros cometidos, há algumas coisas a serem feitas para ajudar a encontrar-los. A maioria delas estão relacionadas com a adição de alguma mensagem de debug informando o que está ocorrendo no script.&lt;br /&gt;
&lt;br /&gt;
===Funções Úteis===&lt;br /&gt;
As funções abaixo podem lhe ajudar com o debug:&lt;br /&gt;
* [[outputDebugString]] ou [[outputChatBox]] para escrever qualquer informação na tela (de preferência outputDebugString para suporte técnico)&lt;br /&gt;
* [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()] para tornar qualquer variável em uma ''string''. Muito útil para saber o que ela é, escrevendo na tela. Não será necessário usa-la se a variável já uma string ou um número.&lt;br /&gt;
* [[getElementType]] verifica o tipo de elemento do MTA em questão.&lt;br /&gt;
* [[isElement]] verifica se elemento existe.&lt;br /&gt;
&lt;br /&gt;
===Adicionando mensagens de debug para verificar ''se'', ''quando'' ou por qual ''frequência'' um código é executado===&lt;br /&gt;
Se você terminou de escrever um código e percebe que algo esperado não acontece e fica em dúvida se as instruções foram executadas ou não; nesse caso é recomendado adicionar mensagens de debug para verificar os passos.&amp;lt;br&amp;gt;&lt;br /&gt;
Um exemplo típico seria checar se uma clausula ''if'' foi atendida ou não:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (variable1 == variable2) then&lt;br /&gt;
	outputDebugString(&amp;quot;A variável 1 é igual a 2.&amp;quot;)&lt;br /&gt;
	-- portanto, faça alguma coisa&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outra maneira semelhante seria verificar se alguma variável muda. Em outras palavras, é só adicionar uma mensagem de debug depois de cada vez que isso acontece.&lt;br /&gt;
&lt;br /&gt;
===Adicionando uma mensagem de debug para verificar o ''valor'' de uma variável===&lt;br /&gt;
Digamos que desejas criar um marcador (marker), mas ele não aparece na posição esperada. A primeira coisa a ser feita é verificar se a função [[createMarker]] foi executada com sucesso. Depois disso, só precisamos verificar os valores usados nela.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local marker = createMarker(x,y,z)&lt;br /&gt;
	if not marker then&lt;br /&gt;
		outputChatBox(&amp;quot;O marcador não pode ser criado.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
outputChatBox(&amp;quot;A posX é &amp;quot;..x..&amp;quot;, posY &amp;quot;..y..&amp;quot;, e posZ &amp;quot;..z)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Feito isso, as variáveis usadas como coordenadas serão mostradas. Lembrando que se uma variável não for uma frase ou número, é recomendado usar a função [http://www.lua.org/manual/5.1/manual.html#pdf-tostring tostring()], pois ela torna qualquer variável agrupável em uma ''string'', mesmo se for uma ''bool'' ou tabela.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Imagine que você criou um [[Colshape|detector de colisão]] e se o jogador ficar dez segundos dentro dele, algo vai acontecer:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, root, colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Quando o jogador entrar no colshape, o debugscript irá escrever a seguinte mensagem:&lt;br /&gt;
:{{Debug error|..[path]: attempt to index global 'colshapeTimer' (a nil value)}}&lt;br /&gt;
Isso significa que você tentou endereçar uma tabela não existente quando tentou colocar o timer dentro dela; ou seja, ela é um valor ''nil'' - portanto, não existe. Para corrigir isso, precisamos verificar se a tabela não existe, e caso a resposta for positiva; a criaremos.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;, root, colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,root,colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Desta vez receberemos um aviso quando o jogador entrar no colshape, esperar a mensagem e sair de lá:&lt;br /&gt;
&lt;br /&gt;
:{{Debug warning|[..]: Bad argument @ 'killTimer' Line: ..}}&lt;br /&gt;
&lt;br /&gt;
Tirando isso (vamos corrigir mais tarde!), tudo parece funcionar bem. O jogador entra no colshape e o ''timer'' começa a contar: se ele esperar, a mensagem é escrita, caso contrário o ''timer'' é destruído. Mas...&lt;br /&gt;
&lt;br /&gt;
===Um erro imperceptível===&lt;br /&gt;
Por alguma razão, quando o jogador entra no colshape usando um veículo, a mensagem é escrita duas vezes; como se o código tivesse sido executado duas vezes. Então, adicionamos uma mensagem de debug para verificar isso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;)&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave&amp;quot;)&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora dá pra ter certeza que as funções são executadas duas vezes quando entramos com um veículo, mas só uma quando se está a pé. É possível que o veículo seja um elemento a parte e ativa a função de forma independente ao jogador. Para confirmar essa teoria, verificamos se a variável ''player'' realmente se refere ao jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A mensagem de debug nos diz que uma referência da variável ''player'' é realmente o jogador, mas outra é o veículo. Já que nós destinamos o evento especificamente ao boneco dele, adicionaremos uma cláusula ''if'', obrigando o término da execução do código caso a variável '''não''' for o jogador.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora tudo está funcionando como o planejado, mas aquela mensagem de aviso mencionada acima ainda aparece. Isso porque quando tentamos destruir o timer depois que o jogador saí do colshape, ele não existe mais, já que os 10 segundos se passaram. Em outras palavras, o timer é automaticamente destruído quando ele conta os 10 segundos. Há diversas formas de se livrar do aviso, uma vez que temos conhecimento da não existência do ''timer''. Uma delas seria verificar se ele existe na tabela. Para fazer isto, usamos a função [[isTimer]] na hora de destruí-lo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
	killTimer(colshapeTimer[player])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Então o código completo ficará assim:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function colShapeHit(player)&lt;br /&gt;
	if (colshapeTimer == nil) then&lt;br /&gt;
		colshapeTimer = {}&lt;br /&gt;
	end&lt;br /&gt;
	-- adicionamos um verificador&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos uma mensagem de debug, seguido do elemento &amp;quot;jogador&amp;quot;&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeHit&amp;quot;..getElementType(player))&lt;br /&gt;
	-- criamos um timer para escrever uma mensagem (pode também ativar uma função)&lt;br /&gt;
	-- e inserimos ele em uma tabela, usando o jogador como index&lt;br /&gt;
	colshapeTimer[player] = setTimer(outputChatBox,10000,1,&amp;quot;O jogador permaneceu dez segundos dentro do colshape!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeHit&amp;quot;,getRootElement(),colShapeHit)&lt;br /&gt;
&lt;br /&gt;
function colShapeLeave(player)&lt;br /&gt;
	-- adicionamos ele novamente&lt;br /&gt;
	if (getElementType(player) ~= &amp;quot;player&amp;quot;) then return end&lt;br /&gt;
	-- adicionamos outra mensagem de debug, incluindo o jogador&lt;br /&gt;
	outputDebugString(&amp;quot;colShapeLeave &amp;quot;..getElementType(player))&lt;br /&gt;
	-- destrua o timer quando o jogador sair do colshape&lt;br /&gt;
	if (isTimer(colshapeTimer[player])) then&lt;br /&gt;
		killTimer(colshapeTimer[player])&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onColShapeLeave&amp;quot;,getRootElement(),colShapeLeave)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Verificando problemas na performance==&lt;br /&gt;
Se o seu servidor estiver trabalhando muito além da conta ou você deseja se certificar que seus scripts são eficientes, é possível matar o problema pela raiz usando uma boa ferramenta inclusa na instalação: [[Resource:Performancebrowser|performancebrowser]]. É só inicia-lo usando ''''start performancebrowser''''. Caso ele não exista, pode encontrá-lo no último pacote de recursos hospedado no [http://code.google.com/p/mtasa-resources Google Code]. Esta ferramenta inclui uma série de informações relativas a performance, como:&lt;br /&gt;
* Memory leaks - uso excessivo de memória&lt;br /&gt;
* Element leaks - criação excessiva de elementos&lt;br /&gt;
* CPU usage - uso excessivo de CPU&lt;br /&gt;
&lt;br /&gt;
Para acessar o performancebrowser, é preciso ir até o navegador e digitar o endereço: &amp;lt;nowiki&amp;gt;http://&amp;lt;ip-do-servidor&amp;gt;:&amp;lt;porta&amp;gt;/performancebrowser/&amp;lt;/nowiki&amp;gt;. Um exemplo seria o endereço do servidor local: http://127.0.0.1:22005/performancebrowser/. Lembrando que é preciso:&lt;br /&gt;
* colocar a barra (/) no final do endereço&lt;br /&gt;
* logar no jogo com uma conta de administrador ou outra que tenha acesso no ACL a:&lt;br /&gt;
:* '''resource.performancebrowser.http''' e '''resource.ajax.http'''&lt;br /&gt;
&lt;br /&gt;
{{Dica|A maioria das informações relevantes estão nas categorias ''Lua timing'' e ''Lua memory''. E, o problema está nos valores mais altos apresentados.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exemplos de scripts problemáticos===&lt;br /&gt;
&lt;br /&gt;
Um deles seria adicionar dados a alguma tabela, mas não remover posteriormente. Porém, isso levaria alguns meses ou até anos para danificar o funcionamento do servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local someData = {}&lt;br /&gt;
&lt;br /&gt;
function storeData()&lt;br /&gt;
	someData[source] = true&lt;br /&gt;
	-- não há nenhum evento para retirar os dados quando o jogador sair. Isso é considerado memory leak&lt;br /&gt;
	-- Entrando na aba Lua timing, você pode verificar o uso de RAM de cada recurso.&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, storeData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Um caso possível de ''Element leak'' é criar colisores temporários e nunca destruí-los mais tarde. Isso aumenta muito o uso de transferência dados (bandwidth), CPU e memória pelo servidor.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function useTemporaryCol()&lt;br /&gt;
	local col = createColCircle(some code here)&lt;br /&gt;
	if (algo que deveria acontecer...) then&lt;br /&gt;
		destroyElement(col)&lt;br /&gt;
	end&lt;br /&gt;
	-- E as vezes não acontece, fazendo o colisor permanecer no mapa pra sempre...&lt;br /&gt;
	-- Criando de centenas à milhares de coliores sem função alguma.&lt;br /&gt;
	-- Na aba Lua timing é possível ver quantos elementos cada script criou.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O alto uso de CPU resulta na queda de FPS, fazendo o servidor um lugar ruim para se jogar. Em 24 horas, isso pode causar sérios prejuízos. O número de elementos criados detectados na aba ''Lua timing'' não ajudará neste caso, mas o ''Lua memory'' sim.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, function()&lt;br /&gt;
	-- [Código para o novo jogador]&lt;br /&gt;
	-- Até que um evento é adicionado para quando ele sair&lt;br /&gt;
	addEventHandler(&amp;quot;onPlayerQuit&amp;quot;, root, function()&lt;br /&gt;
	-- Encontrou o problema? Esse evento além de usar o root como o seu causador, é criado infinitamente...&lt;br /&gt;
    end)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Uma função usa muito o CPU quando ela demora para terminar de ser executada. O exemplo abaixo é uma delas. Sem o performancebrowser, você não perceberia tão cedo que esta é a causa do problema. Mas com ele, verá na aba ''Lua timing'' que o seu recurso usa muito o potencial do CPU. Ficará mais fácil descobrir isso se usar o parâmetro ''''d'''' na caixa de entrada ''Options''. Isso porque ela lhe dirá também a linha em que está o código problemático.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function umaFuncaoPoucoEficaz()&lt;br /&gt;
	-- para cada cem mil coisas quaisquer&lt;br /&gt;
	for i=1, 100000 do&lt;br /&gt;
		-- [código abaixo]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[en:Debugging]]&lt;br /&gt;
[[it:Guida al Debug]]&lt;br /&gt;
[[ru:Debugging]]&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Lista_de_Controle_de_Acesso&amp;diff=44394</id>
		<title>Lista de Controle de Acesso</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Lista_de_Controle_de_Acesso&amp;diff=44394"/>
		<updated>2015-02-08T22:07:15Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O MTA possui uma lista de controle de acesso chamada ACL (Access Control List ou Lista de Controle de Acesso). Ele permite proteger e limitar o acesso ao servidor, a suas funções e recursos da forma desejada.&lt;br /&gt;
&lt;br /&gt;
Um conceito chave do ACL é que você dá a um determinado objeto um conjunto de direitos. No MTA, os objetos são ora recursos, ora usuários. Existem inúmeros direitos disponíveis, e eles principalmente se referem às funções do lado do servidor (server-side, em Inglês).&lt;br /&gt;
&lt;br /&gt;
Em outras palavras, o ACL permite que você escolha exatamente o que é permitido - o que um recurso ou usuário pode fazer. Essa funcionalidade dentro do jogo é essencial, porque por exemplo, ele impede os jogadores comuns do seu servidor serem capazes de banir outros jogadores, ou previne novos recursos não testados de fazerem o mesmo.&lt;br /&gt;
&lt;br /&gt;
É claro, qualquer grande poder precisa de grandes responsabilidades, ou seja, é facílimo romper completamente os recursos. Por exemplo, desativar a função [[spawnPlayer]] para todos eles seria uma coisa ruim. Porém, há certas situações em que será necessário fazer isso, mesmo sendo uma medida bem rígida.&lt;br /&gt;
&lt;br /&gt;
==Anatomia do ACL==&lt;br /&gt;
Há em dois componentes principais no arquivo: os grupos e as listas. Eles aparecem como tags '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' e '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;'''. Suas finalidades são: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1.''' Conceder permissão a usuários para controlar o servidor e usar comandos oferecidos pelos recursos. &lt;br /&gt;
Exemplos:&lt;br /&gt;
* Permitir administradores a usem apenas a função ''giveweapon'' do ''Freeroam''.&lt;br /&gt;
* Permitir todos os usuários iniciem recursos.&lt;br /&gt;
&lt;br /&gt;
'''2.''' Conceder permissão a recursos para usar funções de script e de outros recursos. &lt;br /&gt;
Exemplos:&lt;br /&gt;
* Permitir um recurso utilizar a função ''restartResource''.&lt;br /&gt;
* Permitir um recurso utilizar funções exportadas por um script a partir do [[call]].&lt;br /&gt;
&lt;br /&gt;
===Grupos Padrões===&lt;br /&gt;
MTA fornece alguns grupos padrões com permissões em ordem decrescente (mais restrito). Estes grupos são os seguintes:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - Este controla as permissões de pessoas que estão usando o console do servidor através do objeto: '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Especificamente concede acesso à função [[callRemote]] e o desativa a demais recursos. Dê uma olhada em sua página para saber mais.&lt;br /&gt;
&amp;lt;br&amp;gt;Para explicar melhor, será usado o grupo Everyone como exemplo. Se você não tiver modificado o arquivo ainda, ele é idêntico a isso:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Você primeiro deve identificar o conjunto ACL (o nome) dentro do grupo. Essa tag define quais são poderes do grupo. Quaisquer usuários e recursos neste grupo herdarão as permissões estabelecidos neste conjunto com o nome de &amp;quot;Default&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
''Obs'': É bom destacar que esse grupo é especial, pois inclui todos os usuários e recursos por meio de um'' '''asterisco (*)''' ''; ou seja, os nomes de todos serão automaticamente preenchidos pelo computador na hora da leitura''&lt;br /&gt;
&lt;br /&gt;
Agora, desça um pouco o ACL e você verá a entrada '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;'''. Note que eu omiti ''drasticamente'' esta lista devido a sua extensão.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Function''' - cada ''tag'' dele representa uma função do MTA. Por exemplo, se um recurso precisa usar a função ''restartResource'' e ele estiver no grupo &amp;quot;Everyone&amp;quot;, será negado o acesso e ele não funcionará corretamente.&lt;br /&gt;
* '''Command''' - cada um se refere a um comando criado com [[addCommandHandler]]. Um exemplo de comando seria digitar &amp;quot;/createvehicle [ID]&amp;quot; no chat para o recurso Freeroam criar um veículo. Em outras palavras, esse elemento controla se os usuários do grupo ACL podem ou não usar o comando. ''Os comandos não fazem nenhum efeito sobre os recursos incluídos no grupo, ou seja, os comandos só servem para usuários.''&lt;br /&gt;
**''General, é um direito personalizado criado pelo recurso &amp;quot;admin&amp;quot;, mas ele funciona com os mesmos princípios. O script trabalha com eles através da função ''[[hasObjectPermissionTo]].&lt;br /&gt;
&lt;br /&gt;
É possível notar alguns grupos, tais como admin, possuem múltiplas ''tags'' do tipo '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' definidas nele. Um exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Ransom&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O que acontece aqui é: a cada tag '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' apresentada, todas suas permissões serão concedidas a esse grupo. Por exemplo, o recurso ''admin'' se certifica que ganhou todas as permissões de administrador ao usar todos os conjuntos. Caso houver conflito, é dada prioridade ao seguinte. Partindo do exemplo acima, é apresentado o esquema a seguir:&lt;br /&gt;
&lt;br /&gt;
'''1.''' O conjunto '''&amp;lt;acl name=&amp;quot;Moderator&amp;quot;&amp;gt;''' define a permissão &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; como negada&amp;lt;br&amp;gt; &lt;br /&gt;
'''2.''' O conjunto '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' define a permissão &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; como permitida&amp;lt;br&amp;gt; &lt;br /&gt;
'''3.''' Portanto, para todos os usuários e recursos do grupo &amp;quot;admin&amp;quot;, a permissão será: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot;/&amp;gt; permitida&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Grupos e Recursos ACL===&lt;br /&gt;
É possível notar que alguns outros grupos vieram no arquivo. Eles são identificados como recursos já inclusos na instalação. Se um recurso deseja designar direitos específicos não previstas pelos grupos padrões do MTA, ele pode criar o seu próprio grupo e conjunto ACL, e usá-lo eventualmente. Por exemplo, o recurso AMX foi projetado para emular scripts do SA-MP e ele precisa de um certo conjunto de permissões que não se enquadram nos grupos existentes. Então ele criou seus próprios conjuntos no arquivo, como mostra a seguir:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Modificando o ACL==&lt;br /&gt;
Há três maneiras de alterar o ACL, como você irá fazer isso depende de onde partirá a alteração:&lt;br /&gt;
&lt;br /&gt;
===Interface HTTP===&lt;br /&gt;
Você pode usar a interface HTTP oferecida pelo [[Resource/webadmin|webadmin]] para modificar o ACL no seu navegador. Esta é a maneira mais fácil de modifica-lo. Apenas certifique-se de que o servidor está executando os recursos de webadmin e visite ''&amp;lt;nowiki&amp;gt;http://&amp;lt;IP-do-servidor&amp;gt;:&amp;lt;porta&amp;gt;/&amp;lt;/nowiki&amp;gt;''. Em seguida, será possível acessar duas seções: &lt;br /&gt;
* ACLs -  permite que você crie suas lista de controle de acesso&lt;br /&gt;
* Groups - permite criar grupos de usuários e atribuir-lhes a um conjunto ACL&lt;br /&gt;
&lt;br /&gt;
Por exemplo, a seção ACLs permite que dê a um grupo de administradores existente o acesso ao comando ''start'' do console. Em seguida, você pode ir até a seção &amp;quot;Groups&amp;quot; e criar um novo grupo de administração, tendo acesso a esse mesmo conjunto ACL referido na seção ACLs. Finalmente, você pode adicionar novos usuários e esse grupo criado.&lt;br /&gt;
&lt;br /&gt;
===Arquivo XML===&lt;br /&gt;
Você pode modificar o arquivo ACL.xml manualmente. Ele tem uma sintaxe bastante simples, mas pode ficar um pouco confuso às vezes. Se você editá-lo quando o servidor estiver em execução, não se esqueça de chamar a função de script [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;), para a nova ACL carregar as alterações. Desta maneira, serão evitadas substituições acidentais no servidor.&lt;br /&gt;
&lt;br /&gt;
===Funções de Scripting===&lt;br /&gt;
Você pode usar um certo número de funções de script para modificar a ACL. Claro, você pode (e certamente deve!), limitar o acesso à funções ACL através do próprio ACL.xml. Note-se que o '''recurso admin''', incluso na instalaçao do MTA, pode ser usado para gerenciar a ACL na aba &amp;quot;resources&amp;quot;. Você deve estar logado como administrador para usar o painel de administração. [http://wiki.multitheftauto.com/wiki/Admin Clique aqui para mais informações] de como se fazer isto.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
[[Category:Conceitos de Scripting]]&lt;br /&gt;
[[en:Access Control List]]&lt;br /&gt;
[[ru:Access Control List]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/ACL&amp;diff=44393</id>
		<title>PT-BR/ACL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/ACL&amp;diff=44393"/>
		<updated>2015-02-08T22:06:50Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/ACL to Lista de Controle de Acesso&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Lista de Controle de Acesso]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Lista_de_Controle_de_Acesso&amp;diff=44392</id>
		<title>Lista de Controle de Acesso</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Lista_de_Controle_de_Acesso&amp;diff=44392"/>
		<updated>2015-02-08T22:06:50Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/ACL to Lista de Controle de Acesso&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O MTA possui uma lista de controle de acesso chamada ACL (Access Control List ou Lista de Controle de Acesso). Ele permite proteger e limitar o acesso ao servidor, a suas funções e recursos da forma desejada.&lt;br /&gt;
&lt;br /&gt;
Um conceito chave do ACL é que você dá a um determinado objeto um conjunto de direitos. No MTA, os objetos são ora recursos, ora usuários. Existem inúmeros direitos disponíveis, e eles principalmente se referem às funções do lado do servidor (server-side, em Inglês).&lt;br /&gt;
&lt;br /&gt;
Em outras palavras, o ACL permite que você escolha exatamente o que é permitido - o que um recurso ou usuário pode fazer. Essa funcionalidade dentro do jogo é essencial, porque por exemplo, ele impede os jogadores comuns do seu servidor serem capazes de banir outros jogadores, ou previne novos recursos não testados de fazerem o mesmo.&lt;br /&gt;
&lt;br /&gt;
É claro, qualquer grande poder precisa de grandes responsabilidades, ou seja, é facílimo romper completamente os recursos. Por exemplo, desativar a função [[spawnPlayer]] para todos eles seria uma coisa ruim. Porém, há certas situações em que será necessário fazer isso, mesmo sendo uma medida bem rígida.&lt;br /&gt;
&lt;br /&gt;
==Anatomia do ACL==&lt;br /&gt;
Há em dois componentes principais no arquivo: os grupos e as listas. Eles aparecem como tags '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' e '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;'''. Suas finalidades são: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1.''' Conceder permissão a usuários para controlar o servidor e usar comandos oferecidos pelos recursos. &lt;br /&gt;
Exemplos:&lt;br /&gt;
* Permitir administradores a usem apenas a função ''giveweapon'' do ''Freeroam''.&lt;br /&gt;
* Permitir todos os usuários iniciem recursos.&lt;br /&gt;
&lt;br /&gt;
'''2.''' Conceder permissão a recursos para usar funções de script e de outros recursos. &lt;br /&gt;
Exemplos:&lt;br /&gt;
* Permitir um recurso utilizar a função ''restartResource''.&lt;br /&gt;
* Permitir um recurso utilizar funções exportadas por um script a partir do [[call]].&lt;br /&gt;
&lt;br /&gt;
===Grupos Padrões===&lt;br /&gt;
MTA fornece alguns grupos padrões com permissões em ordem decrescente (mais restrito). Estes grupos são os seguintes:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - Este controla as permissões de pessoas que estão usando o console do servidor através do objeto: '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Especificamente concede acesso à função [[callRemote]] e o desativa a demais recursos. Dê uma olhada em sua página para saber mais.&lt;br /&gt;
&amp;lt;br&amp;gt;Para explicar melhor, será usado o grupo Everyone como exemplo. Se você não tiver modificado o arquivo ainda, ele é idêntico a isso:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Você primeiro deve identificar o conjunto ACL (o nome) dentro do grupo. Essa tag define quais são poderes do grupo. Quaisquer usuários e recursos neste grupo herdarão as permissões estabelecidos neste conjunto com o nome de &amp;quot;Default&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
''Obs'': É bom destacar que esse grupo é especial, pois inclui todos os usuários e recursos por meio de um'' '''asterisco (*)''' ''; ou seja, os nomes de todos serão automaticamente preenchidos pelo computador na hora da leitura''&lt;br /&gt;
&lt;br /&gt;
Agora, desça um pouco o ACL e você verá a entrada '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;'''. Note que eu omiti ''drasticamente'' esta lista devido a sua extensão.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Function''' - cada ''tag'' dele representa uma função do MTA. Por exemplo, se um recurso precisa usar a função ''restartResource'' e ele estiver no grupo &amp;quot;Everyone&amp;quot;, será negado o acesso e ele não funcionará corretamente.&lt;br /&gt;
* '''Command''' - cada um se refere a um comando criado com [[addCommandHandler]]. Um exemplo de comando seria digitar &amp;quot;/createvehicle [ID]&amp;quot; no chat para o recurso Freeroam criar um veículo. Em outras palavras, esse elemento controla se os usuários do grupo ACL podem ou não usar o comando. ''Os comandos não fazem nenhum efeito sobre os recursos incluídos no grupo, ou seja, os comandos só servem para usuários.''&lt;br /&gt;
**''General, é um direito personalizado criado pelo recurso &amp;quot;admin&amp;quot;, mas ele funciona com os mesmos princípios. O script trabalha com eles através da função ''[[hasObjectPermissionTo]].&lt;br /&gt;
&lt;br /&gt;
É possível notar alguns grupos, tais como admin, possuem múltiplas ''tags'' do tipo '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' definidas nele. Um exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Ransom&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O que acontece aqui é: a cada tag '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' apresentada, todas suas permissões serão concedidas a esse grupo. Por exemplo, o recurso ''admin'' se certifica que ganhou todas as permissões de administrador ao usar todos os conjuntos. Caso houver conflito, é dada prioridade ao seguinte. Partindo do exemplo acima, é apresentado o esquema a seguir:&lt;br /&gt;
&lt;br /&gt;
'''1.''' O conjunto '''&amp;lt;acl name=&amp;quot;Moderator&amp;quot;&amp;gt;''' define a permissão &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; como negada&amp;lt;br&amp;gt; &lt;br /&gt;
'''2.''' O conjunto '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' define a permissão &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; como permitida&amp;lt;br&amp;gt; &lt;br /&gt;
'''3.''' Portanto, para todos os usuários e recursos do grupo &amp;quot;admin&amp;quot;, a permissão será: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot;/&amp;gt; permitida&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Grupos e Recursos ACL===&lt;br /&gt;
É possível notar que alguns outros grupos vieram no arquivo. Eles são identificados como recursos já inclusos na instalação. Se um recurso deseja designar direitos específicos não previstas pelos grupos padrões do MTA, ele pode criar o seu próprio grupo e conjunto ACL, e usá-lo eventualmente. Por exemplo, o recurso AMX foi projetado para emular scripts do SA-MP e ele precisa de um certo conjunto de permissões que não se enquadram nos grupos existentes. Então ele criou seus próprios conjuntos no arquivo, como mostra a seguir:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Modificando o ACL==&lt;br /&gt;
Há três maneiras de alterar o ACL, como você irá fazer isso depende de onde partirá a alteração:&lt;br /&gt;
&lt;br /&gt;
===Interface HTTP===&lt;br /&gt;
Você pode usar a interface HTTP oferecida pelo [[Resource/webadmin|webadmin]] para modificar o ACL no seu navegador. Esta é a maneira mais fácil de modifica-lo. Apenas certifique-se de que o servidor está executando os recursos de webadmin e visite ''&amp;lt;nowiki&amp;gt;http://&amp;lt;IP-do-servidor&amp;gt;:&amp;lt;porta&amp;gt;/&amp;lt;/nowiki&amp;gt;''. Em seguida, será possível acessar duas seções: &lt;br /&gt;
* ACLs -  permite que você crie suas lista de controle de acesso&lt;br /&gt;
* Groups - permite criar grupos de usuários e atribuir-lhes a um conjunto ACL&lt;br /&gt;
&lt;br /&gt;
Por exemplo, a seção ACLs permite que dê a um grupo de administradores existente o acesso ao comando ''start'' do console. Em seguida, você pode ir até a seção &amp;quot;Groups&amp;quot; e criar um novo grupo de administração, tendo acesso a esse mesmo conjunto ACL referido na seção ACLs. Finalmente, você pode adicionar novos usuários e esse grupo criado.&lt;br /&gt;
&lt;br /&gt;
===Arquivo XML===&lt;br /&gt;
Você pode modificar o arquivo ACL.xml manualmente. Ele tem uma sintaxe bastante simples, mas pode ficar um pouco confuso às vezes. Se você editá-lo quando o servidor estiver em execução, não se esqueça de chamar a função de script [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;), para a nova ACL carregar as alterações. Desta maneira, serão evitadas substituições acidentais no servidor.&lt;br /&gt;
&lt;br /&gt;
===Funções de Scripting===&lt;br /&gt;
Você pode usar um certo número de funções de script para modificar a ACL. Claro, você pode (e certamente deve!), limitar o acesso à funções ACL através do próprio ACL.xml. Note-se que o '''recurso admin''', incluso na instalaçao do MTA, pode ser usado para gerenciar a ACL na aba &amp;quot;resources&amp;quot;. Você deve estar logado como administrador para usar o painel de administração. [http://wiki.multitheftauto.com/wiki/Admin Clique aqui para mais informações] de como se fazer isto.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
[[en:Access Control List]]&lt;br /&gt;
[[ru:Access Control List]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Acesso_web_via_recursos&amp;diff=44391</id>
		<title>Acesso web via recursos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Acesso_web_via_recursos&amp;diff=44391"/>
		<updated>2015-02-08T22:04:01Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O Multi Theft Auto disponibiliza uma interface web a ser usada pelos recursos de diferentes formas. A proposta deste artigo é descrever-las e explicar sua utilização.&lt;br /&gt;
&lt;br /&gt;
==Introdução==&lt;br /&gt;
Há dois componentes chaves desse ecossistema. O primeiro é um servidor web comum, o qual permite os navegadores demandarem páginas e arquivos presentes no recurso. O segundo é um componente que gerencia chamadas realizadas pelos navegadores à funções exportadas de seu recurso.&lt;br /&gt;
&lt;br /&gt;
==Páginas==&lt;br /&gt;
===Especificando componentes no arquivo meta===&lt;br /&gt;
É possível definir certos arquivos acessíveis via servidor web em seu recurso. Para fazer isso é só adicionar:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;nome-do-arquivo.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Você pode acessar esse arquivo ao digitar o link: &amp;lt;nowiki&amp;gt;http://host:port/nome-do-recurso/nome-do-arquivo.ext&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Um exemplo seria um servidor local usando a porta http padrão e com o ''webmap'' iniciado: http://127.0.0.1:22005/webmap/map.htm&lt;br /&gt;
&lt;br /&gt;
===Arquivos binários===&lt;br /&gt;
Tirando a possibilidade de você errar o nome, os arquivos usando a ''tag'' html podem ser de qualquer tipo. Se eles forem binários (como imagens, .zip), será necessário especificar isso na ''tag'' usando ''raw=true''. Isso significa que ele não será pre-processado antes de serem enviado ao servidor web.  &lt;br /&gt;
&lt;br /&gt;
Um exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;image.gif&amp;quot; raw=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arquivos Processados===&lt;br /&gt;
Se um arquivo não for binário, então terá de ser pré-processado antes de ser retornado ao cliente. Esse processamento funciona de um jeito muito parecido com PHP ou ASP, mas usa o método do LUA. Você pode inserir scripts do MTA em uma página HTML, controlando sua saída. Quase todas as funções funcionam, incluindo determinadas [[Template:HTTP functions|Funções HTTP]], como [[httpWrite]]; o qual escreve um texto no buffer.&lt;br /&gt;
&lt;br /&gt;
Por exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        Esse recurso é chamado de &amp;lt;* httpWrite( getResourceName(getThisResource()) ) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Há também uma maneira mais simples (muito utilizada no PHP e ASP) de se escrever o código acima:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        Esse recurso é chamado de &amp;lt;* = getResourceName(getThisResource()) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Junto com as funções HTTP, o Lua trabalha com variáveis específicas que contém informações sobre a página demandada:&lt;br /&gt;
* table '''requestHeaders''': É uma tabela contendo todas as ''headers'' requisitadas junto com a página. Você pode definir quais serão retornadas com [[httpSetResponseHeader]].&lt;br /&gt;
* table '''form''': Essa tabela abriga todos os dados enviados à página usando ''HTTP POST'' seguidos de quaisquer variáveis enviadas à ''querystring'' usando HTTP GET.&lt;br /&gt;
* table '''cookies''': Essa contém todos os cookies. É possível altera-los usando [[httpSetResponseCookie]].&lt;br /&gt;
* string '''hostname''': É uma ''string'' contendo o endereço de IP ou o nome do host da página requisitada.&lt;br /&gt;
* string '''url''': É a URL da página.&lt;br /&gt;
* account '''user''': Retorna a conta do usuário atual.&lt;br /&gt;
&lt;br /&gt;
É importante lembrar que os arquivos estão em uma máquina virtual separada do resto do seu recurso. Como também, se desejar chamar alguma função presente no script dele, ela terá de ser exportada, e mais tarde, usando-a chamando o [[call]] na página criada.&lt;br /&gt;
&lt;br /&gt;
==Calls==&lt;br /&gt;
É possível definir certas funções a serem chamadas via HTTP. Todos os SDKs (listados abaixo) lhe permitem fazer isso remotamente.&lt;br /&gt;
&lt;br /&gt;
Para fazer isto, é só adicionar a linha abaixo em seu meta.xml:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;export function='functionName' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A sua função pode ser escrita normalmente e retornar quantas variáveis for preciso; incluindo tabelas, recursos, e o mais importante: elementos. Em contrapartida, ''não'' é possível retornar qualquer variável do tipo ''userdata'', como ''[[xmlnode|xmlnodes]]'' ou funções.&lt;br /&gt;
&lt;br /&gt;
==Protocolos==&lt;br /&gt;
{{Dica|Não é preciso aprender isso, a não ser que você esteja escrevendo seu próprio código de ''HTTP request''. Se desejar, use uma das [[#SDK|SDKs listadas abaixo]].}}&lt;br /&gt;
&lt;br /&gt;
Chamadas são feitas ao se utilizar ''&amp;lt;nowiki&amp;gt;http://&amp;lt;IP&amp;gt;:&amp;lt;porta&amp;gt;/&amp;lt;recurso&amp;gt;/call/&amp;lt;função-exportada&amp;gt;&amp;lt;/nowiki&amp;gt;' usando ''HTTP POST''. O corpo do comando pode ser uma ''array'' JSON contendo argumentos a serem enviados à função.&lt;br /&gt;
&lt;br /&gt;
A resposta HTTP também será uma ''array'' JSON contendo valor(es) retornados pela função.&lt;br /&gt;
&lt;br /&gt;
O servidor suporta autenticação HTTP básica e você poderá configurar-la via ACL e pelo sistema padrão de contas.&lt;br /&gt;
&lt;br /&gt;
===Chamadas via interface web HTTP===&lt;br /&gt;
Chamadas são praticamente a coisa mais fácil a ser feita pela interface web.&lt;br /&gt;
&lt;br /&gt;
Primeiro, adicione esta linha no meta:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Segundo, adicione o código a seguir dentro de &amp;lt;head&amp;gt; na página da qual deseja chamar a função:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
E a partir de agora, é só digitar um bloco em javascript e chamar as funções quase como se fossem locais. A única diferença é que as chamadas são assíncronas. Não se esqueça de especificar uma função a qual receberá o retorno HTTP no último argumento.&lt;br /&gt;
&lt;br /&gt;
Aí vai um exemplo:&lt;br /&gt;
&lt;br /&gt;
'''meta.xml'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;script src='code.lua' /&amp;gt;&lt;br /&gt;
   &amp;lt;html src='page.htm' default='true' /&amp;gt;&lt;br /&gt;
   &amp;lt;export function='showChatMessage' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''code.lua'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showChatMessage ( message )&lt;br /&gt;
    outputChatBox ( message )&lt;br /&gt;
    return 5;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''page.htm'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
        &amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;
            function say() {&lt;br /&gt;
                var message = document.getElementById('message')&lt;br /&gt;
                showChatMessage ( message.value, &lt;br /&gt;
                    function ( number ) {&lt;br /&gt;
                        // the function has been called and returned something&lt;br /&gt;
                        message.value = &amp;quot;The function returned &amp;quot; + number;&lt;br /&gt;
                    }&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;input type='text' id='message' /&amp;gt;&amp;lt;input type='button' value='say' onclick='say();' /&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
É possível ver alguns exemplos um pouco complexos de como se utiliza esse método nos recursos''resourcebrowser'', ''resourcemanager'' e ''webadmin''.&lt;br /&gt;
&lt;br /&gt;
==Garantindo segurança na interface web==&lt;br /&gt;
O [[PT-BR/ACL|ACL]] contém um certo número de permissões que podem afetar a maneira como os arquivos são acessados.&lt;br /&gt;
{{Componente_ultrapassado|3.0139|1.3.1|&lt;br /&gt;
* general.http: Se for desativada, nenhum dos arquivos http poderão ser acessados (excluindo os do cliente)&lt;br /&gt;
** '''É importante lembrar''': ''Se essa for ativada, todos os recursos (definidos nesse ACL) ganharão acesso automaticamente. Para desabilitar isso em recursos com funções exportadas, é preciso explicitar o bloqueio.''&lt;br /&gt;
** '''É importante lembrar''': ''Se for ativada em um ACL contendo um usuário sem senha (ex: user.*, user.guest ou user.http_guest), é recomendado bloquear o acesso à recursos que contém funções exportadas ao HTTP.''&lt;br /&gt;
* resource.'''Nome-do-recurso''': Se for desabilitada, nenhum dos arquivos do recurso poderão ser acessados&lt;br /&gt;
* resource.'''Nome-do-recurso'''.file.'''Nome-do-arquivo''': Se for desabilitada, este não poderá ser acessado&lt;br /&gt;
* resource.'''Nome-do-recurso'''.function.'''Nome-da-função''': Se for desabilitada, a função não poderá ser chamada&lt;br /&gt;
&lt;br /&gt;
Todos esses acima funciona com outras permissões do ACL; ou seja, é possível desabilita-los para usuários comuns ou só permitir acesso aos administradores. Ou até mesmo a outro grupo de usuários credenciados.&lt;br /&gt;
}}&lt;br /&gt;
{{Novo_componente|3.0139|1.3.1|&lt;br /&gt;
* '''resource.Nome-do-recurso.http''': Se for habilitada, o recurso será acessível a partir do endereço: http://ip_do_servidor:22005/Nome_do_recurso/&lt;br /&gt;
Isso funciona para outras permissões do ACL também, ou seja, é possível habilitar-la só a administradores ou um grupo específico.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==SDK==&lt;br /&gt;
Há alguns dos tão conhecidos SDKs disponíveis para interagir com o servidor a partir de outras linguagens de programação. Com isso, é possível (em teoria) escrever gamemodes completos. Na prática, é uma má ideia, porém útil para estatísticas e administração. O SDK de PHP é o mais desenvolvido. Sinta-se a vontade de modificar ou criar seu próprio SDK - não se esqueça de nos mandar uma cópia, por favor!&lt;br /&gt;
&lt;br /&gt;
* [[JavaSDK|Java SDK]]&lt;br /&gt;
* [[Javascript SDK]]&lt;br /&gt;
* [[Perl SDK]]&lt;br /&gt;
* [[PHP SDK]]&lt;br /&gt;
* [[CSharp SDK|C# SDK]]&lt;br /&gt;
&lt;br /&gt;
==Veja mais==&lt;br /&gt;
[[callRemote]] - Permite a chamada de funções em páginas PHP (com o SDK próprio) e incluise em outros servidores.&lt;br /&gt;
[[Category:Conceitos_de_Scripting]]&lt;br /&gt;
[[en:Resource Web Access]]&lt;br /&gt;
[[ru:Resource Web Access]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Acesso_web_via_recursos&amp;diff=44390</id>
		<title>PT-BR/Acesso web via recursos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Acesso_web_via_recursos&amp;diff=44390"/>
		<updated>2015-02-08T22:02:59Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Acesso web via recursos to Acesso web via recursos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Acesso web via recursos]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Acesso_web_via_recursos&amp;diff=44389</id>
		<title>Acesso web via recursos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Acesso_web_via_recursos&amp;diff=44389"/>
		<updated>2015-02-08T22:02:58Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Acesso web via recursos to Acesso web via recursos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;O Multi Theft Auto disponibiliza uma interface web a ser usada pelos recursos de diferentes formas. A proposta deste artigo é descrever-las e explicar sua utilização.&lt;br /&gt;
&lt;br /&gt;
==Introdução==&lt;br /&gt;
Há dois componentes chaves desse ecossistema. O primeiro é um servidor web comum, o qual permite os navegadores demandarem páginas e arquivos presentes no recurso. O segundo é um componente que gerencia chamadas realizadas pelos navegadores à funções exportadas de seu recurso.&lt;br /&gt;
&lt;br /&gt;
==Páginas==&lt;br /&gt;
===Especificando componentes no arquivo meta===&lt;br /&gt;
É possível definir certos arquivos acessíveis via servidor web em seu recurso. Para fazer isso é só adicionar:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;nome-do-arquivo.ext&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Você pode acessar esse arquivo ao digitar o link: &amp;lt;nowiki&amp;gt;http://host:port/nome-do-recurso/nome-do-arquivo.ext&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Um exemplo seria um servidor local usando a porta http padrão e com o ''webmap'' iniciado: http://127.0.0.1:22005/webmap/map.htm&lt;br /&gt;
&lt;br /&gt;
===Arquivos binários===&lt;br /&gt;
Tirando a possibilidade de você errar o nome, os arquivos usando a ''tag'' html podem ser de qualquer tipo. Se eles forem binários (como imagens, .zip), será necessário especificar isso na ''tag'' usando ''raw=true''. Isso significa que ele não será pre-processado antes de serem enviado ao servidor web.  &lt;br /&gt;
&lt;br /&gt;
Um exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html src=&amp;quot;image.gif&amp;quot; raw=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Arquivos Processados===&lt;br /&gt;
Se um arquivo não for binário, então terá de ser pré-processado antes de ser retornado ao cliente. Esse processamento funciona de um jeito muito parecido com PHP ou ASP, mas usa o método do LUA. Você pode inserir scripts do MTA em uma página HTML, controlando sua saída. Quase todas as funções funcionam, incluindo determinadas [[Template:HTTP functions|Funções HTTP]], como [[httpWrite]]; o qual escreve um texto no buffer.&lt;br /&gt;
&lt;br /&gt;
Por exemplo:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        Esse recurso é chamado de &amp;lt;* httpWrite( getResourceName(getThisResource()) ) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Há também uma maneira mais simples (muito utilizada no PHP e ASP) de se escrever o código acima:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        Esse recurso é chamado de &amp;lt;* = getResourceName(getThisResource()) *&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Junto com as funções HTTP, o Lua trabalha com variáveis específicas que contém informações sobre a página demandada:&lt;br /&gt;
* table '''requestHeaders''': É uma tabela contendo todas as ''headers'' requisitadas junto com a página. Você pode definir quais serão retornadas com [[httpSetResponseHeader]].&lt;br /&gt;
* table '''form''': Essa tabela abriga todos os dados enviados à página usando ''HTTP POST'' seguidos de quaisquer variáveis enviadas à ''querystring'' usando HTTP GET.&lt;br /&gt;
* table '''cookies''': Essa contém todos os cookies. É possível altera-los usando [[httpSetResponseCookie]].&lt;br /&gt;
* string '''hostname''': É uma ''string'' contendo o endereço de IP ou o nome do host da página requisitada.&lt;br /&gt;
* string '''url''': É a URL da página.&lt;br /&gt;
* account '''user''': Retorna a conta do usuário atual.&lt;br /&gt;
&lt;br /&gt;
É importante lembrar que os arquivos estão em uma máquina virtual separada do resto do seu recurso. Como também, se desejar chamar alguma função presente no script dele, ela terá de ser exportada, e mais tarde, usando-a chamando o [[call]] na página criada.&lt;br /&gt;
&lt;br /&gt;
==Calls==&lt;br /&gt;
É possível definir certas funções a serem chamadas via HTTP. Todos os SDKs (listados abaixo) lhe permitem fazer isso remotamente.&lt;br /&gt;
&lt;br /&gt;
Para fazer isto, é só adicionar a linha abaixo em seu meta.xml:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;export function='functionName' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A sua função pode ser escrita normalmente e retornar quantas variáveis for preciso; incluindo tabelas, recursos, e o mais importante: elementos. Em contrapartida, ''não'' é possível retornar qualquer variável do tipo ''userdata'', como ''[[xmlnode|xmlnodes]]'' ou funções.&lt;br /&gt;
&lt;br /&gt;
==Protocolos==&lt;br /&gt;
{{Dica|Não é preciso aprender isso, a não ser que você esteja escrevendo seu próprio código de ''HTTP request''. Se desejar, use uma das [[#SDK|SDKs listadas abaixo]].}}&lt;br /&gt;
&lt;br /&gt;
Chamadas são feitas ao se utilizar ''&amp;lt;nowiki&amp;gt;http://&amp;lt;IP&amp;gt;:&amp;lt;porta&amp;gt;/&amp;lt;recurso&amp;gt;/call/&amp;lt;função-exportada&amp;gt;&amp;lt;/nowiki&amp;gt;' usando ''HTTP POST''. O corpo do comando pode ser uma ''array'' JSON contendo argumentos a serem enviados à função.&lt;br /&gt;
&lt;br /&gt;
A resposta HTTP também será uma ''array'' JSON contendo valor(es) retornados pela função.&lt;br /&gt;
&lt;br /&gt;
O servidor suporta autenticação HTTP básica e você poderá configurar-la via ACL e pelo sistema padrão de contas.&lt;br /&gt;
&lt;br /&gt;
===Chamadas via interface web HTTP===&lt;br /&gt;
Chamadas são praticamente a coisa mais fácil a ser feita pela interface web.&lt;br /&gt;
&lt;br /&gt;
Primeiro, adicione esta linha no meta:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Segundo, adicione o código a seguir dentro de &amp;lt;head&amp;gt; na página da qual deseja chamar a função:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
E a partir de agora, é só digitar um bloco em javascript e chamar as funções quase como se fossem locais. A única diferença é que as chamadas são assíncronas. Não se esqueça de especificar uma função a qual receberá o retorno HTTP no último argumento.&lt;br /&gt;
&lt;br /&gt;
Aí vai um exemplo:&lt;br /&gt;
&lt;br /&gt;
'''meta.xml'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
   &amp;lt;include resource=&amp;quot;ajax&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;script src='code.lua' /&amp;gt;&lt;br /&gt;
   &amp;lt;html src='page.htm' default='true' /&amp;gt;&lt;br /&gt;
   &amp;lt;export function='showChatMessage' http='true' /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''code.lua'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showChatMessage ( message )&lt;br /&gt;
    outputChatBox ( message )&lt;br /&gt;
    return 5;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''page.htm'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;* = exports.ajax:start(getResourceName(getThisResource())) *&amp;gt;&lt;br /&gt;
        &amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;
            function say() {&lt;br /&gt;
                var message = document.getElementById('message')&lt;br /&gt;
                showChatMessage ( message.value, &lt;br /&gt;
                    function ( number ) {&lt;br /&gt;
                        // the function has been called and returned something&lt;br /&gt;
                        message.value = &amp;quot;The function returned &amp;quot; + number;&lt;br /&gt;
                    }&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
    &amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;input type='text' id='message' /&amp;gt;&amp;lt;input type='button' value='say' onclick='say();' /&amp;gt;&lt;br /&gt;
    &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
É possível ver alguns exemplos um pouco complexos de como se utiliza esse método nos recursos''resourcebrowser'', ''resourcemanager'' e ''webadmin''.&lt;br /&gt;
&lt;br /&gt;
==Garantindo segurança na interface web==&lt;br /&gt;
O [[PT-BR/ACL|ACL]] contém um certo número de permissões que podem afetar a maneira como os arquivos são acessados.&lt;br /&gt;
{{Componente_ultrapassado|3.0139|1.3.1|&lt;br /&gt;
* general.http: Se for desativada, nenhum dos arquivos http poderão ser acessados (excluindo os do cliente)&lt;br /&gt;
** '''É importante lembrar''': ''Se essa for ativada, todos os recursos (definidos nesse ACL) ganharão acesso automaticamente. Para desabilitar isso em recursos com funções exportadas, é preciso explicitar o bloqueio.''&lt;br /&gt;
** '''É importante lembrar''': ''Se for ativada em um ACL contendo um usuário sem senha (ex: user.*, user.guest ou user.http_guest), é recomendado bloquear o acesso à recursos que contém funções exportadas ao HTTP.''&lt;br /&gt;
* resource.'''Nome-do-recurso''': Se for desabilitada, nenhum dos arquivos do recurso poderão ser acessados&lt;br /&gt;
* resource.'''Nome-do-recurso'''.file.'''Nome-do-arquivo''': Se for desabilitada, este não poderá ser acessado&lt;br /&gt;
* resource.'''Nome-do-recurso'''.function.'''Nome-da-função''': Se for desabilitada, a função não poderá ser chamada&lt;br /&gt;
&lt;br /&gt;
Todos esses acima funciona com outras permissões do ACL; ou seja, é possível desabilita-los para usuários comuns ou só permitir acesso aos administradores. Ou até mesmo a outro grupo de usuários credenciados.&lt;br /&gt;
}}&lt;br /&gt;
{{Novo_componente|3.0139|1.3.1|&lt;br /&gt;
* '''resource.Nome-do-recurso.http''': Se for habilitada, o recurso será acessível a partir do endereço: http://ip_do_servidor:22005/Nome_do_recurso/&lt;br /&gt;
Isso funciona para outras permissões do ACL também, ou seja, é possível habilitar-la só a administradores ou um grupo específico.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==SDK==&lt;br /&gt;
Há alguns dos tão conhecidos SDKs disponíveis para interagir com o servidor a partir de outras linguagens de programação. Com isso, é possível (em teoria) escrever gamemodes completos. Na prática, é uma má ideia, porém útil para estatísticas e administração. O SDK de PHP é o mais desenvolvido. Sinta-se a vontade de modificar ou criar seu próprio SDK - não se esqueça de nos mandar uma cópia, por favor!&lt;br /&gt;
&lt;br /&gt;
* [[JavaSDK|Java SDK]]&lt;br /&gt;
* [[Javascript SDK]]&lt;br /&gt;
* [[Perl SDK]]&lt;br /&gt;
* [[PHP SDK]]&lt;br /&gt;
* [[CSharp SDK|C# SDK]]&lt;br /&gt;
&lt;br /&gt;
==Veja mais==&lt;br /&gt;
[[callRemote]] - Permite a chamada de funções em páginas PHP (com o SDK próprio) e incluise em outros servidores.&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
[[en:Resource Web Access]]&lt;br /&gt;
[[ru:Resource Web Access]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44388</id>
		<title>Cetegory:Conceitos de Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44388"/>
		<updated>2015-02-08T21:56:50Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta categoria reúne artigos sobre elementos fundamentais de scripting para o MTA.&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Category:Conceitos_de_Scripting&amp;diff=44387</id>
		<title>Category:Conceitos de Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Category:Conceitos_de_Scripting&amp;diff=44387"/>
		<updated>2015-02-08T21:56:26Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Created page with &amp;quot;Esta categoria reúne artigos sobre elementos fundamentais de scripting para o MTA.  Category:Translated/Scripting Concepts  de:Category:Skripting Konzepte en:Catego...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta categoria reúne artigos sobre elementos fundamentais de scripting para o MTA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[de:Category:Skripting Konzepte]]&lt;br /&gt;
[[en:Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Category:Понятия скриптинга]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44386</id>
		<title>Cetegory:Conceitos de Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44386"/>
		<updated>2015-02-08T21:53:10Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta categoria reúne artigos sobre elementos fundamentais de scripting para o MTA.&lt;br /&gt;
&lt;br /&gt;
[[Category:Translated/Scripting Concepts]]&lt;br /&gt;
&lt;br /&gt;
[[de:Category:Skripting Konzepte]]&lt;br /&gt;
[[en:Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Category:Понятия скриптинга]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44385</id>
		<title>Cetegory:Conceitos de Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Cetegory:Conceitos_de_Scripting&amp;diff=44385"/>
		<updated>2015-02-08T21:51:20Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Created PT-BR Scripting Concepts category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Esta categoria reúne artigos sobre elementos fundamentais de scripting para o MTA.&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=44384</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=44384"/>
		<updated>2015-02-08T21:37:34Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added a link to event definition on wiki.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a meta file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.&lt;br /&gt;
&lt;br /&gt;
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as maplimits to keep playings within a playing area or deathpickups to create weapon pickups.&lt;br /&gt;
{{tip|Your first step to begin Lua scripting should be using an Lua editor. This makes scripting much easier. We recommend [http://www.sublimetext.com/ Sublime Text], [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [http://luaedit.sourceforge.net/ LuaEdit]. There is also an unofficial [[MTASE|MTA Script Editor]] (in work-in-progress state) that you can test out.}}&lt;br /&gt;
&lt;br /&gt;
==Creating a working script==&lt;br /&gt;
We will first learn how to make a basic script that lets the player walk around in the city, step by step.&lt;br /&gt;
===Where are all the scripts?===&lt;br /&gt;
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:&lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a &amp;quot;resource&amp;quot;, and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use &amp;quot;myserver&amp;quot; for this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now you should be under this directory: &lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
===Identifying your resource===&lt;br /&gt;
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the &amp;quot;myserver&amp;quot; folder in our case. So create a text file and name it &amp;quot;meta.xml&amp;quot;, and open it with notepad.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;YourName&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;My Server&amp;quot; description=&amp;quot;My first MTA server&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the ''&amp;lt;info /&amp;gt;'' tag, there's a &amp;quot;type&amp;quot; field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. &lt;br /&gt;
&lt;br /&gt;
The ''&amp;lt;script /&amp;gt;'' tag indicates the script files contained in the resource, which we will create next.&lt;br /&gt;
===Creating a simple script===&lt;br /&gt;
Note that in the ''&amp;lt;script /&amp;gt;'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will spawn you at the coordinate (x, y, z) specified above, when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the player will see is blue sky).&lt;br /&gt;
&lt;br /&gt;
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!&lt;br /&gt;
&lt;br /&gt;
===Running the script===&lt;br /&gt;
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then &amp;quot;ready to accept connections!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Before you connect to the server, you must run the gamemode. Type &amp;quot;start myserver&amp;quot; and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and &amp;quot;Quick Connect&amp;quot; using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.&lt;br /&gt;
&lt;br /&gt;
Next we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how Graphical User Interface in MTA is drawn and scripted.&lt;br /&gt;
&lt;br /&gt;
==Creating a simple command==&lt;br /&gt;
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- create a vehicle and stuff&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- create a command handler&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''&lt;br /&gt;
&lt;br /&gt;
====About command handlers====&lt;br /&gt;
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.&lt;br /&gt;
&lt;br /&gt;
If you have already experience in scripting, you will know that you call a function like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example: Someone types &amp;quot;createvehicle 468&amp;quot; ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similiar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
[[Event|Events]] are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[Advanced Topics]]&lt;br /&gt;
* [[OOP_Introduction|OOP Scripting Introduction]]&lt;br /&gt;
* [[Scripting Introduction Urdu]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[nl:Scripting_introductie]]&lt;br /&gt;
[[pt-br:Introdução ao Scripting]]&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[ar:مقدمه_في_البرمجه]]&lt;br /&gt;
[[zh-cn:脚本编写介绍]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Introduc%C3%A3o_ao_GUI_scripting&amp;diff=41370</id>
		<title>PT-BR/Introducão ao GUI scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Introduc%C3%A3o_ao_GUI_scripting&amp;diff=41370"/>
		<updated>2014-08-11T17:16:45Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Aviso|Este artigo necessita de revisão, pois está '''incompleto'''.|1}}&lt;br /&gt;
&lt;br /&gt;
Um importante recurso do MTA:SA é capacidade de criar uma GUI (Graphical User Interface) personalizada. Uma GUI consiste em janelas, botões, caixas de edição, caixas de verificação e etc. Em outras palavras, todos os componentes presentes em janelas do Windows, por exemplo. Eles podem ser exibidos enquanto o usuário está no jogo, em vez de eles precisarem usar comandos tradicionais.&lt;br /&gt;
&lt;br /&gt;
''Obs: É de extrema importância dar uma olhada na [[PT-BR/Introducao_ao_Scripting|Introdução ao Scripting]] porque muitas perguntas que poderão surgir neste tutorial provavelmente estão relacionados a falta de conceitos básicos de scripting.''&lt;br /&gt;
&lt;br /&gt;
[[Image:AdminGUI.png|thumb|Admin Console GUI]]&lt;br /&gt;
&lt;br /&gt;
==Tutorial: Janela de Login==&lt;br /&gt;
Neste tutorial, vamos fazer uma janela de login bem simples, com duas caixas de entrada (input boxes) e um botão (button). A janela aparecerá quando o jogador entrar no jogo, e quando o botão de login for clicado, o jogador nasce no mapa. Usarenos o modo de jogo que foi criado no artigo [[PT-BR/Introducao_ao_Scripting|Introdução ao Scripting]]. Se você procedeu com o mesmo e tem o script em mãos, precisará remover ou comentar a linha [[spawnPlayer]] da função ''joinHandler'', pois iremos criar uma jenela para realizar tal ação.&lt;br /&gt;
&lt;br /&gt;
===Criando a janela===&lt;br /&gt;
Todo o scripting GUI deverá ser feito no lado do cliente. Também é recomendado colocar esses arquivos em uma pasta separada, em prol de manter uma melhor organização.&lt;br /&gt;
&lt;br /&gt;
Vá até o diretório ../server/mods/deathmatch/resources/, e crie uma pasta chamada &amp;quot;client&amp;quot;. Sob o diretório /client/, crie um arquivo de texto com o nome &amp;quot;gui.lua&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Neste arquivo vamos escrever uma função que cria a janela. Para fazer isto, iremos utilizar [[guiCreateWindow]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function criarJanelaDeLogin()&lt;br /&gt;
	-- definir a posição X e Y&lt;br /&gt;
	local x = 0.375&lt;br /&gt;
	local y = 0.375&lt;br /&gt;
	-- definir a largura e altura&lt;br /&gt;
	local largura = 0.25&lt;br /&gt;
	local altura = 0.25&lt;br /&gt;
	-- criar a janela e defini-la na variável 'janelaLogin'&lt;br /&gt;
	-- clique no nome da função para ler a sua documentação&lt;br /&gt;
	janelaLogin = guiCreateWindow(x, y, largura, altura, &amp;quot;Efetue o Login&amp;quot;, true)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relativo e Absoluto===&lt;br /&gt;
Nota-se que o último argumento colocado em guiCreateWindow é ''true''. Isto indica que as coordenadas e dimensões da janela são '''relativas''', o que significa que é uma ''porcentagem'' do tamanho total da tela. Em outras palavras, se o lado esquerdo da tela é 0, e a extrema-direita é 1. Desta maneira, a posição X valendo 0.5 representaria o ponto central da tela. De forma análoga, se a parte superior da tela é 0 e a inferior é 1, uma posição Y de 0.2 seria 20% do caminho para baixo da tela. Os mesmos princípios se aplicam para largura e altura, exemplo: Se a largura for 0.5, a janela será a metade da largura da tela.&lt;br /&gt;
&lt;br /&gt;
Caso não queira utilizar valores relativos, poderá optar por '''absolutos''' ao colocar ''false'' no argumento. Os valores absolutos são calculados como o número total de pixels do canto superior esquerdo do elemento o qual o componente GUI está subordinado. Se nenhum elemento pai for especificado, este será a própria tela. Neste caso, se tivermos uma resolução de tela de 1920x1200, o lado esquerdo será 0 pixel e o de extrema-direita, será 1920 pixels. Uma posição X de 960 representará o ponto central da tela. Similarmente, se a parte superior da tela é de 0 pixel e o fundo é de 1200, uma posição Y de 20 seria de 20 pixels para baixo a partir da parte superior da tela. Os mesmos princípios se aplicam a largura e altura, exemplo: Caso a largura seja 50, a janela terá os exatos 50 pixels de largura. ''Com um pouco de matemática, e usando a função [[guiGetScreenSize]], você poderá calcular as posições absolutas corretamente.''&lt;br /&gt;
&lt;br /&gt;
As diferenças entre o uso de valores relativos e absolutos é muito simples. Se uma for GUI criada usando valores absolutos, cada unidade valerá um pixel. Enquanto os valores relativos usarão a porcentagem para definir essas posições.&lt;br /&gt;
&lt;br /&gt;
Absoluto é geralmente mais fácil de usar quando a edição do código for feita a mão. Entretanto, a escolha do tipo de medida dependerá da finalidade do componente GUI.&lt;br /&gt;
&lt;br /&gt;
Uma das principais razões de se utilizar valores relativos é para evitar que as janelas fiquem fora da tela ou em posições nada desejáveis. Um GUI que foi feito, por exemplo, na resolução de 1080p e for posicionada no canto superior direito com valores absolutos, ficará fora da tela caso esse script fosse executado em 720p. Oras, porque posicionarei uma janela nas coordenadas (1080, 0) se a tela do sujeito só vai até 720 pixels no eixo x? Simplesmente não vai funcionar.&lt;br /&gt;
&lt;br /&gt;
Neste tutorial, obviamente usaremos valores relativos para a tela de login, e seus componentes, ficarem exatamente onde é preciso.&lt;br /&gt;
&lt;br /&gt;
===Adicionando os componentes===&lt;br /&gt;
Vamos adicionar:&lt;br /&gt;
* Textos (labels), para mostrar o que é cada campo - usuário, senha &lt;br /&gt;
* Caixas de edição (edit boxes), para que o usuário possa inserir seus dados&lt;br /&gt;
* Um botão para efetuar o login&lt;br /&gt;
&lt;br /&gt;
Para criar botões você deve usar [[guiCreateButton]], e para criar caixas de edição você deve usar [[guiCreateEdit]]:&lt;br /&gt;
&lt;br /&gt;
'''Note que agora iremos adicionar mais instruções para a função ''criarJanelaDeLogin''. Portanto, esta não é uma nova função, e sim uma substituta da qual você já tem.'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function criarJanelaDeLogin()&lt;br /&gt;
	local x = 0.375&lt;br /&gt;
	local y = 0.375&lt;br /&gt;
	local largura = 0.25&lt;br /&gt;
	local altura = 0.25&lt;br /&gt;
	wdwLogin = guiCreateWindow(x, y, largura, altura, &amp;quot;Efetue o Login&amp;quot;, true)&lt;br /&gt;
	&lt;br /&gt;
	-- Definir as novas posições x e y para o primeiro label&lt;br /&gt;
	x = 0.0391&lt;br /&gt;
	y = 0.1979&lt;br /&gt;
	-- Definir o novo valor de largura e altura para o primeiro label&lt;br /&gt;
	largura = 0.3672&lt;br /&gt;
	altura = 0.25&lt;br /&gt;
	-- Criar o primeiro label. Note que o último argumento passado é 'wdwLogin', representando a janela&lt;br /&gt;
	-- Ou seja, ele será o elemento pai (parent) deste texto (label)&lt;br /&gt;
	-- Assim toda os valores de tamanho serão relativos a esta janela&lt;br /&gt;
	guiCreateLabel(x, y, largura, altura, &amp;quot;Usuário:&amp;quot;, true, wdwLogin)&lt;br /&gt;
&lt;br /&gt;
	-- Alterar o valor de y, assim o segundo label ficará ligeiramente abaixo do primeiro&lt;br /&gt;
	largura = 0.25&lt;br /&gt;
	y = 0.5&lt;br /&gt;
	guiCreateLabel(x, y, largura, altura, &amp;quot;Senha:&amp;quot;, true, wdwLogin)&lt;br /&gt;
&lt;br /&gt;
	-- Valores para as entradas&lt;br /&gt;
	x = 0.415&lt;br /&gt;
	y = 0.2&lt;br /&gt;
	largura = 0.5&lt;br /&gt;
	altura = 0.15&lt;br /&gt;
	editUsuario = guiCreateEdit(x, y, largura, altura, &amp;quot;&amp;quot;, true, wdwLogin)&lt;br /&gt;
	Y = 0.5&lt;br /&gt;
	edtSenha = guiCreateEdit(x, y, largura, altura, &amp;quot;&amp;quot;, true, wdwLogin)&lt;br /&gt;
&lt;br /&gt;
	-- Definir o tamanho máximo de caracteres do nome de usuário e a senha para 50&lt;br /&gt;
	guiEditSetMaxLength(editUsuario, 50)&lt;br /&gt;
	guiEditSetMaxLength(edtSenha, 50)&lt;br /&gt;
	&lt;br /&gt;
	x = 0.415&lt;br /&gt;
	y = 0.7&lt;br /&gt;
	largura = 0.25&lt;br /&gt;
	altura = 0.2&lt;br /&gt;
	btnLogin = guiCreateButton(x, y, largura, altura, &amp;quot;Login&amp;quot;, true, wdwLogin)&lt;br /&gt;
	&lt;br /&gt;
	-- Tornar a janela invisível&lt;br /&gt;
	guiSetVisible(wdwLogin, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Em nosso script, quando usamos a função para criar cada componente da janela, definimos a variável ''wdwLogin'' no último argumento. Isso significa que esses componentes estão contidos na janela. Em inglês dizemos que ele é um ''child element'' e a janela é um ''parent element''..&lt;br /&gt;
&lt;br /&gt;
Isto é muito útil porque não só significa que todos os componentes estão anexados à janela e irão mover-se com ela. Além disso, todas as alterações realizadas na janela serão aplicadas a todos os elementos subordinados, ou elementos filhos. Para ocultamos a janela, simplesmente usaremos a função:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
guiSetVisible(wdwLogin, false) -- Isso fará com que todos os elementos subordinado fiquem invisíveis também. O conjunto só será mostrado quando for preciso.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
===Usando a função criada anteriormente===&lt;br /&gt;
A função criarJanelaDeLogin agora está completa, mas nada vai acontecer até que nós a chamamos. È Recomendado criar toda a GUI quando o recurso client for iniciado, então será ocultada, e mostrará para o jogador quando necessário. Portanto, vamos escrever um manipulador de eventos para &amp;quot;[[onClientResourceStart]]&amp;quot; para criar a janela:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- anexar o manipulador de eventos para o elemento raiz (root element) do recurso&lt;br /&gt;
-- isso significa que ele só irá desencadear (trigger) quando seu próprio recurso é iniciado&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), &lt;br /&gt;
	function ()&lt;br /&gt;
		criarJanelaDeLogin()&lt;br /&gt;
	end&lt;br /&gt;
)	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Como este é uma janela de login, agora precisamos mostrar a janela quando o jogador entra no jogo.&lt;br /&gt;
Isto pode ser feito usando o mesmo evento, &amp;quot;[[onClientResourceStart]]&amp;quot;, para que possamos modificar o código acima e incluir para mostrar a janela:&lt;br /&gt;
&lt;br /&gt;
'''Observe que agora estamos escrevendo mais código para o nosso manipulador 'onClientResourceStart' existente. Este não é um novo manipulador de eventos e se destina a substituir o que você já tem.'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), &lt;br /&gt;
	function ()&lt;br /&gt;
		-- criar a janela de login e seus componentes&lt;br /&gt;
		criarJanelaDeLogin()&lt;br /&gt;
&lt;br /&gt;
		-- saída de uma mensagem de boas-vindas ao jogador&lt;br /&gt;
                outputChatBox(&amp;quot;Bem-vindo ao meu servidor MTA:SA, por favor efetue o login.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
		-- se a GUI foi criada com êxito, então, mostrar a GUI para o jogador&lt;br /&gt;
	        if (wdwLogin ~= nil) then&lt;br /&gt;
			guiSetVisible(wdwLogin, true)&lt;br /&gt;
		else&lt;br /&gt;
			-- se a GUI não foi criada corretamente, notificar o jogador&lt;br /&gt;
			outputChatBox(&amp;quot;Um erro inesperado ocorreu e a janela de login não foi criada.&amp;quot;)&lt;br /&gt;
	        end&lt;br /&gt;
&lt;br /&gt;
		-- habilitar o cursor para os jogadores (para que eles possam selecionar e clique sobre os componentes)&lt;br /&gt;
	        showCursor(true)&lt;br /&gt;
		-- definir o foco de entrada para a GUI, permitindo que os jogadores (por exemplo) para pressione 'T', sem que o chatbox abra&lt;br /&gt;
	        guiSetInputEnabled(true)&lt;br /&gt;
	end&lt;br /&gt;
)	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note que temos uma simples verificação de segurança antes de tornar a janela visível, no caso improvável de que a janela não foi criada, significa que wdwLogin não é um elemento válido, nós não temos um erro. e apenas informamos o jogador o que aconteceu.&lt;br /&gt;
Na próxima etapa, vamos criar a funcionalidade para o botão de login.&lt;br /&gt;
&lt;br /&gt;
==Programando o botão==&lt;br /&gt;
Agora que nós criamos nossa GUI e mostrou-a para o jogador, é preciso programa-la para que possa funcionar. &lt;br /&gt;
&lt;br /&gt;
===Detectando o clique===&lt;br /&gt;
Quando o jogador clica em qualquer parte da GUI, o evento &amp;quot;[[onClientGUIClick]]&amp;quot; será acionado para o componente GUI que você clicou. Isso nos permite facilmente detectar quaisquer cliques sobre o elemento GUI que deseja usar.&lt;br /&gt;
Por exemplo, podemos anexar o evento para o botão btnLogin para obter todos os cliques sobre ele:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- anexar o evento onClientGUIClick para btnLogin e definir-lo para chamar a função 'submeterLoginClient'&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, btnLogin, submeterLoginClient, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Observe o argumento final passado é &amp;quot;false&amp;quot;. Isto indica que o evento só irá acionar diretamente sobre btnLogin, não se o evento tem propagado para cima ou para baixo da árvore. Se configurado para &amp;quot;true&amp;quot;, enquanto anexado ao elemento gui significa que se clicar em qualquer elemento no mesmo ramo vai disparar esse evento.'''&lt;br /&gt;
&lt;br /&gt;
Esta linha de código agora pode ser adicionada dentro da função criarJanelaDeLogin. É um erro comum, tentar anexar eventos a elementos GUI inexistentes,  então certifique-se sempre de anexar os seus eventos '''depois''' o elemento gui (neste caso, o botão) foi criado:&lt;br /&gt;
&lt;br /&gt;
'''Note que vamos agora escrever mais código para a nossa função 'criarJanelaDeLogin'.''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function criarJanelaDeLogin()&lt;br /&gt;
	-- criar todos os nossos elementos da GUI&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
	-- agora adicionar o evento onClientGUIClick para o botão que acabamos de criar&lt;br /&gt;
	addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, btnLogin, submeterLoginClient, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Gerenciando o clique===&lt;br /&gt;
Agora que podemos detectar quando o jogador clica no botão, é preciso escrever o código para gerenciar o que acontece quando ele é clicado.&lt;br /&gt;
Em nosso manipulador de eventos [[onClientClick]], a função submeterLoginClient sempre será chamada quando o botão btnLogin for clicado.&lt;br /&gt;
Portanto, agora podemos usar a função submeterLoginClient para controlar o que acontece quando o botão é clicado:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- criar a função e definir os parâmetros para 'botão' (button) e 'estado' (state)&lt;br /&gt;
-- (eles são passados automaticamente pelo onClientGUIClick)&lt;br /&gt;
function submeterLoginClient(button,state)&lt;br /&gt;
	-- se o nosso botão de login foi clicado com o botão esquerdo do mouse, eo estado do botão do mouse é up&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- mover o foco de entrada de volta para o jogo (permitindo aos jogadores para se movimentar, abrir o chat, etc)&lt;br /&gt;
		guiSetInputEnabled(false)&lt;br /&gt;
		-- ocultar a janela e todos os componentes&lt;br /&gt;
		guiSetVisible(wdwLogin, false)&lt;br /&gt;
		-- desabilitar o cursor do mouse&lt;br /&gt;
		showCursor(false)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Agora, quando o botão é clicado, a janela será ocultada e todos os controles serão permitidos para o jogador. Em seguida, vamos ligar com o lado server para permitir que o jogador execute spawn.&lt;br /&gt;
&lt;br /&gt;
===Chamando o lado server===&lt;br /&gt;
Chamando o lado server pode ser feito usando [[triggerServerEvent]]. Isto lhe permite chamar um evento especificado no server através do client. Se quiser chamar o client através do server pode ser feito usando [[triggerClientEvent]].&lt;br /&gt;
Aqui, usamos a função [[triggerServerEvent]] para chamar o nosso evento personalizado no lado server, chamado &amp;quot;submeterLogin&amp;quot;, que irá controlar a função de spawn que é do lado server.&lt;br /&gt;
&lt;br /&gt;
'''Note que iremos agora escrever mais código para a nossa função 'submeterLoginClient'. Esta não é uma nova função e se destina a substituir o que você já tem.''' &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function submeterLoginClient(button,state)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- obter o texto inserido no campo 'nomeDeUsuario'&lt;br /&gt;
		local nomeDeUsuario = guiGetText(editUsuario)&lt;br /&gt;
		-- obter o texto inserido no campo 'senha'&lt;br /&gt;
		local senha = guiGetText(edtSenha)&lt;br /&gt;
&lt;br /&gt;
		-- se o nome de usuário e senha existem&lt;br /&gt;
		if nomeDeUsuario and senha then&lt;br /&gt;
			-- acionar o evento server 'submeterLogin' e passar o nome de usuário e senha para ele&lt;br /&gt;
			triggerServerEvent(&amp;quot;submeterLogin&amp;quot;, getRootElement(), nomeDeUsuario, senha)&lt;br /&gt;
&lt;br /&gt;
			-- ocultar a gui, desabilitar o cursor e retornar o controle para o jogador&lt;br /&gt;
			guiSetInputEnabled(false)&lt;br /&gt;
			guiSetVisible(wdwLogin, false)&lt;br /&gt;
			showCursor(false)&lt;br /&gt;
		else&lt;br /&gt;
			-- caso contrário, irá sair uma mensagem para o jogador, se o nome de usuário e/ou senha não existem&lt;br /&gt;
			-- e não ocultar a gui&lt;br /&gt;
			outputChatBox(&amp;quot;Por favor, digite o nome de usuário e senha.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Criando o evento do lado server===&lt;br /&gt;
Neste ponto nós temos agora todos os códigos necessários no lado do client, então abra seu arquivo do lado server 'script.lua' (do  [[PT-BR/Introducao_ao_Scripting|Introdução ao Scripting]]) ou outro arquivo do lado server adequado para trabalhar.&lt;br /&gt;
&lt;br /&gt;
No lado do servidor, lembre-se que o jogador executará o spawn assim que entrar.&lt;br /&gt;
Então, em primeiro lugar, teremos que definir o evento personalizado que iremos usar antes no client. Isto pode ser feito usando [[addEvent]] e [[AddEventHandler]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- criar nossa função loginHandler, com parâmetros 'username' e 'senha' (passado pelo client gui)&lt;br /&gt;
function loginHandler(username,senha)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- definir o nosso evento personalizado e permitir que ele seja acionado a partir do cliente ('true')&lt;br /&gt;
addEvent(&amp;quot;submeterLogin&amp;quot;,true)&lt;br /&gt;
-- adicionar um manipulador de eventos para quando 'submeterLogin' for acionado, a função 'loginHandler' é chamada&lt;br /&gt;
addEventHandler(&amp;quot;submeterLogin&amp;quot;,root,loginHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Efetuando login===&lt;br /&gt;
Agora, temos uma função que é chamada através do evento personalizado 'submeterLogin', podemos começar a trabalhar com o login e spawn do jogador, usando a nossa função 'loginHandler':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function loginHandler(username,senha)&lt;br /&gt;
	-- verificar se o nome de usuário e senha estão corretos&lt;br /&gt;
	if username == &amp;quot;user&amp;quot; and senha == &amp;quot;apple&amp;quot; then&lt;br /&gt;
		-- se o jogador foi logado com sucesso, então gerar ele no jogo&lt;br /&gt;
		if (client) then&lt;br /&gt;
			spawnPlayer(client, 1959.55, -1714.46, 10)&lt;br /&gt;
			fadeCamera(client, true)&lt;br /&gt;
                        setCameraTarget(client, client)&lt;br /&gt;
			outputChatBox(&amp;quot;Bem-vindo ao servidor.&amp;quot;, client)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- se o nome de usuário ou senha não estão corretos, informar para o jogador&lt;br /&gt;
		outputChatBox(&amp;quot;Nome de usuário e senha inválidos. Por favor, tente novamente.&amp;quot;,client)&lt;br /&gt;
        end			&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEvent(&amp;quot;submeterLogin&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;submeterLogin&amp;quot;,root,loginHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Para os fins deste tutorial, um sistema de username e senha muito básico é mostrado. Para uma alternativa mais compreensiva, você pode usar o Sistema de Conta ou um banco de dados MySQL.'''&lt;br /&gt;
&lt;br /&gt;
Observe também o uso da variável &amp;quot;client&amp;quot;, é uma variável interna usada pelo MTA para identificar o jogador que disparou o evento.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finalmente, não se esqueça de incluir o arquivo gui.lua novo no meta.xml do recurso principal, e nomeá-lo como um script client:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client/gui.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Neste ponto, temos agora uma janela de login básico que verifica nome de usuário do jogador e senha quando o botão de login é clicado. Se eles estiverem corretos, o jogador é automaticamente gerado no jogo.&lt;br /&gt;
&lt;br /&gt;
Para mais ajuda com GUI, consulte [[:Category:GUI_Tutorials|Tutoriais GUI]].&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:GUI_Tutorials]]&lt;br /&gt;
&lt;br /&gt;
[[en:Introduction to Scripting the GUI]]&lt;br /&gt;
[[es:Introducción a la Programación de GUI]]&lt;br /&gt;
[[it:Introduzione_allo_scripting_della_GUI]]&lt;br /&gt;
[[ru:Introduction to Scripting the GUI]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/P%C3%A1gina_Inicial&amp;diff=41346</id>
		<title>PT-BR/Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/P%C3%A1gina_Inicial&amp;diff=41346"/>
		<updated>2014-08-10T19:02:11Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Página Inicial to Página Inicial: Fix the damn title!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Página Inicial]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=41345</id>
		<title>Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=41345"/>
		<updated>2014-08-10T19:02:10Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Cristiano Cardoso moved page PT-BR/Página Inicial to Página Inicial: Fix the damn title!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding: 5px; height: 130px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px]]'''Bem vindo ao Wiki do Multi Theft Auto.''' Aqui você encontra tudo sobre o uso desta modificação.&lt;br /&gt;
&lt;br /&gt;
Há muitas [[How you can help|coisas em que você pode nos ajudar]] para melhorar este programa, como criar um mapa, um modo de jogo, documentar funções e eventos, escrever códigos úteis para outros usuários, fazer tutoriais, reportar bugs que encontrar ou somente jogar a vontade!&lt;br /&gt;
&lt;br /&gt;
Se você tem alguma dúvida a respeito do Multi Theft Auto, não se esqueça de perguntar à comunidade em nossos [http://forum.mtasa.com/ fóruns].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Jogar&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Baixe o Multi Theft Auto {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Onde_adquirir_o_GTASA|Onde adquirir o GTASA]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Cliente|Manual do usuário]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Novidades_na_versão_{{Current Version|full}}|Novidades da última versão ]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Soluções_de_Problemas_-_FAQ|Solução de problemas]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Migrando_do_MTA:Race_ao_MTA:SA_1.3|Migrando do MTA:Race para o MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Servidor|Manual do servidor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Recursos:Map_Manager|Gerenciador de mapas (''Map Manager'')]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Editor de mapas&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor|Manual do editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor-EDF|Ficheiro de definições do editor (EDF)]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor-Plugins|Extensões para o editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor#FAQ|Perguntas frequentes (FAQ)]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Banco de dados&amp;lt;/h3&amp;gt;&lt;br /&gt;
Aqui tem tudo relacionado às vantagens que Lua tem a oferecer ao MTA e seus recursos.&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[:Category:Resource|Catálogo de Recursos]] - Você deve aprender com eles para fazer scripts bons&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Scripts_do_Cliente|Scripts do Cliente]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Módulos|Módulos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Desenvolvimento do Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Últimas compilações]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA|Compilando o MTASA no Windows]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Mac_OS_X|Compilando o MTASA no Mac OS X]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Linux|Compilando o MTASA no Linux]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Guia_do_Desenvolvedor|Guia do Desenvolvedor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://code.google.com/p/mtasa-blue Código fonte no Google Code]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Roadmap|Roteiro para versões futuras]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://bugs.mtasa.com/ Central de bugs]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Como você pode nos ajudar&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Documentar funções ou eventos&lt;br /&gt;
* Criar exemplos funcionais e eficientes de funções e eventos&lt;br /&gt;
* Examinar e corrigir as páginas&lt;br /&gt;
* Escrever tutoriais para ajudar novatos&lt;br /&gt;
* Ajudar a traduzir as páginas da Wiki para outras linguagens&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Comunidade&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.multitheftauto.com/ Fóruns]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [irc://irc.multitheftauto.com/mta IRC]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://community.mtasa.com/ Comunidade]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://twitter.com/#!/MTAQA/ Twitter] &lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.youtube.com/user/MTAQA Youtube]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://plus.google.com/102014133442331779727/ Google]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introdução_ao_Scripting|Introdução a ''scripting'']]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introducao_ao_GUI_scripting|Introdução a ''scripting'' de UI]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Depuração|Depuração]] - Encontre erros em seu Script&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Recursos|Introdução a recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/Acesso web via recursos|Acesso web via recursos]] - Abra servidores web através de recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[:Category:PT-BR/Recursos|Lista de recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/Meta.xml|Meta.xml]] - Todo recurso possui um arquivo meta descrevendo a si próprio&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/ACL|Lista de controle de acesso (ACL)]] - Componente vital para recursos complexos&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Composição_de_Gamemodes|Composição de modos de jogo]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[PT-BR/Funções_Úteis|Funções Úteis]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Links dos fóruns&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [http://forum.mtasa.com/viewforum.php?f=152 Secção do fórum para dúvidas sobre ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewforum.php?f=148 Guias de ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Wiki ''offline'']&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Manuais sobre Lua&amp;lt;/h3&amp;gt;&lt;br /&gt;
Página muito útil para ajuda-lo a entender o funcionamento do Lua&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/portugues.html Introdução à linguagem]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html Manual básico]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/manual/5.1/pt/ Manual de referência]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://lua-users.org/wiki/TutorialDirectory Outra wiki, somente de Lua]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Referência&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Functions|Funções do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Events|Eventos do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Functions|Funções do servidor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Events|Eventos do servidor]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[MTA Classes|Classes do Multi Theft Auto]] - Informações detalhadas sobre todas as classes do MTA&lt;br /&gt;
** [[File:iUS.png|Em Inglês|20px]] [[Element tree|Árvore dos elementos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|Lista de IDs de objetos e texturas]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animações]]&lt;br /&gt;
*[[Character Skins|''Skins'' de pedestres]]&lt;br /&gt;
*[[PT-BR/Roupas_CJ|Roupas do CJ]]&lt;br /&gt;
*[[Garage|Garagens]]&lt;br /&gt;
*[[Interior IDs|Interiores]]&lt;br /&gt;
*[[Material IDs|Materiais]]&lt;br /&gt;
*[[Projectiles|Projéteis]]&lt;br /&gt;
*[[Radar Blips|''Blips'']]&lt;br /&gt;
*[[Sounds|Efeitos sonoros]]&lt;br /&gt;
*[[Vehicle IDs|Veículos]]&lt;br /&gt;
*[[Vehicle Colors|Cores dos veículos]]&lt;br /&gt;
*[[Vehicle Upgrades|Acessórios dos veículos]]&lt;br /&gt;
*[[Vehicle variants|Variantes dos veículos]]&lt;br /&gt;
*[[Weapons|Armas]]&lt;br /&gt;
*[[Weather|Ambientação]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:pBR.png|32px]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Sobre a Tradução&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Tradutores:&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=50642|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;RaceXtreme&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=59023|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;StanleySathler&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=55744|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;DNL291&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=62091|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Ninguem&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=63192|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Anderl&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
É importante que todos colaborem para que nossa página em português fique melhor a cada dia!&lt;br /&gt;
&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/]]&lt;br /&gt;
'''Multi Theft Auto''' é um projeto '''open source'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Sobre o Multi Theft Auto'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive|Arquivos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage|Eventos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Desenvolvedores]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Baixe-o]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Solução de problemas]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Status da Wiki'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} artigos&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} páginas&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} usuários registrados&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|pt-br}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Changes_in_1.4&amp;diff=41298</id>
		<title>Changes in 1.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Changes_in_1.4&amp;diff=41298"/>
		<updated>2014-08-10T14:35:31Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added languages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Main Additions / Changes ==&lt;br /&gt;
* Localization of MTA's menus&lt;br /&gt;
* [[OOP]] classes&lt;br /&gt;
* [[Matrix|Matrices]] and [[Vector|Vectors]]&lt;br /&gt;
* Significantly improved train synchronization&lt;br /&gt;
* Improved all sound functions to work with player elements&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New functions ===&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
* Added [[createEffect]]&lt;br /&gt;
* Added [[setEffectSpeed]]&lt;br /&gt;
* Added [[getEffectSpeed]]&lt;br /&gt;
* Added [[setEffectDensity]]&lt;br /&gt;
* Added [[getEffectDensity]]&lt;br /&gt;
* Added [[getLocalization]]&lt;br /&gt;
* Added [[isChatVisible]]&lt;br /&gt;
* Added [[downloadFile]]&lt;br /&gt;
* Added [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[isBan]]&lt;br /&gt;
* Added [[setBanAdmin]]&lt;br /&gt;
* Added [[setBanReason]]&lt;br /&gt;
* Added [[setUnbanTime]]&lt;br /&gt;
* Added [[getAccountsBySerial]]&lt;br /&gt;
* Added [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* Added [[isElementWaitingForGroundToLoad]]&lt;br /&gt;
* Added additional optional parameter bInstant to setPlayerMoney to instantly set the money without counting up/down&lt;br /&gt;
* Fixed toJSON/fromJSON not handling binary data properly&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New Events ===&lt;br /&gt;
&lt;br /&gt;
==== Client ====&lt;br /&gt;
* Added [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting: Changes, Bugfixes and Additions ===&lt;br /&gt;
* Fixed getResourceConfig() not working on foreign resources&lt;br /&gt;
* Fixed the Brown Streak Carriage (ID: 570)&lt;br /&gt;
* Changed attachTrailerToVehicle to support trains&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
=== Client: Additions ===&lt;br /&gt;
* Distinguish between left and right Shift, Ctrl and Alt presses.&lt;br /&gt;
* Added SettingHUDMatchAspectRatio, SettingAspectRatio to dxGetStatus.&lt;br /&gt;
* Added support for the use of [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] audio files in playSound and playSound3D.&lt;br /&gt;
&lt;br /&gt;
=== Client: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed the money &amp;quot;counts down&amp;quot; GTA-Style when you change a server.&lt;br /&gt;
* Fixed peds being invulnerable to gun fire when doing a drive by.&lt;br /&gt;
* Fixed onClientPlayerDamage not triggering for spray can.&lt;br /&gt;
* Satchels should now be removed on [[resetMapInfo]].&lt;br /&gt;
* Fixed getPedMoveState returns false when moving in crouch state&lt;br /&gt;
* Fixed guiScrollPaneGetVerticalScrollPosition returning strange and stepped values.&lt;br /&gt;
* Fixed setPedCameraRotation not working.&lt;br /&gt;
* Fixed peds continuing to fire their weapons after running out of ammo.&lt;br /&gt;
* Fixed radio titles not always showing.&lt;br /&gt;
* Fixed radio music skipping when browsing between different channels.&lt;br /&gt;
* Fixed user track skip (F5) being disabled.&lt;br /&gt;
* Fixed vehicles falling through the map.&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== Server: Additions ===&lt;br /&gt;
* [[setElementDimension]] should now apply to children&lt;br /&gt;
* More descriptive module error messages&lt;br /&gt;
* Commands: unloadmodule and reloadmodule&lt;br /&gt;
* Added server side custom weapons.&lt;br /&gt;
&lt;br /&gt;
=== Server: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed 128 character limit in [[setAccountData]]&lt;br /&gt;
* Wildcard bans should now be checked properly on connect&lt;br /&gt;
* Fixed Team members not being sent to clients if set in [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Extra information ==&lt;br /&gt;
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and Google Code repositories:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[pl:Changes_in_1.4]]&lt;br /&gt;
[[pt-br:Novidades_na_versão_1.4.0]]&lt;br /&gt;
[[ru:Changes_in_1.4.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/Changes_in_1.4.0&amp;diff=41297</id>
		<title>RU/Changes in 1.4.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/Changes_in_1.4.0&amp;diff=41297"/>
		<updated>2014-08-10T14:34:29Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added languages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Главные дополнения / изменения ==&lt;br /&gt;
* Локализация меню МТА&lt;br /&gt;
* [[OOP]] классы&lt;br /&gt;
* [[Matrix|Матрицы]] и [[Vector|Векторы]]&lt;br /&gt;
* Значительно улучшена синхронизация поездов&lt;br /&gt;
* Улучшены все звуковые функции для работы с элементами игрока&lt;br /&gt;
&lt;br /&gt;
== Скриптинг ==&lt;br /&gt;
&lt;br /&gt;
=== Скриптинг: Новые функции ===&lt;br /&gt;
&lt;br /&gt;
==== Клиент ====&lt;br /&gt;
* Добавлена [[createEffect]]&lt;br /&gt;
* Добавлена [[setEffectSpeed]]&lt;br /&gt;
* Добавлена [[getEffectSpeed]]&lt;br /&gt;
* Добавлена [[setEffectDensity]]&lt;br /&gt;
* Добавлена [[getEffectDensity]]&lt;br /&gt;
* Добавлена [[getLocalization]]&lt;br /&gt;
* Добавлена [[isChatVisible]]&lt;br /&gt;
* Добавлена [[downloadFile]]&lt;br /&gt;
* Добавлена [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Сервер ====&lt;br /&gt;
* Добавлена [[isBan]]&lt;br /&gt;
* Добавлена [[setBanAdmin]]&lt;br /&gt;
* Добавлена [[setBanReason]]&lt;br /&gt;
* Добавлена [[setUnbanTime]]&lt;br /&gt;
* Добавлена [[getAccountsBySerial]]&lt;br /&gt;
* Добавлена [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
==== Общие (''Клиентская и серверная сторона'') ====&lt;br /&gt;
* Добавлена [[isElementWaitingForGroundToLoad]]&lt;br /&gt;
* Добавлен дополнительный необязательный параметр bInstant к setPlayerMoney,чтобы срочно установить деньги без подсчета вверх/вниз&lt;br /&gt;
* Исправлены toJSON/fromJSON не обрабатывали бинарные данные правильно&lt;br /&gt;
&lt;br /&gt;
=== Скриптинг: Новые эвенты ===&lt;br /&gt;
&lt;br /&gt;
==== Клиент ====&lt;br /&gt;
* Добавлен [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Сервер ====&lt;br /&gt;
* Добавлен [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Скриптинг: Изменения, исправления багов и дополнения ===&lt;br /&gt;
* Исправлена getResourceConfig() не работает на чужих ресурсах&lt;br /&gt;
* Исправлен Brown Streak Carriage (ID: 570)&lt;br /&gt;
* Изменена attachTrailerToVehicle для поддержки поездов&lt;br /&gt;
&lt;br /&gt;
== Клиент ==&lt;br /&gt;
&lt;br /&gt;
=== Клиент: Дополнения ===&lt;br /&gt;
* Распознавание нажатия между левым и правым Shift, Ctrl и Alt.&lt;br /&gt;
* Добавлены SettingHUDMatchAspectRatio, SettingAspectRatio к dxGetStatus.&lt;br /&gt;
* Добавлена поддержка для использования [https://ru.wikipedia.org/wiki/Opus_(%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA) Opus] аудио файлов в playSound и playSound3D.&lt;br /&gt;
&lt;br /&gt;
=== Клиент: Исправления багов и изменения ===&lt;br /&gt;
* Исправлен денежный &amp;quot;счет вниз&amp;quot; GTA-стиля, когда Вы меняете сервер.&lt;br /&gt;
* Исправлены неуязвимые для стрельбы из оружия педы когда выполняется драйв бай.&lt;br /&gt;
* Исправлена onClientPlayerDamage не срабатывала для балончика.&lt;br /&gt;
* Ранцы должны быть удалены на [[resetMapInfo]].&lt;br /&gt;
* Исправлена getPedMoveState возвращает false, когда перемещается в состояние сидя&lt;br /&gt;
* Исправлена guiScrollPaneGetVerticalScrollPosition возвращала странные и ступенчатые значения.&lt;br /&gt;
* Исправлена setPedCameraRotation не работала.&lt;br /&gt;
* Исправлено пед продолжал стрелять после окончания патронов.&lt;br /&gt;
* Исправлено не всегда показывало название радио.&lt;br /&gt;
* Исправлен пропуск музыки радио при просматривании между различными каналами.&lt;br /&gt;
* Исправлены пользовательские дорожки (F5) были отключены.&lt;br /&gt;
* Исправлено падение транспорта через карту.&lt;br /&gt;
&lt;br /&gt;
== Сервер ==&lt;br /&gt;
&lt;br /&gt;
=== Сервер: Дополнения ===&lt;br /&gt;
* [[setElementDimension]] теперь должен распространяться на потомков&lt;br /&gt;
* Более наглядный модуль сообщения об ошибках&lt;br /&gt;
* Команды: unloadmodule и reloadmodule&lt;br /&gt;
* Добавлено кастомное оружие на серверной стороне.&lt;br /&gt;
&lt;br /&gt;
=== Сервер: Исправления багов и изменения ===&lt;br /&gt;
* Исправлен лимит персонажей(128) в [[setAccountData]]&lt;br /&gt;
* Конструкция запрета теперь должна быть проверена должным образом при подключении.&lt;br /&gt;
* Исправлено  члены команды не отправляются клиентам если установлено в [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Ресурсы ==&lt;br /&gt;
* Еще нет&lt;br /&gt;
&lt;br /&gt;
== Редактор ==&lt;br /&gt;
* Еще нет&lt;br /&gt;
&lt;br /&gt;
== Дополнительная информация ==&lt;br /&gt;
''Более подробную информацию смотрите на [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] и репозиториях Google Code:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.0]]&lt;br /&gt;
[[pl:Changes_in_1.4]]&lt;br /&gt;
[[pt-br:Novidades_na_versão_1.4.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PL/Changes_in_1.4&amp;diff=41296</id>
		<title>PL/Changes in 1.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PL/Changes_in_1.4&amp;diff=41296"/>
		<updated>2014-08-10T14:33:33Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added languages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PL/Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Główne dodatki/zmiany ==&lt;br /&gt;
* Lokalizacja menu MTA&lt;br /&gt;
* Klasy [[OOP]]&lt;br /&gt;
* [[Matrix|Matrix]] i [[Vector|Vector'y]]&lt;br /&gt;
* Znacznie poprawiono synchronizację pociągu&lt;br /&gt;
* Poprawiono wszystkie dźwięki funkcji do pracy z elementami gracza&lt;br /&gt;
&lt;br /&gt;
== Skryptowanie ==&lt;br /&gt;
&lt;br /&gt;
=== Skryptowanie: Nowe funkcje ===&lt;br /&gt;
&lt;br /&gt;
====Klient====&lt;br /&gt;
* Dodano [[createEffect]]&lt;br /&gt;
* Dodano [[setEffectSpeed]]&lt;br /&gt;
* Dodano [[getEffectSpeed]]&lt;br /&gt;
* Dodano [[setEffectDensity]]&lt;br /&gt;
* Dodano [[getEffectDensity]]&lt;br /&gt;
* Dodano [[getLocalization]]&lt;br /&gt;
* Dodano [[isChatVisible]]&lt;br /&gt;
* Dodano [[downloadFile]]&lt;br /&gt;
* Dodano [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Serwer ====&lt;br /&gt;
* Dodano [[isBan]]&lt;br /&gt;
* Dodano [[setBanAdmin]]&lt;br /&gt;
* Dodano [[setBanReason]]&lt;br /&gt;
* Dodano [[setUnbanTime]]&lt;br /&gt;
* Dodano [[getAccountsBySerial]]&lt;br /&gt;
* Dodano [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Wspólne (''Klienta i po stronie serwera'') ====&lt;br /&gt;
* Dodano dodatkową opcję, parametr bInstant do setPlayerMoney do natychmiastowego ustawiania pieniędzy bez liczenia w górę/dół&lt;br /&gt;
* Naprawiono toJSON/fromJSON nie obsługiwało prawidłowo danych binarnych&lt;br /&gt;
&lt;br /&gt;
=== Skryptowanie: Nowe wydarzenia ===&lt;br /&gt;
&lt;br /&gt;
==== Klient ====&lt;br /&gt;
* Dodano [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Serwer ====&lt;br /&gt;
* Dodano [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Skryptowanie: Zmiany, poprawki i uzupełnienia ===&lt;br /&gt;
* Naprawiono getResourceConfig() nie działa na zagranicznych zasobach&lt;br /&gt;
* Naprawiono the Brown Streak Carriage (ID: 570)&lt;br /&gt;
* Zmieniono attachTrailerToVehicle do wspierania pociągów&lt;br /&gt;
&lt;br /&gt;
== Klient ==&lt;br /&gt;
&lt;br /&gt;
=== Klient: Dodatki ===&lt;br /&gt;
* Distinguish between left and right Shift, Ctrl and Alt presses.&lt;br /&gt;
* Added SettingHUDMatchAspectRatio, SettingAspectRatio to dxGetStatus.&lt;br /&gt;
* Added support for the use of [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] audio files in playSound and playSound3D.&lt;br /&gt;
&lt;br /&gt;
=== Klient: Poprawki i zmiany ===&lt;br /&gt;
* Fixed the money &amp;quot;counts down&amp;quot; GTA-Style when you change a server.&lt;br /&gt;
* Fixed peds being invulnerable to gun fire when doing a drive by.&lt;br /&gt;
* Fixed onClientPlayerDamage not triggering for spray can.&lt;br /&gt;
* Satchels should now be removed on [[resetMapInfo]].&lt;br /&gt;
* Fixed getPedMoveState returns false when moving in crouch state&lt;br /&gt;
* Fixed guiScrollPaneGetVerticalScrollPosition returning strange and stepped values.&lt;br /&gt;
* Naprawiono setPedCameraRotation nie działało.&lt;br /&gt;
* Fixed peds continuing to fire their weapons after running out of ammo.&lt;br /&gt;
* Naprawiono tytuły radiów, które nie zawsze się pokazywały&lt;br /&gt;
* Fixed radio music skipping when browsing between different channels.&lt;br /&gt;
* Fixed user track skip (F5) being disabled.&lt;br /&gt;
* Naprawiono pojazdy spadające przez mapę&lt;br /&gt;
&lt;br /&gt;
== Serwer ==&lt;br /&gt;
&lt;br /&gt;
=== Serwer: Dodatki ===&lt;br /&gt;
* [[setElementDimension]] powinien teraz mieć zastosowanie do &amp;quot;dzieci&amp;quot;&lt;br /&gt;
* Bardziej opisowe komunikaty o błędach modułu&lt;br /&gt;
* Komendy: unloadmodule i reloadmodule&lt;br /&gt;
* Dodano po stronie serwera niestandardowe bronie.&lt;br /&gt;
&lt;br /&gt;
=== Serwer: Poprawki i zmiany ===&lt;br /&gt;
* Naprawiono 128 limit znaków w [[setAccountData]]&lt;br /&gt;
* Zakazy powinny być teraz prawidłowo sprawdzane po połączeniu.&lt;br /&gt;
* Naprawiono członkowie zespołu nie są wysyłani do klientów, jeśli są w [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Zasoby ==&lt;br /&gt;
* Na razie brak&lt;br /&gt;
&lt;br /&gt;
== Edytor ==&lt;br /&gt;
* Na razie brak&lt;br /&gt;
&lt;br /&gt;
== Dodatkowe informacje ==&lt;br /&gt;
''Bardziej szczegółowe informacje dostępne na [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] i repozytorium Google Code:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list Niebieskie MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Oficjalne zasoby]&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.0]]&lt;br /&gt;
[[pt-br:Novidades_na_versão_1.4.0]]&lt;br /&gt;
[[ru:Changes_in_1.4.0]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41295</id>
		<title>PT-BR/Novidades na versão 1.4.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41295"/>
		<updated>2014-08-10T14:32:17Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/Changelogs}}&lt;br /&gt;
&lt;br /&gt;
== Principais Mudanças ==&lt;br /&gt;
* Tradução para os menus do MTA&lt;br /&gt;
* Classes [[OOP]]&lt;br /&gt;
* [[Matrix|Matrizes]] e [[Vector|Vetores]]&lt;br /&gt;
* Melhorou muito a sincronização de trens&lt;br /&gt;
* As funções relacionadas a áudio agora são compatíveis com os elementos do tipo jogador&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Novas Funções ===&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
* [[createEffect]]&lt;br /&gt;
* [[setEffectSpeed]]&lt;br /&gt;
* [[getEffectSpeed]]&lt;br /&gt;
* [[setEffectDensity]]&lt;br /&gt;
* [[getEffectDensity]]&lt;br /&gt;
* [[getLocalization]]&lt;br /&gt;
* [[isChatVisible]]&lt;br /&gt;
* [[downloadFile]]&lt;br /&gt;
* [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Servidor ====&lt;br /&gt;
* [[isBan]]&lt;br /&gt;
* [[setBanAdmin]]&lt;br /&gt;
* [[setBanReason]]&lt;br /&gt;
* [[setUnbanTime]]&lt;br /&gt;
* [[getAccountsBySerial]]&lt;br /&gt;
* [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
==== Compartilhados (Cliente e Servidor) ====&lt;br /&gt;
* Adicionado um parâmetro bInstant para setPlayerMoney a fim de definir o montante de dinheiro instantaneamente, sem aparecer a contagem/descontagem no HUD&lt;br /&gt;
* toJSON/fromJSON agora lida melhor com dados binários&lt;br /&gt;
&lt;br /&gt;
=== Novos Eventos ===&lt;br /&gt;
&lt;br /&gt;
==== Cliente ====&lt;br /&gt;
* [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Servidor ====&lt;br /&gt;
* [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Mudanças, correções de bugs ===&lt;br /&gt;
* getResourceConfig() funciona para recursos adicionados posteriormente a inicialização do servidor&lt;br /&gt;
* Consertado o veículo de ID 570&lt;br /&gt;
* attachTrailerToVehicle agora suporta trens&lt;br /&gt;
&lt;br /&gt;
== Cliente ==&lt;br /&gt;
&lt;br /&gt;
=== Novidades ===&lt;br /&gt;
* Distinção entre Shift, Ctrl e Alt esquerdo/direito&lt;br /&gt;
* Adicionados os parâmetros SettingHUDMatchAspectRatio, SettingAspectRatio para [[dxGetStatus]]&lt;br /&gt;
* Suporte de arquivos de áudio usando o [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] nas funções playSound e playSound3D&lt;br /&gt;
&lt;br /&gt;
=== Correções de bugs e mudanças ===&lt;br /&gt;
* Foram corrigidos as ocasiões:&lt;br /&gt;
** O dinheiro é &amp;quot;drenado&amp;quot; no GTA quando se muda de servidor.&lt;br /&gt;
** Os pedestres ficam invencíveis a tiros quando estão no banco de passageiro. &lt;br /&gt;
** O evento onClientPlayerDamage não ativar para a lata de spray.&lt;br /&gt;
** Mochilas não serem removidas com [[resetMapInfo]].&lt;br /&gt;
** getPedMoveState  retornar falso quando o jogador estiver se movendo agachado&lt;br /&gt;
** guiScrollPaneGetVerticalScrollPosition  retornar valores estranhos &lt;br /&gt;
** setPedCameraRotation não funcionar as vezes.&lt;br /&gt;
** Pedestres continuarem atirando depois de sua munição ter acabado.&lt;br /&gt;
** Títulos de rádio não aparecerem.&lt;br /&gt;
** As músicas da rádio serem puladas quando se estiver passando entre as estações.&lt;br /&gt;
** A função para pular uma faixa de áudio (F5) não funcionar.&lt;br /&gt;
** Veículos caírem de repente pelo mapa.&lt;br /&gt;
&lt;br /&gt;
== Servidor ==&lt;br /&gt;
&lt;br /&gt;
=== Novidades ===&lt;br /&gt;
* [[setElementDimension]] deve agora fazer efeito para elementos subordinados&lt;br /&gt;
* Erros de módulo estão mais explicados nas mensagens&lt;br /&gt;
* Novos comandos: unloadmodule e reloadmodule&lt;br /&gt;
* Adicionadas armas customizadas para o lado do servidor.&lt;br /&gt;
&lt;br /&gt;
=== Correções de bugs e mudanças ===&lt;br /&gt;
* Agora não há limite de 128 caracteres para a função [[setAccountData]].&lt;br /&gt;
* Jogadores com nomes contendo caracteres especiais são verificados de forma correta ao conectar.&lt;br /&gt;
* Corrigidos os membros de times não serem enviados ao cliente se forem definidos pela função [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Nada até então&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* Nada até então&lt;br /&gt;
&lt;br /&gt;
== Informações Extras ==&lt;br /&gt;
''Informações mais detalhadas estão disponíveis em nosso Changelog do [https://bugs.multitheftauto.com/changelog_page.php Bug tracker] e no Google Code:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.0]]&lt;br /&gt;
[[pl:Changes_in_1.4]]&lt;br /&gt;
[[ru:Changes_in_1.4.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41294</id>
		<title>PT-BR/Novidades na versão 1.4.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41294"/>
		<updated>2014-08-10T14:30:42Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Traduzido!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/Changelogs}}&lt;br /&gt;
{{Atenção|Este artigo necessita de revisão, pois está '''incompleto'''.|1}}&lt;br /&gt;
&lt;br /&gt;
== Principais Mudanças ==&lt;br /&gt;
* Tradução para os menus do MTA&lt;br /&gt;
* Classes [[OOP]]&lt;br /&gt;
* [[Matrix|Matrizes]] e [[Vector|Vetores]]&lt;br /&gt;
* Melhorou muito a sincronização de trens&lt;br /&gt;
* As funções relacionadas a áudio agora são compatíveis com os elementos do tipo jogador&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Novas Funções ===&lt;br /&gt;
&lt;br /&gt;
====Cliente====&lt;br /&gt;
* [[createEffect]]&lt;br /&gt;
* [[setEffectSpeed]]&lt;br /&gt;
* [[getEffectSpeed]]&lt;br /&gt;
* [[setEffectDensity]]&lt;br /&gt;
* [[getEffectDensity]]&lt;br /&gt;
* [[getLocalization]]&lt;br /&gt;
* [[isChatVisible]]&lt;br /&gt;
* [[downloadFile]]&lt;br /&gt;
* [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Servidor ====&lt;br /&gt;
* [[isBan]]&lt;br /&gt;
* [[setBanAdmin]]&lt;br /&gt;
* [[setBanReason]]&lt;br /&gt;
* [[setUnbanTime]]&lt;br /&gt;
* [[getAccountsBySerial]]&lt;br /&gt;
* [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
==== Compartilhados (Cliente e Servidor) ====&lt;br /&gt;
* Adicionado um parâmetro bInstant para setPlayerMoney a fim de definir o montante de dinheiro instantaneamente, sem aparecer a contagem/descontagem no HUD&lt;br /&gt;
* toJSON/fromJSON agora lida melhor com dados binários&lt;br /&gt;
&lt;br /&gt;
=== Novos Eventos ===&lt;br /&gt;
&lt;br /&gt;
==== Cliente ====&lt;br /&gt;
* [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Servidor ====&lt;br /&gt;
* [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Mudanças, correções de bugs ===&lt;br /&gt;
* getResourceConfig() funciona para recursos adicionados posteriormente a inicialização do servidor&lt;br /&gt;
* Consertado o veículo de ID 570&lt;br /&gt;
* attachTrailerToVehicle agora suporta trens&lt;br /&gt;
&lt;br /&gt;
== Cliente ==&lt;br /&gt;
&lt;br /&gt;
=== Novidades ===&lt;br /&gt;
* Distinção entre Shift, Ctrl e Alt esquerdo/direito&lt;br /&gt;
* Adicionados os parâmetros SettingHUDMatchAspectRatio, SettingAspectRatio para [[dxGetStatus]]&lt;br /&gt;
* Suporte de arquivos de áudio usando o [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] nas funções playSound e playSound3D&lt;br /&gt;
&lt;br /&gt;
=== Correções de bugs e mudanças ===&lt;br /&gt;
* Foram corrigidos as ocasiões:&lt;br /&gt;
** O dinheiro é &amp;quot;drenado&amp;quot; no GTA quando se muda de servidor.&lt;br /&gt;
** Os pedestres ficam invencíveis a tiros quando estão no banco de passageiro. &lt;br /&gt;
** O evento onClientPlayerDamage não ativar para a lata de spray.&lt;br /&gt;
** Mochilas não serem removidas com [[resetMapInfo]].&lt;br /&gt;
** getPedMoveState  retornar falso quando o jogador estiver se movendo agachado&lt;br /&gt;
** guiScrollPaneGetVerticalScrollPosition  retornar valores estranhos &lt;br /&gt;
** setPedCameraRotation não funcionar as vezes.&lt;br /&gt;
** Pedestres continuarem atirando depois de sua munição ter acabado.&lt;br /&gt;
** Títulos de rádio não aparecerem.&lt;br /&gt;
** As músicas da rádio serem puladas quando se estiver passando entre as estações.&lt;br /&gt;
** A função para pular uma faixa de áudio (F5) não funcionar.&lt;br /&gt;
** Veículos caírem de repente pelo mapa.&lt;br /&gt;
&lt;br /&gt;
== Servidor ==&lt;br /&gt;
&lt;br /&gt;
=== Novidades ===&lt;br /&gt;
* [[setElementDimension]] deve agora fazer efeito para elementos subordinados&lt;br /&gt;
* Erros de módulo estão mais explicados nas mensagens&lt;br /&gt;
* Novos comandos: unloadmodule e reloadmodule&lt;br /&gt;
* Adicionadas armas customizadas para o lado do servidor.&lt;br /&gt;
&lt;br /&gt;
=== Correções de bugs e mudanças ===&lt;br /&gt;
* Agora não há limite de 128 caracteres para a função [[setAccountData]].&lt;br /&gt;
* Jogadores com nomes contendo caracteres especiais são verificados de forma correta ao conectar.&lt;br /&gt;
* Corrigidos os membros de times não serem enviados ao cliente se forem definidos pela função [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Nada até então&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* Nada até então&lt;br /&gt;
&lt;br /&gt;
== Informações Extras ==&lt;br /&gt;
''Informações mais detalhadas estão disponíveis em nosso Changelog do [https://bugs.multitheftauto.com/changelog_page.php Bug tracker] e no Google Code:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.0]]&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=41216</id>
		<title>Scripting Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction&amp;diff=41216"/>
		<updated>2014-08-07T14:22:01Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added OOP entry at &amp;quot;See also&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources are a key part of MTA. A resource is essentially a folder or zip file that contains a collection of files, plus a meta file that describes to the server how the resource should be loaded and what files it does contain. A resource can be seen as being partly equivalent to a program running in an operating system - it can be started and stopped, and multiple resources can run at once.&lt;br /&gt;
&lt;br /&gt;
Everything that has to do with scripting happens in resources, what a resource does defines if it is a gamemode, a map or anything else. MTA comes with resources that you can optionally use in your gamemodes, such as maplimits to keep playings within a playing area or deathpickups to create weapon pickups.&lt;br /&gt;
{{tip|Your first step to begin Lua scripting should be using an Lua editor. This makes scripting much easier. We recommend [http://www.sublimetext.com/ Sublime Text], [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] or [http://luaedit.sourceforge.net/ LuaEdit]. There is also an unofficial [[MTASE|MTA Script Editor]] (in work-in-progress state) that you can test out.}}&lt;br /&gt;
&lt;br /&gt;
==Creating a working script==&lt;br /&gt;
We will first learn how to make a basic script that lets the player walk around in the city, step by step.&lt;br /&gt;
===Where are all the scripts?===&lt;br /&gt;
Let's take a look at the script's file structure. Go to your MTA Server folder, and follow the path below:&lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/&lt;br /&gt;
&lt;br /&gt;
You will see a lot of .zip files, which are the packaged sample scripts shipped with MTA. Each file is a &amp;quot;resource&amp;quot;, and they will all be unzipped and loaded by the server when it starts. To create your own resource, simply make a folder with your preferred name. We'll use &amp;quot;myserver&amp;quot; for this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now you should be under this directory: &lt;br /&gt;
&lt;br /&gt;
	server/mods/deathmatch/resources/myserver/&lt;br /&gt;
&lt;br /&gt;
===Identifying your resource===&lt;br /&gt;
In order to let the server know what's in the resource, a ''meta.xml'' file must be created to list the resource's content. It must be located in the resource's root directory, which is the &amp;quot;myserver&amp;quot; folder in our case. So create a text file and name it &amp;quot;meta.xml&amp;quot;, and open it with notepad.&lt;br /&gt;
&lt;br /&gt;
Enter the following codes in the ''meta.xml'' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
     &amp;lt;info author=&amp;quot;YourName&amp;quot; type=&amp;quot;gamemode&amp;quot; name=&amp;quot;My Server&amp;quot; description=&amp;quot;My first MTA server&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;script src=&amp;quot;script.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the ''&amp;lt;info /&amp;gt;'' tag, there's a &amp;quot;type&amp;quot; field which indicates that the resource is a ''gamemode'' instead of a regular include or a ''map'', which will be explained later. A gamemode is what you need to make a stand-alone server. &lt;br /&gt;
&lt;br /&gt;
The ''&amp;lt;script /&amp;gt;'' tag indicates the script files contained in the resource, which we will create next.&lt;br /&gt;
===Creating a simple script===&lt;br /&gt;
Note that in the ''&amp;lt;script /&amp;gt;'' tag above, the .lua file is not under another directory. Therefore we'll create the file in the same folder as meta.xml. Now you can copy and paste the following code into script.lua:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10&lt;br /&gt;
function joinHandler()&lt;br /&gt;
	spawnPlayer(source, spawnX, spawnY, spawnZ)&lt;br /&gt;
	fadeCamera(source, true)&lt;br /&gt;
	setCameraTarget(source, source)&lt;br /&gt;
	outputChatBox(&amp;quot;Welcome to My Server&amp;quot;, source)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, getRootElement(), joinHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will spawn you at the coordinate (x, y, z) specified above, when you join the game. Note that the ''fadeCamera'' function must be used or the screen will be black. Also, in releases after DP2, you need to set the camera target (otherwise all the player will see is blue sky).&lt;br /&gt;
&lt;br /&gt;
The '''source''' variable indicates who triggered the event. Since a player has joined when the code is triggered, you use this variable to look which has joined. So it'll spawn that player instead of everyone or a random person.&lt;br /&gt;
&lt;br /&gt;
If we have a closer look on [[addEventHandler]], you can see 3 things: 'onPlayerJoin', which indicates when it's triggered. getRootElement(), which shows by what/who it can be triggered. (getRootElement() is everything/everyone) And joinHandler, which indicates the function that has to be triggered after the event is triggered. Other details will be explained later in another example, now let's just run the server and try it out!&lt;br /&gt;
&lt;br /&gt;
===Running the script===&lt;br /&gt;
To get the server started, simply run the executable under the server/ directory. A list of server stats will be shown first; note the port number, which you'll need when joining the game. Then the server loads all the resources under the mods/deathmatch/resources/ directory, and then &amp;quot;ready to accept connections!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Before you connect to the server, you must run the gamemode. Type &amp;quot;start myserver&amp;quot; and press Enter. The server will start the gamemode you just created, and will also show any errors and warnings from this point on. Now you can start the MTA client, and &amp;quot;Quick Connect&amp;quot; using the IP address of your server and the port number you saw earlier. If all goes well, after a few seconds your character will be walking on the streets of Los Santos.&lt;br /&gt;
&lt;br /&gt;
Next we'll add a command to your script that players can use to spawn a vehicle beside their position. You may skip it and check out more advanced scripting with the [[Map manager|Map Manager]], which continues this tutorial. Another branch from this tutorial is [[Introduction to Scripting GUI]], you may follow it to see how Graphical User Interface in MTA is drawn and scripted.&lt;br /&gt;
&lt;br /&gt;
==Creating a simple command==&lt;br /&gt;
Let's go back to the content of the ''script.lua'' file. As mentioned above, we want to provide a command to create a vehicle beside your current position in the game. Firstly we need to create a function we want to call and a command handler that creates the command the player will be able to enter in the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function the command handler calls, with the arguments: thePlayer, command, vehicleModel&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
   -- create a vehicle and stuff&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- create a command handler&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Note: Function names are clickable in code examples on the wiki and linked to the functions' documentation.''&lt;br /&gt;
&lt;br /&gt;
====About command handlers====&lt;br /&gt;
The first argument of [[addCommandHandler]] is the name of the command the player will be able to enter, the second argument is the function this will call, in this case ''createVehicleForPlayer''.&lt;br /&gt;
&lt;br /&gt;
If you have already experience in scripting, you will know that you call a function like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(argument1, argument2, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
functionName(thePlayer, commandName, argument3, ..)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If we have a closer look on the lower example above, we can see argument1 is thePlayer and argument2 the commandName. thePlayer is simply the one who typed the command, so whatever you call it, the variable will contain the player who activated the command. commandName is simply the command they typed. So if they typed &amp;quot;/greet&amp;quot;, this argument will contain &amp;quot;greet&amp;quot;. Argument 3 is something extra the player typed, you'll learn it a little bit further in the tutorial. Never forget that the first 2 arguments are standard arguments, but you can name them to anything you want.&lt;br /&gt;
&lt;br /&gt;
We called the [[addCommandHandler]] function this way already and since ''createVehicleForPlayer'' is a function too, it can be called that way as well. But we are using a command handler for that, which calls it in a similiar manner, internally.&lt;br /&gt;
&lt;br /&gt;
For example: Someone types &amp;quot;createvehicle 468&amp;quot; ingame in the console to spawn a Sanchez, the command handler calls the createVehicleForPlayer function, as '''if''' we would have this line of code in the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
createVehicleForPlayer(thePlayer,&amp;quot;createvehicle&amp;quot;,&amp;quot;468&amp;quot;) -- thePlayer is the player element of the player who entered the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
As we can see, it provides several parameters: the player who called the command, the command he entered and whatever text he had after that, in this case &amp;quot;468&amp;quot; as vehicle id for the Sanchez. The first two parameters are the same with all command handlers, which you can read on the [[addEventHandler]] page. For this fact, you always have to define at least those two parameters to use any after that (for example to process text that was entered after the command, like in our example the vehicle model id).&lt;br /&gt;
&lt;br /&gt;
''Note: You have to add the command handler AFTER you defined the handler function, else it can't find it. The order of execution matters.''&lt;br /&gt;
&lt;br /&gt;
====Writing the function====&lt;br /&gt;
In order to fill the function we created, we need to think about what we have to do:&lt;br /&gt;
* Get the players position, so we know where to spawn the vehicle (we want it to appear right beside the player)&lt;br /&gt;
* Calculate the position we want to spawn the vehicle at (we don't want it to appear in the player)&lt;br /&gt;
* Spawn the vehicle&lt;br /&gt;
* Check if it has been spawned successfully, or output a message&lt;br /&gt;
&lt;br /&gt;
In order to achieve our goals, we have to use several functions. To find function we need to use, we should visit the [[Scripting Functions|Server Functions List]]. First we need a function to get the players position. Since players are Elements, we first jump to the '''Element functions''' where we find the [[getElementPosition]] function. By clicking on the function name in the list, you get to the function description. There we can see the syntax, what it returns and usually an example. The syntax shows us what arguments we can or have to submit.&lt;br /&gt;
&lt;br /&gt;
For [[getElementPosition]], the syntax is:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getElementPosition ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three ''float'' in front of the function name are the return type. In this case it means the function returns three floating point numbers. (x, y and z) Within the parentheses, you can see what arguments you have to submit. In this case only the element whose position you want to get, which is the player in our example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	-- get the position and put it in the x,y,z variables&lt;br /&gt;
	-- (local means, the variables only exist in the current scope, in this case, the function)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we want to ensure that the vehicle won't spawn directly in the player, so we add a few units to the ''x'' variable, which will make it spawn east from the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need another function, one to spawn a vehicle. We once again search for it on the [[Scripting Functions|Server Functions List]], this time - since we are talking about vehicles - in the '''Vehicle functions''' section, where we will choose [[createVehicle]]. In this function's syntax, we only have one return type (which is more common), a vehicle element that points to the vehicle we just created. Also, we see that some arguments are enclosed within [ ] which means that those are optional.&lt;br /&gt;
&lt;br /&gt;
We already have all arguments we need for [[createVehicle]] in our function: The position we just calculated in the ''x,y,z'' variables and the model id that we provided through the command (&amp;quot;createvehicle 468&amp;quot;) and can access in the function as ''vehicleModel'' variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	-- create the vehicle and store the returned vehicle element in the ''createdVehicle'' variable&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course this code can be improved in many ways, but at least we want to add a check whether the vehicle was created successfully or not. As we can read on the [[createVehicle]] page under '''Returns''', the function returns ''false'' when it was unable to create the vehicle. Thus, we check the value of the ''createVehicle'' variable.&lt;br /&gt;
&lt;br /&gt;
Now we have our complete script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleForPlayer(thePlayer, command, vehicleModel)&lt;br /&gt;
	local x,y,z = getElementPosition(thePlayer) -- get the position of the player&lt;br /&gt;
	x = x + 5 -- add 5 units to the x position&lt;br /&gt;
	local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)&lt;br /&gt;
	-- check if the return value was ''false''&lt;br /&gt;
	if (createdVehicle == false) then&lt;br /&gt;
		-- if so, output a message to the chatbox, but only to this player.&lt;br /&gt;
		outputChatBox(&amp;quot;Failed to create vehicle.&amp;quot;,thePlayer)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;createvehicle&amp;quot;, createVehicleForPlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, we introduced another function with [[outputChatBox]]. By now, you should be able to explore the function's documentation page yourself. For more advanced scripting, please check out the [[Map manager|Map Manager]].&lt;br /&gt;
&lt;br /&gt;
==What you need to know==&lt;br /&gt;
You already read some things about resources, command handlers and finding functions in the documentation in the first paragraph, but there is much more to learn. This section will give you a rather short overview over some of these things, while linking to related pages if possible.&lt;br /&gt;
===Clientside and Serverside scripts===&lt;br /&gt;
You may have already noticed these or similiar terms (Server/Client) somewhere on this wiki, mostly in conjunction with functions. MTA not only supports scripts that run on the server and provide commands (like the one we wrote above) or other features, but also scripts that run on the MTA client the players use to connect to the server. The reason for this is, that some features MTA provides have to be clientside (like a GUI - Graphical User Interface), others should be because they work better and still others are better off to be serverside or just don't work clientside.&lt;br /&gt;
&lt;br /&gt;
Most scripts you will make (gamemodes, maps) will probably be serverside, like the one we wrote in the first section. If you run into something that can't be solved serverside, you will probably have to make it clientside. For a clientside script for example, you would create a ordinary script file (for example called ''client.lua'') and specify it in the meta.xml, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The ''type'' attribute defaults to 'server', so you only need to specify it for clientside scripts. When you do this, the clientside script will be downloaded to the player's computer once he connects to the server. Read more about [[Client side scripts]].&lt;br /&gt;
&lt;br /&gt;
===More complex resources===&lt;br /&gt;
The previous section showed briefly how to add clientside scripts to the resource, but there is also much more possible. As mentioned at the very top of this page, resources can be pretty much everything. Their purpose is defined by what they do. Let's have some theoretical resources, by looking at the files it contains, the ''meta.xml'' and what they might do:&lt;br /&gt;
&lt;br /&gt;
====First example - A utility script====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/admin_commands&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/commands.lua&lt;br /&gt;
	/client.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;admin commands&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;commands.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;client.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''commands.lua'' provides some admin commands, like banning a player, muting or something else that can be used to admin the server&lt;br /&gt;
* The ''client.lua'' provides a GUI to be able to perform the mentioned actions easily&lt;br /&gt;
&lt;br /&gt;
This example might be running all the time (maybe even auto-started when the server starts) as it's useful during the whole gaming experience and also wont interfere with the gameplay, unless an admin decides to take some action of course.&lt;br /&gt;
&lt;br /&gt;
====Second example - A gamemode====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/counterstrike&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/counterstrike.lua&lt;br /&gt;
	/buymenu.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike remake&amp;quot; type=&amp;quot;gamemode&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;counterstrike.lua&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;buymenu.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''counterstrike.lua'' contains similiar to the following features:&lt;br /&gt;
** Let players choose their team and spawn them&lt;br /&gt;
** Provide them with weapons, targets and instructions (maybe read from a Map, see below)&lt;br /&gt;
** Define the game's rules, e.g. when does the round end, what happens when a player dies&lt;br /&gt;
** .. and maybe some more&lt;br /&gt;
* The ''buymenu.lua'' is a clientside script and creates a menu to buy weapons&lt;br /&gt;
&lt;br /&gt;
This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The ''type'' attribute indicates that this example works with the [[Map manager]], yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides.&lt;br /&gt;
&lt;br /&gt;
This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example.&lt;br /&gt;
&lt;br /&gt;
====Third example - A Map====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
/cs-airport&lt;br /&gt;
	/meta.xml&lt;br /&gt;
	/airport.map&lt;br /&gt;
	/airport.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;meta&amp;gt;&lt;br /&gt;
	&amp;lt;info author=&amp;quot;Someguy&amp;quot; description=&amp;quot;Counterstrike airport map&amp;quot; type=&amp;quot;map&amp;quot; gamemodes=&amp;quot;counterstrike&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;map src=&amp;quot;airport.map&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;script src=&amp;quot;airport.lua&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The ''airport.map'' in a XML file that provides information about the map to the gamemode, these may include:&lt;br /&gt;
** Where the players should spawn, with what weapons, what teams there are&lt;br /&gt;
** What the targets are&lt;br /&gt;
** Weather, World Time, Timelimit&lt;br /&gt;
** Provide vehicles&lt;br /&gt;
* The ''airport.lua'' might contain map-specific features, that may include:&lt;br /&gt;
** Opening some door/make something explode when something specific happens&lt;br /&gt;
** Create or move some custom objects, or manipulate objects that are created through the .map file&lt;br /&gt;
** .. anything else map-specific you can think of&lt;br /&gt;
&lt;br /&gt;
As you can see, the ''type'' attribute changed to 'map', telling the [[Map manager]] that this resource is a map, while the ''gamemodes'' attribute tells it for which gamemodes this map is valid, in this case the gamemode from the above example.&lt;br /&gt;
What may come as a surprise is that there is also a script in the Map resource. Of course this is not necessarily needed in a map, but opens a wide range of possibilities for map makers to create their own world within the rules of the gamemode they create it for.&lt;br /&gt;
&lt;br /&gt;
The ''airport.map'' file might look similiar to this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;map mode=&amp;quot;deathmatch&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;terrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2332.23&amp;quot; posY=&amp;quot;-12232.33&amp;quot; posZ=&amp;quot;4.42223&amp;quot; skins=&amp;quot;23-40&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/terrorists&amp;gt;&lt;br /&gt;
	&amp;lt;counterterrorists&amp;gt;&lt;br /&gt;
		&amp;lt;spawnpoint posX=&amp;quot;2334.23443&amp;quot; posY=&amp;quot;-12300.233&amp;quot; posZ=&amp;quot;10.2344&amp;quot; skins=&amp;quot;40-50&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/counterterrorists&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;bomb posX=&amp;quot;23342.23&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;602&amp;quot; /&amp;gt;	&lt;br /&gt;
	&amp;lt;vehicle posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; model=&amp;quot;603&amp;quot; /&amp;gt;	&lt;br /&gt;
&amp;lt;/map&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a gamemode is started with a map, the map resources is automatically started by the mapmanager and the information it contains can be read by the gamemode resource. When the map changes, the current map resource is stopped and the next map resource is started. For a more in-depth explanation and examples of how map resources are utilized in the main script, please visit the [[Writing Gamemodes]] page.&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Events are the way MTA tells scripts about things that happen. For example when a player dies, the [[onPlayerWasted]] event is triggered. In order to perform any actions when a player dies, you have to prepare yourself similiar to adding a command handler, as shown in [[#Writing_the_script|the first chapter]].&lt;br /&gt;
&lt;br /&gt;
This example will output a message with the name of the player who died:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDied(totalAmmo, killer, killerWeapon, bodypart)&lt;br /&gt;
	outputChatBox(getPlayerName(source)..&amp;quot; died!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;,getRootElement(),playerDied)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of showing what arguments are needed, the documentation page for Events shows what parameters are passed to the handler function, similiar to the way a [[#About_command_handlers|command handler]] does, just that it is different from event to event. Another important point is the ''source'' variable, that exists in handler functions. It doesn't have to be added to the parameter list of the function, but it still exists. It has a different value from event to event, for player events (as in the example above) it is the player element. As another example, you can take a look at the basic spawning player script in the first section to get an idea how ''source'' is used.&lt;br /&gt;
&lt;br /&gt;
==Where to go from here==&lt;br /&gt;
You should now be familiar with the most basic aspects of MTA scripting and also a bit with the documentation. The [[Main Page]] provides you with links to more information, Tutorials and References that allow a deeper look into the topics you desire to learn about.&lt;br /&gt;
{{note|From here we recommend reading the [[debugging]] tutorial. Good debugging skills are an absolute necessity when you are making scripts. We also recommend you to use the [[predefined variables list]] to help you with certain tasks and make scripting easier and faster.}}&lt;br /&gt;
'''See also:'''&lt;br /&gt;
* [[Advanced Topics]]&lt;br /&gt;
* [[OOP_Introduction|OOP Scripting Introduction]]&lt;br /&gt;
[[es:Introducción a la Programación]]&lt;br /&gt;
[[it:Introduzione allo scripting]]&lt;br /&gt;
[[nl:Scripting_introductie]]&lt;br /&gt;
[[pt-br:Introdução ao Scripting]]&lt;br /&gt;
[[ru:Scripting Introduction]]&lt;br /&gt;
[[ar:مقدمه_في_البرمجه]]&lt;br /&gt;
[[zh-cn:脚本编写介绍]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Changelogs&amp;diff=41209</id>
		<title>Template:PT-BR/Changelogs</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Changelogs&amp;diff=41209"/>
		<updated>2014-08-06T15:07:53Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Added 1.4.0 entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| cellpadding=&amp;quot;4&amp;quot; style=&amp;quot;border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #FFF; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=140 style=&amp;quot;background-color: #D6DCFF; border-style: solid; border-width: 1px; border-color: #FFF; color:#00000;&amp;quot;| Versão do MTA:SA&lt;br /&gt;
!width=400 style=&amp;quot;white-space: nowrap; background-color: #D6DCFF; border-style: solid; border-width: 1px; border-color: #FFF;&amp;quot;| Novidades&lt;br /&gt;
{{Changelogsrow|1.0|1.0.0 &amp;amp;bull; 1.0.1 &amp;amp;bull; 1.0.2 &amp;amp;bull; 1.0.3 &amp;amp;bull; 1.0.4}}&lt;br /&gt;
{{Changelogsrow|1.1|1.1.0 &amp;amp;bull; 1.1.1}}&lt;br /&gt;
{{Changelogsrow|1.2|1.2.0}}&lt;br /&gt;
{{Changelogsrow|1.3|[[PT-BR/Novidades na versão 1.3|1.3.0]] &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.1|1.3.1]] &amp;amp;bull; 1.3.2 &amp;amp;bull; 1.3.3 &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.4|1.3.4]] &amp;amp;bull; [[PT-BR/Novidades na versão 1.3.5|1.3.5]]}}&lt;br /&gt;
{{Changelogsrow|1.4|[[PT-BR/Novidades_na_versão_1.4.0|1.4.0]]}}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41205</id>
		<title>PT-BR/Novidades na versão 1.4.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41205"/>
		<updated>2014-08-06T15:06:39Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/Changelogs}}&lt;br /&gt;
{{Atenção|Este artigo necessita de revisão, pois está '''incompleto'''.|1}}&lt;br /&gt;
&lt;br /&gt;
== Principais Mudanças ==&lt;br /&gt;
* Tradução para os menus do MTA&lt;br /&gt;
* Classes [[OOP]]&lt;br /&gt;
* [[Matrix|Matrizes]] e [[Vector|Vetores]]&lt;br /&gt;
* Melhorou muito a sincronização de trens&lt;br /&gt;
* As funções relacionadas a áudio agora são compatíveis com os elementos do tipo jogador&lt;br /&gt;
&lt;br /&gt;
[[en:Changes_in_1.4.0]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New functions ===&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
* Added [[createEffect]]&lt;br /&gt;
* Added [[setEffectSpeed]]&lt;br /&gt;
* Added [[getEffectSpeed]]&lt;br /&gt;
* Added [[setEffectDensity]]&lt;br /&gt;
* Added [[getEffectDensity]]&lt;br /&gt;
* Added [[getLocalization]]&lt;br /&gt;
* Added [[isChatVisible]]&lt;br /&gt;
* Added [[downloadFile]]&lt;br /&gt;
* Added [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[isBan]]&lt;br /&gt;
* Added [[setBanAdmin]]&lt;br /&gt;
* Added [[setBanReason]]&lt;br /&gt;
* Added [[setUnbanTime]]&lt;br /&gt;
* Added [[getAccountsBySerial]]&lt;br /&gt;
* Added [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* Added additional optional parameter bInstant to setPlayerMoney to instantly set the money without counting up/down&lt;br /&gt;
* Fixed toJSON/fromJSON not handling binary data properly&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New Events ===&lt;br /&gt;
&lt;br /&gt;
==== Client ====&lt;br /&gt;
* Added [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting: Changes, Bugfixes and Additions ===&lt;br /&gt;
* Fixed getResourceConfig() not working on foreign resources&lt;br /&gt;
* Fixed the Brown Streak Carriage (ID: 570)&lt;br /&gt;
* Changed attachTrailerToVehicle to support trains&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
=== Client: Additions ===&lt;br /&gt;
* Distinguish between left and right Shift, Ctrl and Alt presses.&lt;br /&gt;
* Added SettingHUDMatchAspectRatio, SettingAspectRatio to dxGetStatus.&lt;br /&gt;
* Added support for the use of [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] audio files in playSound and playSound3D.&lt;br /&gt;
&lt;br /&gt;
=== Client: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed the money &amp;quot;counts down&amp;quot; GTA-Style when you change a server.&lt;br /&gt;
* Fixed peds being invulnerable to gun fire when doing a drive by.&lt;br /&gt;
* Fixed onClientPlayerDamage not triggering for spray can.&lt;br /&gt;
* Satchels should now be removed on [[resetMapInfo]].&lt;br /&gt;
* Fixed getPedMoveState returns false when moving in crouch state&lt;br /&gt;
* Fixed guiScrollPaneGetVerticalScrollPosition returning strange and stepped values.&lt;br /&gt;
* Fixed setPedCameraRotation not working.&lt;br /&gt;
* Fixed peds continuing to fire their weapons after running out of ammo.&lt;br /&gt;
* Fixed radio titles not always showing.&lt;br /&gt;
* Fixed radio music skipping when browsing between different channels.&lt;br /&gt;
* Fixed user track skip (F5) being disabled.&lt;br /&gt;
* Fixed vehicles falling through the map.&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== Server: Additions ===&lt;br /&gt;
* [[setElementDimension]] should now apply to children&lt;br /&gt;
* More descriptive module error messages&lt;br /&gt;
* Commands: unloadmodule and reloadmodule&lt;br /&gt;
* Added server side custom weapons.&lt;br /&gt;
&lt;br /&gt;
=== Server: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed 128 character limit in [[setAccountData]]&lt;br /&gt;
* Wildcard bans should now be checked properly on connect&lt;br /&gt;
* Fixed Team members not being sent to clients if set in [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Extra information ==&lt;br /&gt;
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and Google Code repositories:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41203</id>
		<title>PT-BR/Novidades na versão 1.4.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/Novidades_na_vers%C3%A3o_1.4.0&amp;diff=41203"/>
		<updated>2014-08-06T15:05:09Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: Created page with &amp;quot;{{PT-BR/Changelogs}} {{Atenção|Este artigo necessita de revisão, pois está '''incompleto'''.|1}}  == Principais Mudanças == * Tradução para os menus do MTA * Classes ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/Changelogs}}&lt;br /&gt;
{{Atenção|Este artigo necessita de revisão, pois está '''incompleto'''.|1}}&lt;br /&gt;
&lt;br /&gt;
== Principais Mudanças ==&lt;br /&gt;
* Tradução para os menus do MTA&lt;br /&gt;
* Classes [[OOP]]&lt;br /&gt;
* [[Matrix|Matrizes]] e [[Vector|Vetores]]&lt;br /&gt;
* Melhorou muito a sincronização de trens&lt;br /&gt;
* As funções relacionadas a áudio agora são compatíveis com os elementos do tipo jogador&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New functions ===&lt;br /&gt;
&lt;br /&gt;
====Client====&lt;br /&gt;
* Added [[createEffect]]&lt;br /&gt;
* Added [[setEffectSpeed]]&lt;br /&gt;
* Added [[getEffectSpeed]]&lt;br /&gt;
* Added [[setEffectDensity]]&lt;br /&gt;
* Added [[getEffectDensity]]&lt;br /&gt;
* Added [[getLocalization]]&lt;br /&gt;
* Added [[isChatVisible]]&lt;br /&gt;
* Added [[downloadFile]]&lt;br /&gt;
* Added [[isTrainChainEngine]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[isBan]]&lt;br /&gt;
* Added [[setBanAdmin]]&lt;br /&gt;
* Added [[setBanReason]]&lt;br /&gt;
* Added [[setUnbanTime]]&lt;br /&gt;
* Added [[getAccountsBySerial]]&lt;br /&gt;
* Added [[getAccountSerial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Shared (''Client &amp;amp; Server side'') ====&lt;br /&gt;
* Added additional optional parameter bInstant to setPlayerMoney to instantly set the money without counting up/down&lt;br /&gt;
* Fixed toJSON/fromJSON not handling binary data properly&lt;br /&gt;
&lt;br /&gt;
=== Scripting: New Events ===&lt;br /&gt;
&lt;br /&gt;
==== Client ====&lt;br /&gt;
* Added [[onClientFileDownloadComplete]]&lt;br /&gt;
&lt;br /&gt;
==== Server ====&lt;br /&gt;
* Added [[onWeaponFire]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting: Changes, Bugfixes and Additions ===&lt;br /&gt;
* Fixed getResourceConfig() not working on foreign resources&lt;br /&gt;
* Fixed the Brown Streak Carriage (ID: 570)&lt;br /&gt;
* Changed attachTrailerToVehicle to support trains&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
=== Client: Additions ===&lt;br /&gt;
* Distinguish between left and right Shift, Ctrl and Alt presses.&lt;br /&gt;
* Added SettingHUDMatchAspectRatio, SettingAspectRatio to dxGetStatus.&lt;br /&gt;
* Added support for the use of [https://en.wikipedia.org/wiki/Opus_codec Opus Codec] audio files in playSound and playSound3D.&lt;br /&gt;
&lt;br /&gt;
=== Client: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed the money &amp;quot;counts down&amp;quot; GTA-Style when you change a server.&lt;br /&gt;
* Fixed peds being invulnerable to gun fire when doing a drive by.&lt;br /&gt;
* Fixed onClientPlayerDamage not triggering for spray can.&lt;br /&gt;
* Satchels should now be removed on [[resetMapInfo]].&lt;br /&gt;
* Fixed getPedMoveState returns false when moving in crouch state&lt;br /&gt;
* Fixed guiScrollPaneGetVerticalScrollPosition returning strange and stepped values.&lt;br /&gt;
* Fixed setPedCameraRotation not working.&lt;br /&gt;
* Fixed peds continuing to fire their weapons after running out of ammo.&lt;br /&gt;
* Fixed radio titles not always showing.&lt;br /&gt;
* Fixed radio music skipping when browsing between different channels.&lt;br /&gt;
* Fixed user track skip (F5) being disabled.&lt;br /&gt;
* Fixed vehicles falling through the map.&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
=== Server: Additions ===&lt;br /&gt;
* [[setElementDimension]] should now apply to children&lt;br /&gt;
* More descriptive module error messages&lt;br /&gt;
* Commands: unloadmodule and reloadmodule&lt;br /&gt;
* Added server side custom weapons.&lt;br /&gt;
&lt;br /&gt;
=== Server: Bugfixes &amp;amp; Changes ===&lt;br /&gt;
* Fixed 128 character limit in [[setAccountData]]&lt;br /&gt;
* Wildcard bans should now be checked properly on connect&lt;br /&gt;
* Fixed Team members not being sent to clients if set in [[onResourceStart]].&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Editor ==&lt;br /&gt;
* None yet&lt;br /&gt;
&lt;br /&gt;
== Extra information ==&lt;br /&gt;
''More detailed information available on [https://bugs.multitheftauto.com/changelog_page.php Bug tracker Changelog] and Google Code repositories:&lt;br /&gt;
:* [https://code.google.com/p/mtasa-blue/source/list MTA: SA Blue]&lt;br /&gt;
:* [https://code.google.com/p/mtasa-resources/source/list MTA: SA Official Resources]&lt;br /&gt;
&lt;br /&gt;
[[Category:Changelog]]&lt;br /&gt;
[[Category:Incomplete]]&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=41198</id>
		<title>Página Inicial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=P%C3%A1gina_Inicial&amp;diff=41198"/>
		<updated>2014-08-06T14:59:19Z</updated>

		<summary type="html">&lt;p&gt;Cristiano Cardoso: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding: 5px; height: 130px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px]]'''Bem vindo ao Wiki do Multi Theft Auto.''' Aqui você encontra tudo sobre o uso desta modificação.&lt;br /&gt;
&lt;br /&gt;
Há muitas [[How you can help|coisas em que você pode nos ajudar]] para melhorar este programa, como criar um mapa, um modo de jogo, documentar funções e eventos, escrever códigos úteis para outros usuários, fazer tutoriais, reportar bugs que encontrar ou somente jogar a vontade!&lt;br /&gt;
&lt;br /&gt;
Se você tem alguma dúvida a respeito do Multi Theft Auto, não se esqueça de perguntar à comunidade em nossos [http://forum.mtasa.com/ fóruns].&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Jogar&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Baixe o Multi Theft Auto {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Onde_adquirir_o_GTASA|Onde adquirir o GTASA]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Cliente|Manual do usuário]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Novidades_na_versão_{{Current Version|full}}|Novidades da última versão ]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Soluções_de_Problemas_-_FAQ|Solução de problemas]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Migrando_do_MTA:Race_ao_MTA:SA_1.3|Migrando do MTA:Race para o MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Manual_do_Servidor|Manual do servidor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Recursos:Map_Manager|Gerenciador de mapas (''Map Manager'')]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Editor de mapas&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor|Manual do editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Resource:Editor-EDF|Ficheiro de definições do editor (EDF)]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor-Plugins|Extensões para o editor]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Resource:Editor#FAQ|Perguntas frequentes (FAQ)]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Banco de dados&amp;lt;/h3&amp;gt;&lt;br /&gt;
Aqui tem tudo relacionado às vantagens que Lua tem a oferecer ao MTA e seus recursos.&lt;br /&gt;
* [[Image:iUS.png|Em Inglês|20px]] [[:Category:Resource|Catálogo de Recursos]] - Você deve aprender com eles para fazer scripts bons&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Scripts_do_Cliente|Scripts do Cliente]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [[PT-BR/Módulos|Módulos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Desenvolvimento do Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Últimas compilações]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA|Compilando o MTASA no Windows]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Mac_OS_X|Compilando o MTASA no Mac OS X]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Compilando_o_MTASA_no_Linux|Compilando o MTASA no Linux]]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Guia_do_Desenvolvedor|Guia do Desenvolvedor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://code.google.com/p/mtasa-blue Código fonte no Google Code]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]]  [[PT-BR/Roadmap|Roteiro para versões futuras]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]]  [http://bugs.mtasa.com/ Central de bugs]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Como você pode nos ajudar&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Documentar funções ou eventos&lt;br /&gt;
* Criar exemplos funcionais e eficientes de funções e eventos&lt;br /&gt;
* Examinar e corrigir as páginas&lt;br /&gt;
* Escrever tutoriais para ajudar novatos&lt;br /&gt;
* Ajudar a traduzir as páginas da Wiki para outras linguagens&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Comunidade&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.multitheftauto.com/ Fóruns]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [irc://irc.multitheftauto.com/mta IRC]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://community.mtasa.com/ Comunidade]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://twitter.com/#!/MTAQA/ Twitter] &lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.youtube.com/user/MTAQA Youtube]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://plus.google.com/102014133442331779727/ Google]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introdução_ao_Scripting|Introdução a ''scripting'']]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Introducao_ao_GUI_scripting|Introdução a ''scripting'' de UI]]&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Depuração|Depuração]] - Encontre erros em seu Script&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Recursos|Introdução a recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/Acesso web via recursos|Acesso web via recursos]] - Abra servidores web através de recursos&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[:Category:PT-BR/Recursos|Lista de recursos]]&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/Meta.xml|Meta.xml]] - Todo recurso possui um arquivo meta descrevendo a si próprio&lt;br /&gt;
** [[File:iBR.png|Em Português|20px]] [[PT-BR/ACL|Lista de controle de acesso (ACL)]] - Componente vital para recursos complexos&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [[PT-BR/Composição_de_Gamemodes|Composição de modos de jogo]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[PT-BR/Funções_Úteis|Funções Úteis]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Links dos fóruns&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iBR.png|Em Português|20px]] [http://forum.mtasa.com/viewforum.php?f=152 Secção do fórum para dúvidas sobre ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewforum.php?f=148 Guias de ''scripting'']&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Wiki ''offline'']&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Manuais sobre Lua&amp;lt;/h3&amp;gt;&lt;br /&gt;
Página muito útil para ajuda-lo a entender o funcionamento do Lua&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/portugues.html Introdução à linguagem]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html Manual básico]&lt;br /&gt;
* [[Image:iBR.png|Em Português|20px]] [http://www.lua.org/manual/5.1/pt/ Manual de referência]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [http://lua-users.org/wiki/TutorialDirectory Outra wiki, somente de Lua]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Referência&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Functions|Funções do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Client Scripting Events|Eventos do cliente]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Functions|Funções do servidor]]&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[Server Scripting Events|Eventos do servidor]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[File:iUS.png|Em Inglês|20px]] [[MTA Classes|Classes do Multi Theft Auto]] - Informações detalhadas sobre todas as classes do MTA&lt;br /&gt;
** [[File:iUS.png|Em Inglês|20px]] [[Element tree|Árvore dos elementos]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|Lista de IDs de objetos e texturas]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animações]]&lt;br /&gt;
*[[Character Skins|''Skins'' de pedestres]]&lt;br /&gt;
*[[PT-BR/Roupas_CJ|Roupas do CJ]]&lt;br /&gt;
*[[Garage|Garagens]]&lt;br /&gt;
*[[Interior IDs|Interiores]]&lt;br /&gt;
*[[Material IDs|Materiais]]&lt;br /&gt;
*[[Projectiles|Projéteis]]&lt;br /&gt;
*[[Radar Blips|''Blips'']]&lt;br /&gt;
*[[Sounds|Efeitos sonoros]]&lt;br /&gt;
*[[Vehicle IDs|Veículos]]&lt;br /&gt;
*[[Vehicle Colors|Cores dos veículos]]&lt;br /&gt;
*[[Vehicle Upgrades|Acessórios dos veículos]]&lt;br /&gt;
*[[Vehicle variants|Variantes dos veículos]]&lt;br /&gt;
*[[Weapons|Armas]]&lt;br /&gt;
*[[Weather|Ambientação]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px dotted #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:pBR.png|32px]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Sobre a Tradução&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Tradutores:&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=50642|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;RaceXtreme&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=59023|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;StanleySathler&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=55744|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;DNL291&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=62091|&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Ninguem&amp;lt;/span&amp;gt;]&lt;br /&gt;
** [http://forum.mtasa.com/memberlist.php?mode=viewprofile&amp;amp;u=63192|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;Anderl&amp;lt;/span&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
É importante que todos colaborem para que nossa página em português fique melhor a cada dia!&lt;br /&gt;
&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/]]&lt;br /&gt;
'''Multi Theft Auto''' é um projeto '''open source'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Sobre o Multi Theft Auto'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive|Arquivos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage|Eventos]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Desenvolvedores]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Baixe-o]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Solução de problemas]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Status da Wiki'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} artigos&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} páginas&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} usuários registrados&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|pt-br}}&lt;/div&gt;</summary>
		<author><name>Cristiano Cardoso</name></author>
	</entry>
</feed>