<?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=Lettify</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=Lettify"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Lettify"/>
	<updated>2026-04-12T17:28:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerLogin&amp;diff=82576</id>
		<title>OnPlayerLogin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerLogin&amp;diff=82576"/>
		<updated>2025-10-23T01:43:11Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event is triggered when a player logs into their account in-game.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account thePreviousAccount, account theCurrentAccount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''thePreviousAccount''': The [[account]] the player was logged into before.&lt;br /&gt;
*'''theCurrentAccount''': The [[account]] the player logged into just now.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the player [[element]] that just logged in.&lt;br /&gt;
&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is canceled the player will not be logged in.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example just outputs to the player console that a player in one account logged into an another account:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root,&lt;br /&gt;
  function()&lt;br /&gt;
    outputChatBox(getPlayerName(source)..&amp;quot; has logged in!&amp;quot;, root)&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example allows only hardcoded serials to access given accounts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
--  [ 'accountName' ] = 'playerSerial',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if Serial and Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
            outputChatBox( &amp;quot;Sorry, you're not allowed to access this account.&amp;quot;, source)&lt;br /&gt;
            cancelEvent( true )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;br /&gt;
&lt;br /&gt;
[[ru:onPlayerLogin]]&lt;br /&gt;
[[pt-br:onPlayerLogin]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82575</id>
		<title>PT-BR/OnPlayerLogin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82575"/>
		<updated>2025-10-23T01:42:36Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{PT-BR/Server event}}&lt;br /&gt;
Este evento é acionado quando um jogador se conecta em sua conta dentro do jogo.&lt;br /&gt;
&lt;br /&gt;
==Parâmetros==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account thePreviousAccount, account theCurrentAccount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''thePreviousAccount''': A [[account|conta]] que o jogador se conectou anteriormente.&lt;br /&gt;
*'''theCurrentAccount''': A [[account|conta]] que o jogador se conectou agora.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
O [[event system#Event source|source]] deste evento é o [[Elemento/Player|elemento jogador]] que se conectou em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Efeito do cancelamento==&lt;br /&gt;
Se este evento é [[cancelEvent|cancelado]], o jogador não se conectará em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Exemplo== &lt;br /&gt;
Este exemplo apenas exibe ao console do jogador que um jogador que estava conectado em uma conta, se conectou em outra:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root,&lt;br /&gt;
  function()&lt;br /&gt;
    outputChatBox(getPlayerName(source)..&amp;quot; has logged in!&amp;quot;, root)&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Este exemplo permite apenas que seriais inseridos manualmente consigam acessar as determinadas contas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
--  [ 'accountName' ] = 'playerSerial',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if Serial and Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
            outputChatBox( &amp;quot;Sorry, you're not allowed to access this account.&amp;quot;, source)&lt;br /&gt;
            cancelEvent( true )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;br /&gt;
&lt;br /&gt;
[[ru:onPlayerLogin]]&lt;br /&gt;
[[pt-br:onPlayerLogin]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82574</id>
		<title>PT-BR/OnPlayerLogin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82574"/>
		<updated>2025-10-23T01:32:33Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
Este evento é acionado quando um jogador se conecta em sua conta dentro do jogo.&lt;br /&gt;
&lt;br /&gt;
==Parâmetros==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account thePreviousAccount, account theCurrentAccount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''thePreviousAccount''': A [[account|conta]] que o jogador se conectou anteriormente.&lt;br /&gt;
*'''theCurrentAccount''': A [[account|conta]] que o jogador se conectou agora.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
O [[event system#Event source|source]] deste evento é o [[Elemento/Player|elemento jogador]] que se conectou em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Efeito do cancelamento==&lt;br /&gt;
Se este evento é [[cancelEvent|cancelado]], o jogador não se conectará em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Exemplo== &lt;br /&gt;
Este exemplo apenas exibe ao console do jogador que um jogador que estava conectado em uma conta, se conectou em outra:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root,&lt;br /&gt;
  function()&lt;br /&gt;
    outputChatBox(getPlayerName(source)..&amp;quot; has logged in!&amp;quot;, root)&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Este exemplo permite apenas que seriais inseridos manualmente consigam acessar as determinadas contas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
--  [ 'accountName' ] = 'playerSerial',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if Serial and Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
            outputChatBox( &amp;quot;Sorry, you're not allowed to access this account.&amp;quot;, source)&lt;br /&gt;
            cancelEvent( true )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;br /&gt;
&lt;br /&gt;
[[ru:onPlayerLogin]]&lt;br /&gt;
[[pt-br:onPlayerLogin]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82573</id>
		<title>PT-BR/OnPlayerLogin</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/OnPlayerLogin&amp;diff=82573"/>
		<updated>2025-10-23T01:31:50Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;{{Server event}} __NOTOC__  Este evento é acionado quando um jogador se conecta em sua conta dentro do jogo.  ==Parâmetros== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; account thePreviousAccount, account theCurrentAccount &amp;lt;/syntaxhighlight&amp;gt;   *'''thePreviousAccount''': A conta que o jogador se conectou anteriormente. *'''theCurrentAccount''': A conta que o jogador se conectou agora.  ==Source== O source deste evento é o Elemen...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Este evento é acionado quando um jogador se conecta em sua conta dentro do jogo.&lt;br /&gt;
&lt;br /&gt;
==Parâmetros==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
account thePreviousAccount, account theCurrentAccount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''thePreviousAccount''': A [[account|conta]] que o jogador se conectou anteriormente.&lt;br /&gt;
*'''theCurrentAccount''': A [[account|conta]] que o jogador se conectou agora.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
O [[event system#Event source|source]] deste evento é o [[Elemento/Player|elemento jogador]] que se conectou em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Efeito do cancelamento==&lt;br /&gt;
Se este evento é [[cancelEvent|cancelado]], o jogador não se conectará em sua conta.&lt;br /&gt;
&lt;br /&gt;
==Exemplo== &lt;br /&gt;
Este exemplo apenas exibe ao console do jogador que um jogador que estava conectado em uma conta, se conectou em outra:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerLogin&amp;quot;, root,&lt;br /&gt;
  function()&lt;br /&gt;
    outputChatBox(getPlayerName(source)..&amp;quot; has logged in!&amp;quot;, root)&lt;br /&gt;
  end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Este exemplo permite apenas que seriais inseridos manualmente consigam acessar as determinadas contas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Firewall = &lt;br /&gt;
{&lt;br /&gt;
--  [ 'accountName' ] = 'playerSerial',&lt;br /&gt;
    [ '3ash8' ] = '9C9F3B55D9D7BB7135FF274D3BF444E4',&lt;br /&gt;
    [ 'test5' ] = '1D6F76CF8D7193792D13789849498452',&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( 'onPlayerLogin', getRootElement ( ),&lt;br /&gt;
    function ( _, theCurrentAccount )&lt;br /&gt;
    local Serial = Firewall[getAccountName(theCurrentAccount)]&lt;br /&gt;
        if Serial and Serial ~= getPlayerSerial ( source ) then&lt;br /&gt;
            outputChatBox( &amp;quot;Sorry, you're not allowed to access this account.&amp;quot;, source)&lt;br /&gt;
            cancelEvent( true )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;br /&gt;
&lt;br /&gt;
[[ru:onPlayerLogin]]&lt;br /&gt;
[[pt-br:onPlayerLogin]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/MessageBox&amp;diff=82455</id>
		<title>Template:PT-BR/MessageBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/MessageBox&amp;diff=82455"/>
		<updated>2025-09-07T23:45:13Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Warning|This template is included in a lot of pages/articles. Test your changes when you edit this template!|true}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; style=&amp;quot;padding: 5px; padding-left: 12px; padding-right: 12px; border-radius: 10px; width: 60%; margin: 6px auto 2px auto; border: 1px solid #{{#if: {{{bordercolorhex|}}} | {{{bordercolorhex}}} | CCCCCC }}; background: transparent; border-left: 25px solid #{{#if: {{{bordercolorhex|}}} | {{{bordercolorhex}}} | CCCCCC }};&amp;quot;&lt;br /&gt;
|style=&amp;quot;width: 32px; vertical-align:top; {{#if: {{{image|}}} | | display: none; }}&amp;quot; rowspan=&amp;quot;2&amp;quot; | [[{{{image}}}|link=|{{#if: {{{imageSize|}}}|{{{imageSize}}}}}]]&lt;br /&gt;
|style=&amp;quot;{{#if: {{{image|}}} | padding-left: 10px; }}&amp;quot; |{{#if: {{{title|}}}|'''{{{title}}}'''}} {{#if: {{{message|}}}|{{{message}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot; style=&amp;quot;padding-left: 10px;&amp;quot;|{{#if: {{{subtext|}}}|&amp;lt;hr style=&amp;quot;background: #{{{bordercolorhex}}};&amp;quot;/&amp;gt;{{{subtext}}} }}&lt;br /&gt;
|}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Article message box'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{{MessageBox|&lt;br /&gt;
   bordercolorhex = FFADAD |&lt;br /&gt;
   bordertype = |&lt;br /&gt;
   bgcolorhex = F9F9F9 |&lt;br /&gt;
   image = File:Dialog-warning.png |&lt;br /&gt;
   imageSize = 50px| -- make it bigger&lt;br /&gt;
   title = Warninga: |&lt;br /&gt;
   message = Test TEXT 1 2 3 |&lt;br /&gt;
   subtext = More Text |&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:BR/Nota&amp;diff=82454</id>
		<title>Template:BR/Nota</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:BR/Nota&amp;diff=82454"/>
		<updated>2025-09-07T23:44:16Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;note-messagebox&amp;quot;&amp;gt;{{PT-BR/MessageBox|&lt;br /&gt;
   bordercolorhex = d5b5f5 |&lt;br /&gt;
   bgcolorhex = ccccff |&lt;br /&gt;
   bordertype = invalid |&lt;br /&gt;
   image = File:Post-it.png |&lt;br /&gt;
   imageSize = 32px|&lt;br /&gt;
   message = '''Nota:''' {{{1}}}&lt;br /&gt;
}}&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82445</id>
		<title>User:Lettify</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82445"/>
		<updated>2025-09-06T01:18:04Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#8000FF&amp;quot; subcaption=&amp;quot;KronoS Lettify&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
[[File:KronoSLY Logo.png|thumb|right]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Meu GitHub: https://github.com/Lettify ❤️&lt;br /&gt;
* Meu perfil do Fórum do MTA: [https://forum.mtasa.com/profile/71215-kronos-lettify/ KronoS Lettify]&amp;lt;br&amp;gt;&lt;br /&gt;
* Minhas [[Special:Contributions/Lettify|contribuições]]&lt;br /&gt;
* Meu Discord: @'''kronos.lettify'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[User:Lettify|Lettify]] ([[User talk:Lettify|talk]])&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82444</id>
		<title>User:Lettify</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82444"/>
		<updated>2025-09-06T01:17:04Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#8000FF&amp;quot; subcaption=&amp;quot;KronoS Lettify&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
[[File:KronoSLY Logo.png|thumb|right]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Meu GitHub: [https://github.com/Lettify] ❤️&lt;br /&gt;
* Meu perfil do Fórum do MTA: [https://forum.mtasa.com/profile/71215-kronos-lettify/ KronoS Lettify]&amp;lt;br&amp;gt;&lt;br /&gt;
* Minhas [[Special:Contributions/Lettify|contribuições]]&lt;br /&gt;
* Meu Discord: @'''kronos.lettify'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[User:Lettify|Lettify]] ([[User talk:Lettify|talk]])&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82443</id>
		<title>User:Lettify</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=82443"/>
		<updated>2025-09-06T01:15:59Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#8000FF&amp;quot; subcaption=&amp;quot;KronoS Lettify&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
[[File:KronoSLY Logo.png|thumb|right]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Meu perfil do Fórum do MTA: [https://forum.mtasa.com/profile/71215-kronos-lettify/ KronoS Lettify]&amp;lt;br&amp;gt;&lt;br /&gt;
* Minhas [[Special:Contributions/Lettify|contribuições]]&lt;br /&gt;
* Meu Discord: @'''kronos.lettify'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[User:Lettify|Lettify]] ([[User talk:Lettify|talk]])&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BR-PT/setElementPosition&amp;diff=82442</id>
		<title>BR-PT/setElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BR-PT/setElementPosition&amp;diff=82442"/>
		<updated>2025-09-06T00:02:05Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Lettify moved page BR-PT/setElementPosition to PT-BR/setElementPosition: Wrongly titled during creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PT-BR/setElementPosition]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82441</id>
		<title>PT-BR/setElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82441"/>
		<updated>2025-09-06T00:02:05Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Lettify moved page BR-PT/setElementPosition to PT-BR/setElementPosition: Wrongly titled during creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
Esta função define a posição de um elemento para as coordenadas especificadas.&lt;br /&gt;
{{BR/Warning|Não use essa função para ''spawnar'' um [[Elemento/Player|jogador]]. Isso vai causar problemas com outras funções, como [[warpPedIntoVehicle]]. Em vez disso, use [[spawnPlayer]].}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{BR/OOP||[[PT-BR/Elemento|elemento]]:setPosition|position|getElementPosition}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos Necessários=== &lt;br /&gt;
*'''theElement:''' Um [[PT-BR/Elemento|elemento]] válido para ser movido.&lt;br /&gt;
*'''x:''' A coordenada '''X''' de destino.&lt;br /&gt;
*'''y:''' A coordenada '''Y''' de destino.&lt;br /&gt;
*'''z:''' A coordenada '''Z''' de destino.&lt;br /&gt;
&lt;br /&gt;
===Argumentos Opcionais===&lt;br /&gt;
*'''warp:''' teletransporta o jogador, resetando qualquer animação que esteja rodando. Definindo esse argumento com ''false'', a animação permanecerá.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna ''true'' se foi executado com sucesso, caso contrário retorna ''false''.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo permite que os administradores teletransportem 5 jogadores aleatórios para si mesmos&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function randomPlayersToLocation(p)&lt;br /&gt;
    if not isPlayerStaff(p) then return end&lt;br /&gt;
&lt;br /&gt;
	local playersOnline = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local amount = #playersOnline&lt;br /&gt;
&lt;br /&gt;
	if amount == 0 then return end&lt;br /&gt;
&lt;br /&gt;
	for index = 1,(amount &amp;gt; 5 and 5 or amount) do&lt;br /&gt;
		local player = playersOnline[index]&lt;br /&gt;
		setElementPosition(player, getElementPosition(p))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;randomtp&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
addCommandHandler(&amp;quot;playershere&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
&lt;br /&gt;
-- Utilitário&lt;br /&gt;
local staffACLs = {&lt;br /&gt;
    aclGetGroup(&amp;quot;Admin&amp;quot;),&lt;br /&gt;
    aclGetGroup(&amp;quot;Moderator&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function isPlayerStaff(p)&lt;br /&gt;
	if isElement(p) and getElementType(p) == &amp;quot;player&amp;quot; and not isGuestAccount(getPlayerAccount(p)) then&lt;br /&gt;
		local object = getAccountName(getPlayerAccount(p))&lt;br /&gt;
&lt;br /&gt;
		for _, group in ipairs(staffACLs) do&lt;br /&gt;
			if isObjectInACLGroup(&amp;quot;user.&amp;quot; .. object, group) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se você quiser colocar um veículo ou jogador fora da água ou simular o comportamento de redefinição de posição caso CJ fique muito abaixo do solo, será necessário recuperar uma coordenada recomendada no solo para colocar o elemento. Dê uma olhada [https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&amp;amp;comment=1003198 nesse posto do Fórum do MTA] para os passos na direção certa.&lt;br /&gt;
&lt;br /&gt;
==Problemas==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|539|Alterar a posição do jogador quando ele/ela tiver um jetpack removerá o jetpack e o bug quando a skin for alterada}}&lt;br /&gt;
{{Issue|529|Jogador cai da bicicleta quando ela é teletransportada por setElementPosition}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setElementPosition]]&lt;br /&gt;
[[ru:setElementPosition]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=82440</id>
		<title>SetElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=82440"/>
		<updated>2025-09-06T00:00:12Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Index Portuguese translation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Shared function}}&lt;br /&gt;
This function sets the position of an element to the specified coordinates.&lt;br /&gt;
{{Warning|Do not use this function to spawn a [[player]]. It will cause problems with other functions like [[warpPedIntoVehicle]]. Use [[spawnPlayer]] instead.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setPosition|position|getElementPosition}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' A valid [[element]] to be moved.&lt;br /&gt;
*'''x:''' The x coordinate of the destination.&lt;br /&gt;
*'''y:''' The y coordinate of the destination.&lt;br /&gt;
*'''z:''' The z coordinate of the destination.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''warp:''' teleports players, resetting any animations they were doing. Setting this to ''false'' preserves the current animation.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example lets admins teleport 5 random players to themselves&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function randomPlayersToLocation(p)&lt;br /&gt;
    if not isPlayerStaff(p) then return end&lt;br /&gt;
&lt;br /&gt;
	local playersOnline = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local amount = #playersOnline&lt;br /&gt;
&lt;br /&gt;
	if amount == 0 then return end&lt;br /&gt;
&lt;br /&gt;
	for index = 1,(amount &amp;gt; 5 and 5 or amount) do&lt;br /&gt;
		local player = playersOnline[index]&lt;br /&gt;
		setElementPosition(player, getElementPosition(p))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;randomtp&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
addCommandHandler(&amp;quot;playershere&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
&lt;br /&gt;
-- Utility function&lt;br /&gt;
local staffACLs = {&lt;br /&gt;
    aclGetGroup(&amp;quot;Admin&amp;quot;),&lt;br /&gt;
    aclGetGroup(&amp;quot;Moderator&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function isPlayerStaff(p)&lt;br /&gt;
	if isElement(p) and getElementType(p) == &amp;quot;player&amp;quot; and not isGuestAccount(getPlayerAccount(p)) then&lt;br /&gt;
		local object = getAccountName(getPlayerAccount(p))&lt;br /&gt;
&lt;br /&gt;
		for _, group in ipairs(staffACLs) do&lt;br /&gt;
			if isObjectInACLGroup(&amp;quot;user.&amp;quot; .. object, group) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to put a vehicle or player out of the water or simulate the position-resetting behaviour if CJ goes below the ground too far, then you need to retrieve a recommended coordinate on ground to place the element at. Take a look at [https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&amp;amp;comment=1003198 this MTA forums post] for steps in the right direction.&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|539|Changing player position when he/she has a jetpack will remove the jetpack and bug when skin is changed}}&lt;br /&gt;
{{Issue|529|Player falls from his bike when its teleported by setElementPosition}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setElementPosition]]&lt;br /&gt;
[[ru:setElementPosition]]&lt;br /&gt;
[[pt-br:setElementPosition]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82439</id>
		<title>PT-BR/setElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82439"/>
		<updated>2025-09-05T23:59:06Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Translation to Brazilian Portuguese&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
Esta função define a posição de um elemento para as coordenadas especificadas.&lt;br /&gt;
{{BR/Warning|Não use essa função para ''spawnar'' um [[Elemento/Player|jogador]]. Isso vai causar problemas com outras funções, como [[warpPedIntoVehicle]]. Em vez disso, use [[spawnPlayer]].}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{BR/OOP||[[PT-BR/Elemento|elemento]]:setPosition|position|getElementPosition}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos Necessários=== &lt;br /&gt;
*'''theElement:''' Um [[PT-BR/Elemento|elemento]] válido para ser movido.&lt;br /&gt;
*'''x:''' A coordenada '''X''' de destino.&lt;br /&gt;
*'''y:''' A coordenada '''Y''' de destino.&lt;br /&gt;
*'''z:''' A coordenada '''Z''' de destino.&lt;br /&gt;
&lt;br /&gt;
===Argumentos Opcionais===&lt;br /&gt;
*'''warp:''' teletransporta o jogador, resetando qualquer animação que esteja rodando. Definindo esse argumento com ''false'', a animação permanecerá.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna ''true'' se foi executado com sucesso, caso contrário retorna ''false''.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo permite que os administradores teletransportem 5 jogadores aleatórios para si mesmos&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function randomPlayersToLocation(p)&lt;br /&gt;
    if not isPlayerStaff(p) then return end&lt;br /&gt;
&lt;br /&gt;
	local playersOnline = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local amount = #playersOnline&lt;br /&gt;
&lt;br /&gt;
	if amount == 0 then return end&lt;br /&gt;
&lt;br /&gt;
	for index = 1,(amount &amp;gt; 5 and 5 or amount) do&lt;br /&gt;
		local player = playersOnline[index]&lt;br /&gt;
		setElementPosition(player, getElementPosition(p))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;randomtp&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
addCommandHandler(&amp;quot;playershere&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
&lt;br /&gt;
-- Utilitário&lt;br /&gt;
local staffACLs = {&lt;br /&gt;
    aclGetGroup(&amp;quot;Admin&amp;quot;),&lt;br /&gt;
    aclGetGroup(&amp;quot;Moderator&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function isPlayerStaff(p)&lt;br /&gt;
	if isElement(p) and getElementType(p) == &amp;quot;player&amp;quot; and not isGuestAccount(getPlayerAccount(p)) then&lt;br /&gt;
		local object = getAccountName(getPlayerAccount(p))&lt;br /&gt;
&lt;br /&gt;
		for _, group in ipairs(staffACLs) do&lt;br /&gt;
			if isObjectInACLGroup(&amp;quot;user.&amp;quot; .. object, group) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se você quiser colocar um veículo ou jogador fora da água ou simular o comportamento de redefinição de posição caso CJ fique muito abaixo do solo, será necessário recuperar uma coordenada recomendada no solo para colocar o elemento. Dê uma olhada [https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&amp;amp;comment=1003198 nesse posto do Fórum do MTA] para os passos na direção certa.&lt;br /&gt;
&lt;br /&gt;
==Problemas==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|539|Alterar a posição do jogador quando ele/ela tiver um jetpack removerá o jetpack e o bug quando a skin for alterada}}&lt;br /&gt;
{{Issue|529|Jogador cai da bicicleta quando ela é teletransportada por setElementPosition}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setElementPosition]]&lt;br /&gt;
[[ru:setElementPosition]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:BR/Warning&amp;diff=82438</id>
		<title>Template:BR/Warning</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:BR/Warning&amp;diff=82438"/>
		<updated>2025-09-05T23:29:32Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Update from original&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;warning-messagebox&amp;quot;&amp;gt;{{MessageBox|&lt;br /&gt;
   bordercolorhex = FFB2B2 |&lt;br /&gt;
   bgcolorhex = FFE5E5 |&lt;br /&gt;
   image = {{ #if: {{{2|}}} | File:Dialog-warning.png }} |&lt;br /&gt;
   title = Aviso: |&lt;br /&gt;
   message = {{{1}}} }}&amp;lt;/div&amp;gt; &amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Template documentation|Warning template for in-line and page warnings.|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;,N&amp;gt;&amp;lt;nowiki&amp;gt;{{Warning|information|use warning image}}&amp;lt;/nowiki&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Example with warning image (recommended for page warnings):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;,N&amp;gt;&amp;lt;nowiki&amp;gt;{{Warning|information|true}}&amp;lt;/nowiki&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Warning|information|true}}&lt;br /&gt;
* Example without warning image (recommended for in-line warnings):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;,N&amp;gt;&amp;lt;nowiki&amp;gt;{{Warning|information}}&amp;lt;/nowiki&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Warning|information}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsGIFGetSize&amp;diff=82412</id>
		<title>DgsGIFGetSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGIFGetSize&amp;diff=82412"/>
		<updated>2025-08-23T22:59:08Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__  {{Client function}}  Returns the dimensions (width and height) of a GIF element created using dgsCreateGIF. The values correspond to the original size extracted from the GIF file during loading.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int int dgsGIFGetSize( element gif ) &amp;lt;/syntaxhighlight&amp;gt;   ===Required Arguments=== *'''gif: ''' The '''dgs-dxgif''' type element you want to get the size of.  ===Returns=== Returns two integers corresponding to ''width'' an...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Returns the dimensions (width and height) of a GIF element created using [[dgsCreateGIF]]. The values correspond to the original size extracted from the GIF file during loading.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int int dgsGIFGetSize( element gif )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''gif: ''' The '''dgs-dxgif''' type element you want to get the size of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two integers corresponding to ''width'' and ''height''&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This script should be executed on the client-side&lt;br /&gt;
&lt;br /&gt;
-- Import the DGS functions to use them from another resource&lt;br /&gt;
local DGS = exports.dgs&lt;br /&gt;
&lt;br /&gt;
-- 1. Load the GIF from a file within your resource&lt;br /&gt;
local myAnimatedGif = DGS.dgsCreateGIF(&amp;quot;files/loading.gif&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- 2. Check if the GIF was loaded successfully before proceeding&lt;br /&gt;
if myAnimatedGif then&lt;br /&gt;
    -- 3. Use dgsGIFGetSize to get the width and height of the loaded GIF&lt;br /&gt;
    local width, height = DGS.dgsGIFGetSize(myAnimatedGif)&lt;br /&gt;
&lt;br /&gt;
    -- 4. Display the dimensions in the chat to confirm the result&lt;br /&gt;
    outputChatBox(string.format(&amp;quot;The loaded GIF has the dimensions: %d width by %d height.&amp;quot;, width, height))&lt;br /&gt;
&lt;br /&gt;
    -- 5. Practical example: Create a DGS image in the center of the screen&lt;br /&gt;
    --    using the 'width' and 'height' we just obtained so the size is perfect.&lt;br /&gt;
    local screenW, screenH = guiGetScreenSize()&lt;br /&gt;
    local posX = screenW / 2 - width / 2&lt;br /&gt;
    local posY = screenH / 2 - height / 2&lt;br /&gt;
&lt;br /&gt;
    local gifImage = DGS.dgsCreateImage(posX, posY, width, height, myAnimatedGif, false)&lt;br /&gt;
&lt;br /&gt;
    -- Start the GIF's animation&lt;br /&gt;
    DGS.dgsGIFPlay(myAnimatedGif)&lt;br /&gt;
else&lt;br /&gt;
    -- Inform the user if the GIF was not found or if an error occurred during loading&lt;br /&gt;
    outputChatBox(&amp;quot;Error: Could not load the GIF file.&amp;quot;, 255, 0, 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGS_Plugin/Gif}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Added_feature/item&amp;diff=79436</id>
		<title>Template:PT-BR/Added feature/item</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Added_feature/item&amp;diff=79436"/>
		<updated>2024-05-26T23:08:28Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#ifexpr: ({{{1|}}}) = {{Next Stable Version}} and ({{{2|}}}) = {{Current Stable Version}}&lt;br /&gt;
|&amp;lt;div style='border: 2px solid #1b2027; border-radius: 10px; margin: 14px 0; overflow: hidden'&amp;gt;&amp;lt;div style='background: #1b2027; color: #fff; font-weight: bold; padding: 4px 8px'&amp;gt;[[Beta Features|&amp;lt;span style=&amp;quot;color: #fff; text-decoration: underline&amp;quot;&amp;gt;BETA&amp;lt;/span&amp;gt;]]: NOVO RECURSO (BUILD: {{{2}}} {{r|{{{3}}}}})&amp;lt;/div&amp;gt;&amp;lt;div style='padding: 4px 8px'&amp;gt;{{{4}}}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
|{{#ifexpr: {{Next Stable Version}} &amp;gt; ({{{1|}}}) and ({{{1|}}}) = {{Current Stable Version}}&lt;br /&gt;
|&amp;lt;div style='border: 2px solid #232933; border-radius: 10px; margin: 14px 0; overflow: hidden'&amp;gt;&amp;lt;div style='background: #232933; color: #fff; padding: 4px 8px'&amp;gt;* RECURSO ADICIONADO EM {{{1}}} (REVISÃO: {{PT-BR/R|{{{3}}}}})&amp;lt;/div&amp;gt;&amp;lt;div style='padding: 4px 8px'&amp;gt;{{{4}}}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;[[Category:Changes in {{{1}}}]]&lt;br /&gt;
|{{{4}}}&lt;br /&gt;
}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This template is used for highlighting beta and features introduced in the latest version of MTA: San Andreas. The highlighted appearance will automatically disappear when a newer version is released.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
#Stable version (the stable version the feature will appear in)&lt;br /&gt;
#Beta version (the beta version the feature appeared in)&lt;br /&gt;
#Revision (the build the feature appeared in)&lt;br /&gt;
#Description (the feature main description)&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{PT-BR/Added feature/item&lt;br /&gt;
| stable version&lt;br /&gt;
| beta version&lt;br /&gt;
| revision&lt;br /&gt;
| description&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Current stable version: &amp;lt;span style='color: #0cc'&amp;gt;'''{{Current Stable Version}}'''&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next stable version: &amp;lt;span style='color: #3b3'&amp;gt;'''{{Next Stable Version}}'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Utility templates]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=78741</id>
		<title>User:Lettify</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Lettify&amp;diff=78741"/>
		<updated>2023-12-23T16:01:57Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#8000FF&amp;quot; subcaption=&amp;quot;KronoS Lettify&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
[[File:KronoSLY Logo.png|thumb|right]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Visite minha página do Facebook: [https://www.facebook.com/thenewsjoker/ The Piadas &amp;amp; News]&amp;lt;br&amp;gt;&lt;br /&gt;
* Meu perfil do Fórum do MTA: [https://forum.mtasa.com/profile/71215-kronos-lettify/ KronoS Lettify]&amp;lt;br&amp;gt;&lt;br /&gt;
* Minhas [[Special:Contributions/Lettify|contribuições]]&lt;br /&gt;
* Meu Discord: @'''kronos.lettify'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[User:Lettify|Lettify]] ([[User talk:Lettify|talk]])&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=78725</id>
		<title>FileWrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileWrite&amp;diff=78725"/>
		<updated>2023-12-20T20:15:25Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Writes one or more strings to a given file, starting at the current read/write position. Advances the position over the number of bytes that were written.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileWrite ( file theFile, string string1 [, string string2, string string3 ...])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:write}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to write to. The file must have been opened with write access, i.e. the file handle must be a result of [[fileCreate]] or [[fileOpen]] with the readonly parameter set to ''false''.&lt;br /&gt;
*'''string1:''' The string to write.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*You can provide any number of additional strings to write after '''string1'''. These will be written in the order in which they are specified.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of bytes successfully written to the file, returns ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a text file and writes a string to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)             -- attempt to create a new file&lt;br /&gt;
if fileHandle then                                    -- check if the creation succeeded&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;This is a test file!&amp;quot;)     -- write a text line&lt;br /&gt;
    fileClose(fileHandle)                             -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Notice that you can't simply do fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;). Instead, file functions operate on a '''file handle''', which is a special object representing an open file.&lt;br /&gt;
&lt;br /&gt;
It is also important to remember to close a file after you've finished all your operations on it, especially if you've been writing to the file. If you don't close a file and your resource crashes, all changes to the file may be lost.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileWrite]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileWrite&amp;diff=78724</id>
		<title>PT-BR/fileWrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileWrite&amp;diff=78724"/>
		<updated>2023-12-20T20:15:21Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}} Escreve uma ou mais strings para um determinado arquivo, iniciando na posição de leitura/gravação atual. A posição avança de acordo com o número de bytes que estiver sendo escrito.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileWrite ( file theFile, string string1 [, string string2, string string3 ...]) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:write}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' no qual...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
Escreve uma ou mais strings para um determinado arquivo, iniciando na posição de leitura/gravação atual. A posição avança de acordo com o número de bytes que estiver sendo escrito.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileWrite ( file theFile, string string1 [, string string2, string string3 ...])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:write}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' no qual deseja escrever. O arquivo deve estar aberto com acessos de escrita, ou seja, esse '''arquivo''' deve ser retornado de [[PT-BR/fileCreate|fileCreate]] ou [[PT-BR/fileOpen|fileOpen]] com o argumento '''readonly''' (modo leitura) definido para '''false'''.&lt;br /&gt;
*'''string1:''' O texto que quer escrever no arquivo.&lt;br /&gt;
&lt;br /&gt;
===Argumento opcional===&lt;br /&gt;
*Você pode especificar quantas strings adicionais que quiser depois de '''string1'''. Essas strings serão escritas na ordem que estiverem sendo especificadas.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna o ''número'' de bytes que foram escritos com sucesso no arquivo, retorna '''false''' se argumentos inválidos forem especificados.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo cria um arquivo de texto e escreve um texto nele.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)             -- tentamos criar um novo arquivo&lt;br /&gt;
if fileHandle then                                    -- verificamos se o arquivo foi criado&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;This is a test file!&amp;quot;)     -- escrevemos a linha de texto&lt;br /&gt;
    fileClose(fileHandle)                             -- fechamos o arquivo depois de trabalhar nele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observe que você não pode simplesmente fazer dessa forma: &amp;lt;code&amp;gt;fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;)&amp;lt;/code&amp;gt;. Em vez disso, as funções que manipulam os arquivos operam com o '''arquivo''', que é um objeto especial representando o arquivo aberto.&lt;br /&gt;
&lt;br /&gt;
É importante também lembrar de fechar o arquivo depois que você terminar de fazer tudo o que precisa com ele, especialmente se você tiver escrito algo nesse arquivo. Se não fechá-lo e o resource travar de alguma forma, todas as mudanças no arquivo podem ser perdidas.&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileSetPos&amp;diff=78723</id>
		<title>FileSetPos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileSetPos&amp;diff=78723"/>
		<updated>2023-12-20T20:03:30Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Sets the current read/write position in the file.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileSetPos ( file theFile, int offset )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:setPos|pos|fileGetPos}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file handle of which you want to change the read/write position.&lt;br /&gt;
*'''offset:''' The new position. This is the number of bytes from the beginning of the file. If this value is larger than the file size, it is limited to 52,428,800 bytes (50 MB).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns where the offset was actually set at. I.e. if '''offset''' was past the end of the file, it will be set at the end of the file, and this position will be returned. Returns ''false'' in case of failure (e.g. the specified file handle is invalid).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens a binary file and prints the value of the byte at position 8 to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.dat&amp;quot;)          -- attempt to open the file&lt;br /&gt;
if hFile then                               -- check if it succeeded&lt;br /&gt;
    fileSetPos(hFile, 8)                    -- set the read/write position&lt;br /&gt;
    local readByte = fileRead(hFile, 1)     -- read one byte from this position&lt;br /&gt;
    outputConsole(&amp;quot;Byte at position 8 = &amp;quot; .. string.byte(readByte))     -- output it&lt;br /&gt;
    fileClose(hFile)                        -- close the file&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.dat&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileSetPos]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileSetPos&amp;diff=78722</id>
		<title>PT-BR/fileSetPos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileSetPos&amp;diff=78722"/>
		<updated>2023-12-20T20:03:27Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Define a posição atual para leitura/gravação no arquivo.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileSetPos ( file theFile, int offset ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:setPos|pos|PT-BR/fileGetPos}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que você quer mudar a posição de leitura/gravação. *'''offset:''' A nova posição. Este é o número de bytes partindo do início do arquivo. Se est...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Define a posição atual para leitura/gravação no arquivo.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileSetPos ( file theFile, int offset )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:setPos|pos|PT-BR/fileGetPos}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você quer mudar a posição de leitura/gravação.&lt;br /&gt;
*'''offset:''' A nova posição. Este é o número de bytes partindo do início do arquivo. Se este número for maior que o tamanho do arquivo, então será limitado para 52,428,800 bytes (50 MB).&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna onde realmente foi definido o ''offset''. Ou seja, se ''offset'' ultrapassar o final do arquivo, então esse valor será a posição do fim do arquivo, que é o que será retornado. Retorna '''false''' em caso de falha (ex.: o '''arquivo''' especificado for inválido).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo abre um arquivo binário e exibe no console o valor do byte na posição 8.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.dat&amp;quot;)          -- tentamos abrir o arquivo&lt;br /&gt;
if hFile then                               -- verificamos se foi aberto&lt;br /&gt;
    fileSetPos(hFile, 8)                    -- define a posição de leitura/gravação&lt;br /&gt;
    local readByte = fileRead(hFile, 1)     -- faz a leitura de um byte nesta posição&lt;br /&gt;
    outputConsole(&amp;quot;Byte at position 8 = &amp;quot; .. string.byte(readByte))     -- então exibe&lt;br /&gt;
    fileClose(hFile)                        -- fechamos o arquivo&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.dat&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileRename&amp;diff=78721</id>
		<title>FileRename</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileRename&amp;diff=78721"/>
		<updated>2023-12-20T19:51:00Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Renames the specified file.&lt;br /&gt;
{{Note|Also with this function you can move specified file to a new location, new folder or even to another resource's folder. But for this action executing resource must have 'ModifyOtherObjects' ACL right set to ''true''.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileRename ( string filePath, string newFilePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the File class.|[[File]].rename}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filePath:''' The [[filepath]] of the source file in the following format: '''&amp;quot;:resourceName/path&amp;quot;'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file. If the file is in the current resource, only the file path is necessary.&lt;br /&gt;
*'''newFilePath:''' Destination [[filepath]] for the specified source file in the same format.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If successful, returns ''true''. Otherwise returns ''false''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example renames the file ''test1.txt'' that is in the root of the current resource to ''test2.txt''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileRename( &amp;quot;test1.txt&amp;quot;, &amp;quot;test2.txt&amp;quot; ) then&lt;br /&gt;
    outputConsole(&amp;quot;File `test1.txt` successfully renamed to `test2.txt`&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to rename `test1.txt`&amp;quot;)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example moves the file ''test1.txt'' that is in the root of the current resource to ''myFolder'' folder. If this folder is not exists, it will be created before moving the file ''test1.txt''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileRename( &amp;quot;test1.txt&amp;quot;, &amp;quot;myFolder/test1.txt&amp;quot; ) then&lt;br /&gt;
    outputConsole(&amp;quot;File `test1.txt` successfuly moved to `myFolder` folder&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to move `test1.txt`&amp;quot;)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileRename]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileRename&amp;diff=78720</id>
		<title>PT-BR/fileRename</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileRename&amp;diff=78720"/>
		<updated>2023-12-20T19:50:54Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Renomeia o arquivo que especificar.  {{BR/Nota|Com esta função você também pode mover determinado arquivo para um lugar diferente, seja uma pasta diferente no resource atual ou até mesmo para a pasta de um outro resource. Mas para fazer isso o resource deve ter a seguinte permissão da ACL definida para ''true'': 'ModifyOtherObjects'.}}  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileRename ( string filePath, string newFileP...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Renomeia o arquivo que especificar.&lt;br /&gt;
&lt;br /&gt;
{{BR/Nota|Com esta função você também pode mover determinado arquivo para um lugar diferente, seja uma pasta diferente no resource atual ou até mesmo para a pasta de um outro resource. Mas para fazer isso o resource deve ter a seguinte permissão da ACL definida para ''true'': 'ModifyOtherObjects'.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileRename ( string filePath, string newFilePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].rename}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do resource do arquivo que vai estar lá, e '''path''' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
*'''newFilePath:''' O [[filepath|caminho]] de destino para o arquivo especificado no mesmo formato.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Se renomeado com sucesso, retorna '''true'''. Caso contrário retorna '''false'''.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo renomeia o arquivo ''test1.txt'' que está na raiz do resource atual, para ''test2.txt''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileRename( &amp;quot;test1.txt&amp;quot;, &amp;quot;test2.txt&amp;quot; ) then&lt;br /&gt;
    outputConsole(&amp;quot;File `test1.txt` successfully renamed to `test2.txt`&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to rename `test1.txt`&amp;quot;)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Este exemplo move o arquivo ''test1.txt'' que está na raiz do resource atual para a pasta ''myFolder''. Se esta pasta não existir, será criada antes desse arquivo ser movido para lá.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileRename( &amp;quot;test1.txt&amp;quot;, &amp;quot;myFolder/test1.txt&amp;quot; ) then&lt;br /&gt;
    outputConsole(&amp;quot;File `test1.txt` successfuly moved to `myFolder` folder&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to move `test1.txt`&amp;quot;)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:BR/Nota&amp;diff=78719</id>
		<title>Template:BR/Nota</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:BR/Nota&amp;diff=78719"/>
		<updated>2023-12-20T19:46:47Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PT-BR/MessageBox|&lt;br /&gt;
   bordercolorhex = d5b5f5 |&lt;br /&gt;
   bgcolorhex = ccccff |&lt;br /&gt;
   bordertype = |&lt;br /&gt;
   image = File:Post-it.png |&lt;br /&gt;
   imageSize = 32px|&lt;br /&gt;
   message = '''Nota:''' {{{1}}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/MessageBox&amp;diff=78718</id>
		<title>Template:PT-BR/MessageBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/MessageBox&amp;diff=78718"/>
		<updated>2023-12-20T19:46:39Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Warning|This template is included in a lot of pages/articles. Test your changes when you edit this template!|true}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{| cellspacing=&amp;quot;0&amp;quot; cellpaddin=&amp;quot;0&amp;quot; style=&amp;quot;padding: 5px; width: 60%; padding-left: 12px; padding-right: 12px; margin: 6px auto 2px auto; border: 1px solid; border-radius: 10px; {{#if: {{{bordertype|}}} | {{{bordertype}}} | solid }} #{{#if: {{{bordercolorhex|}}} | {{{bordercolorhex}}} | CCCCCC }}; background: #{{#if: {{{bgcolorhex|}}} | {{{bgcolorhex}}} | F9F9F9 }}; border-left: 10px solid #{{#if: {{{bordercolorhex|}}} | {{{bordercolorhex}}} | CCCCCC }};&amp;quot;&lt;br /&gt;
|style=&amp;quot;width: 32px; vertical-align:top {{#if: {{{image|}}} | | display: none; }}&amp;quot; rowspan=&amp;quot;2&amp;quot; | [[{{{image}}}|link=|{{#if: {{{imageSize|}}}|{{{imageSize}}}}}]]&lt;br /&gt;
|style=&amp;quot;{{#if: {{{image|}}} | padding-left: 10px; }}&amp;quot; |{{#if: {{{title|}}}|'''{{{title}}}'''}} {{#if: {{{message|}}}| &amp;lt;span style=&amp;quot;color: #131b15&amp;quot;&amp;gt;{{{message}}}&amp;lt;/span&amp;gt;}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot; style=&amp;quot;padding-left: 10px;&amp;quot;|{{#if: {{{subtext|}}}|&amp;lt;hr style=&amp;quot;background: #{{{bordercolorhex}}};&amp;quot;/&amp;gt;&amp;lt;span style=&amp;quot;color: #131b15&amp;quot;&amp;gt;{{{subtext}}}&amp;lt;/span&amp;gt; }}&lt;br /&gt;
|}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Article message box'''&lt;br /&gt;
{{PT-BR/MessageBox|&lt;br /&gt;
   bordercolorhex = FFADAD |&lt;br /&gt;
   bordertype = |&lt;br /&gt;
   bgcolorhex = F9F9F9 |&lt;br /&gt;
   image = File:Dialog-warning.png |&lt;br /&gt;
   imageSize = 50px| -- make it bigger&lt;br /&gt;
   title = Warninga: |&lt;br /&gt;
   message = Test '''TEXT''' 1 2 |&lt;br /&gt;
   subtext = More Text |&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
{{PT-BR/MessageBox|&lt;br /&gt;
   bordercolorhex = FFADAD |&lt;br /&gt;
   bordertype = |&lt;br /&gt;
   bgcolorhex = F9F9F9 |&lt;br /&gt;
   image = File:Dialog-warning.png |&lt;br /&gt;
   imageSize = 50px| -- make it bigger&lt;br /&gt;
   title = Warninga: |&lt;br /&gt;
   message = Test TEXT 1 2 3 |&lt;br /&gt;
   subtext = More Text |&lt;br /&gt;
   &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=78717</id>
		<title>FileRead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileRead&amp;diff=78717"/>
		<updated>2023-12-20T19:37:15Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileRead ( file theFile, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:read}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to read from. Use [[fileOpen]] to obtain this handle.&lt;br /&gt;
*'''count:''' The number of bytes you wish to read.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the bytes that were read in a string. Note that this string might not contain as many bytes as you specified if an error occured, i.e. end of file.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function readFile(path)&lt;br /&gt;
    local file = fileOpen(path) -- attempt to open the file&lt;br /&gt;
    if not file then&lt;br /&gt;
        return false -- stop function on failure&lt;br /&gt;
    end&lt;br /&gt;
    local count = fileGetSize(file) -- get file's total size&lt;br /&gt;
    local data = fileRead(file, count) -- read whole file&lt;br /&gt;
    fileClose(file) -- close the file once we're done with it&lt;br /&gt;
    outputConsole(data) -- output code in console&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;readfile&amp;quot;,function(cmd,fileName) -- add command to test this function&lt;br /&gt;
    readFile(fileName) -- execute the function&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[fileOpen]] sets the read/write position to the beginning of the file.&lt;br /&gt;
[[fileGetSize]] gets the total size in bytes of given file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileRead]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileRead&amp;diff=78716</id>
		<title>PT-BR/fileRead</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileRead&amp;diff=78716"/>
		<updated>2023-12-20T19:37:12Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Faz a leitura de uma especificada quantidade de bytes de um determinado arquivo, começando em sua posição atual de leitura/gravação, e retorna o valor como uma ''string''.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; string fileRead ( file theFile, int count ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:read}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que deseja fazer a leitura. Use fileOpen p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Faz a leitura de uma especificada quantidade de bytes de um determinado arquivo, começando em sua posição atual de leitura/gravação, e retorna o valor como uma ''string''.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileRead ( file theFile, int count )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:read}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que deseja fazer a leitura. Use [[PT-BR/fileOpen|fileOpen]] para obter esse '''arquivo''' mencionado.&lt;br /&gt;
*'''count:''' O número de bytes que deseja ler nesse ''arquivo''.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Returna os bytes que foram lidos, em uma ''string''. Observe que esta ''string'' poderá não conter toda a informação pela quantidade de bytes especificados para a leitura se tiver ocorrido algum erro, ex.: a posição de leitura estiver próximo ou literalmente no fim do arquivo.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo abre o arquivo &amp;quot;test.txt&amp;quot; e exibe seu conteúdo no console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function readFile(path)&lt;br /&gt;
    local file = fileOpen(path) -- tentamos abrir o arquivo&lt;br /&gt;
    if not file then&lt;br /&gt;
        return false -- paramos a função no caso de erro&lt;br /&gt;
    end&lt;br /&gt;
    local count = fileGetSize(file) -- obtemos o tamanho total do arquivo&lt;br /&gt;
    local data = fileRead(file, count) -- fazemos a leitura de todo o arquivo&lt;br /&gt;
    fileClose(file) -- fechamos o arquivo depois de feito todo o trabalho&lt;br /&gt;
    outputConsole(data) -- exibimos os dados no console&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;readfile&amp;quot;,function(cmd,fileName) -- adicionamos o comando para testar a função&lt;br /&gt;
    readFile(fileName) -- executa a função&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Detalhes relevantes ===&lt;br /&gt;
* [[PT-BR/fileOpen|fileOpen]] define a posição de leitura/gravação para o começo do arquivo.&lt;br /&gt;
* [[PT-BR/fileGetSize|fileGetSize]] obtém o tamanho total (em bytes) de um determinado arquivo.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileOpen&amp;diff=78715</id>
		<title>FileOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileOpen&amp;diff=78715"/>
		<updated>2023-12-20T19:25:36Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Opens an existing file for reading and writing.&lt;br /&gt;
{{Note|To prevent memory leaks, ensure each successful call to [[fileOpen]] has a matching call to [[fileClose]].}}&lt;br /&gt;
{{Tip|The file functions should not be used to implement configuration files. It is encouraged to use the XML functions for this instead.}}&lt;br /&gt;
{{MessageBox|bordercolorhex=FFB2B2|bgcolorhex=FFE5E5|image=File:Dialog-warning.png|title=Warning:|message=As of 1.5.4 [https://buildinfo.mtasa.com/?Author=&amp;amp;Branch=&amp;amp;Revision=10413 r10413], this function will fail when trying to access a script file of another resource, even with ''general.ModifyOtherObjects'' rights granted, which uses a ''mysql'' connection through [[dbConnect]] when [[Server_mtaserver.conf#database_credentials_protection|''database_credentials_protection'']] is enabled in the server configuration. Additionally, meta.xml will be un-writable and will always open in read-only mode.}} &amp;lt;!-- The {Warning} template didn't want to work with an external link to buildinfo, so I had to use the {MessageBox} template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fileOpen ( string filePath [, bool readOnly = false ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|The function will only attempt to open the file, it won't create it.|[[File]]}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|9.0156|1.5.6|11865|&lt;br /&gt;
{{OOP|This is a static function underneath the File class. Using '''File(...)''' to open a file will attempt to create the file, if it doesn't exist|[[File]].open}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filePath:''' The [[filepath]] of the file in the following format: '''&amp;quot;:resourceName/path&amp;quot;'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.&lt;br /&gt;
:For example, if there is a file named 'coolObjects.txt' in the resource 'objectSearch', it can be opened from another resource this way: ''fileOpen(&amp;quot;:objectSearch/coolObjects.txt&amp;quot;)''.&lt;br /&gt;
:If the file is in the current resource, only the file path is necessary, e.g. ''fileOpen(&amp;quot;coolObjects.txt&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''readOnly:''' By default, the file is opened with reading and writing access. You can specify ''true'' for this parameter if you only need reading access.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If successful, returns a file handle for the file. Otherwise returns ''false'' (f.e. if the file doesn't exist).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt that is in the root of the current resource, and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- attempt to open the file (read only)&lt;br /&gt;
if hFile then                                  -- check if it was successfully opened&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- as long as we're not at the end of the file...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... read the next 500 bytes...&lt;br /&gt;
        outputConsole(buffer)                  -- ... and output them to the console&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- close the file once we're done with it&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example show how to append data to an existing file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;)             -- attempt to open the file (read and write mode)&lt;br /&gt;
if hFile then                                  -- check if it was successfully opened&lt;br /&gt;
    fileSetPos( hFile, fileGetSize( hFile ) )  -- move position to the end of the file&lt;br /&gt;
    fileWrite(hFile, &amp;quot;hello&amp;quot; )                 -- append data&lt;br /&gt;
    fileFlush(hFile)                           -- Flush the appended data into the file.&lt;br /&gt;
    fileClose(hFile)                           -- close the file once we're done with it&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileOpen]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileOpen&amp;diff=78714</id>
		<title>PT-BR/fileOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileOpen&amp;diff=78714"/>
		<updated>2023-12-20T19:25:30Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Abre um arquivo existente para leitura e gravação.  {{BR/Nota|Para prevenir perdas de memórias, garanta que cada execução bem sucedida de fileOpen tenha um fileClose para fechar o arquivo aberto.}} {{BR/Tip|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as Shared_Scripting_Functions#XML_functions|funções XM...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Abre um arquivo existente para leitura e gravação.&lt;br /&gt;
&lt;br /&gt;
{{BR/Nota|Para prevenir perdas de memórias, garanta que cada execução bem sucedida de [[PT-BR/fileOpen|fileOpen]] tenha um [[PT-BR/fileClose|fileClose]] para fechar o arquivo aberto.}}&lt;br /&gt;
{{BR/Tip|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as [[Shared_Scripting_Functions#XML_functions|funções XML]].}}&lt;br /&gt;
{{MessageBox|bordercolorhex=FFB2B2|bgcolorhex=FFE5E5|image=File:Dialog-warning.png|title=Aviso:|message=A partir da versão 1.5.4 [https://buildinfo.mtasa.com/?Author=&amp;amp;Branch=&amp;amp;Revision=10413 r10413], esta função vai falhar quando tentar acessar um arquivo de script de outro resource, até mesmo com a permissão ''general.ModifyOtherObjects'' concedida, que usa uma conexão ''mysql'' através de [[dbConnect]] quando [[Server_mtaserver.conf#database_credentials_protection|''database_credentials_protection'']] estiver habilitado na configuração do servidor. Além disso, não será mais possível gravar no '''meta.xml''', ele será aberto apenas em modo leitura.}}&lt;br /&gt;
&amp;lt;!-- The {Warning} template didn't want to work with an external link to buildinfo, so I had to use the {MessageBox} template --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fileOpen ( string filePath [, bool readOnly = false ])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO|A função vai apenas tentar abrir o arquivo, não vai criá-lo.|[[File]]}}&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/New feature/item|9.0156|1.5.6|11865|&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File. Usando '''File(...)''' vai abrir um arquivo caso existe, senão este será criado.|[[File]].open}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do resource do arquivo que vai estar lá, e '''path''' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
:Por exemplo, se existir um arquivo chamado ''coolObjects.txt'' no resource ''objectSearch'', esse arquivo pode ser aberto de um outro resource dessa forma: &amp;lt;code&amp;gt;fileOpen(&amp;quot;:objectSearch/coolObjects.txt&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
:Se o arquivo está no resource atual, apenas o caminho do arquivo é necessário, ex.: &amp;lt;&amp;lt;code&amp;gt;fileOpen(&amp;quot;coolObjects.txt&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Argumento opcional===&lt;br /&gt;
*'''readOnly:''' Por padrão, o arquivo é aberto com acesso de leitura e gravação. Você pode especificar '''true''' para esse argumento se você quiser o acesso apenas para leitura.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Se aberto com sucesso, retorna o '''arquivo''' (objeto-arquivo) especificado. Caso contrário retorna '''false''' (ex.: se o arquivo não existir).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo abre o arquivo &amp;quot;test.txt&amp;quot; que está na raiz do resource atual (onde o código tá sendo executado), e exibe o seu conteúdo no console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- tentamos abrir o arquivo (em modo leitura)&lt;br /&gt;
if hFile then                                  -- verificamos se foi aberto com sucesso&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- enquanto não estivermos o final do arquivo...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... lemos os próximos 500 bytes ...&lt;br /&gt;
        outputConsole(buffer)                  -- ... e exibimos no console&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- fechamos o arquivo depois de trabalhar com ele&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example show how to append data to an existing file:&lt;br /&gt;
Este exemplo mostra como inserir (sem substituir) um dado em um arquivo existente:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;)             -- tentamos abrir o arquivo (em modo leitura e gravação)&lt;br /&gt;
if hFile then                                  -- verificamos se foi aberto com sucesso&lt;br /&gt;
    fileSetPos( hFile, fileGetSize( hFile ) )  -- movemos a posição para o fim do arquivo&lt;br /&gt;
    fileWrite(hFile, &amp;quot;hello&amp;quot; )                 -- inserimos o valor que queremos&lt;br /&gt;
    fileFlush(hFile)                           -- Forçamos a gravação imediata do valor que inserimos no arquivo&lt;br /&gt;
    fileClose(hFile)                           -- fechamos o arquivo depois de trabalhar nele&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileIsEOF&amp;diff=78713</id>
		<title>FileIsEOF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileIsEOF&amp;diff=78713"/>
		<updated>2023-12-20T19:04:05Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Checks if the file position is at the end of the file.&lt;br /&gt;
{{Note|Due to underlying C API restrictions this function may return false until an attempt to read further than the end of the file is made.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileIsEOF ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:isEOF|eof}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the file position of the specified file is at the end of the file, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- attempt to open the file (read only)&lt;br /&gt;
if hFile then                                  -- check if it was successfully opened&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- as long as we're not at the end of the file...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... read the next 500 bytes...&lt;br /&gt;
        outputConsole(buffer)                  -- ... and output them to the console&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- close the file once we're done with it&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you open a file, its file position is set to the beginning of the file. Each call to [[fileRead]] or [[fileWrite]] moves the position ahead by the amount of bytes that were read/written. This way, by using ''fileIsEOF'' you can check if you've passed through the whole file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileIsEOF]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileIsEOF&amp;diff=78712</id>
		<title>PT-BR/fileIsEOF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileIsEOF&amp;diff=78712"/>
		<updated>2023-12-20T19:04:03Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Verifica se a posição atual no arquivo está no fim dele.  {{BR/Nota|Devido às restrições subjacentes da API C, esta função pode retornar '''false''' até que seja feita uma tentativa de leitura além do final do arquivo.}}  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileIsEOF ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:isEOF|eof}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que você quer...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Verifica se a posição atual no arquivo está no fim dele.&lt;br /&gt;
&lt;br /&gt;
{{BR/Nota|Devido às restrições subjacentes da API C, esta função pode retornar '''false''' até que seja feita uma tentativa de leitura além do final do arquivo.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileIsEOF ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:isEOF|eof}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você quer verificar.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true''' se a posição do arquivo especificado está no final do mesmo, '''false''' caso contrário.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
This example opens the file test.txt and outputs its contents to the console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- tentamos abrir o arquivo (em modo leitura)&lt;br /&gt;
if hFile then                                  -- verificamos se foi aberto com sucesso&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- desde que não estejamos no fim do arquivo...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... lemos os próximos 500 bytes ...&lt;br /&gt;
        outputConsole(buffer)                  -- ... e exibimos no console.&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- fechamos o arquivo depois que terminarmos com ele&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quando você abre um arquivo, a posição do cursor de leitura/gravação é definida para o início do arquivo. Cada chamada para [[PT-BR/fileRead|fileRead]] ou [[PT-BR/fileWrite|fileWrite]] avança essa posição para a quantidade de bytes que forem lidos/gravados. Esta forma, usando [[PT-BR/fileIsEOF|fileIsEOF]] você pode verificar se você passou por todo o arquivo durante essas execuções.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetSize&amp;diff=78711</id>
		<title>FileGetSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetSize&amp;diff=78711"/>
		<updated>2023-12-20T18:55:39Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Returns the total size in bytes of the given file.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileGetSize ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:getSize|size}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' the file handle you wish to get the size of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the file size if successful, or ''false'' if an error occured (e.g. an invalid file handle was passed).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
	fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- write a text line&lt;br /&gt;
	local size = fileGetSize(newFile)              -- get size&lt;br /&gt;
	if size then&lt;br /&gt;
		outputChatBox(&amp;quot;Size of test.txt is: &amp;quot;..size, source) -- output size&lt;br /&gt;
        end&lt;br /&gt;
	fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileGetSize]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetSize&amp;diff=78710</id>
		<title>PT-BR/fileGetSize</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetSize&amp;diff=78710"/>
		<updated>2023-12-20T18:55:35Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Retorna o tamanho total (em bytes) de determinado arquivo.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetSize ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:getSize|size}}  ===Argumentos necessários=== *'''theFile:''' o '''arquivo''' que você deseja obter o tamanho total.  ===Retorno=== Retorna o tamanho do arquivo se tiver sido executado com sucesso, ou '''false''' se tiver ocorrido algum erro (ex.: um '''arqui...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Retorna o tamanho total (em bytes) de determinado arquivo.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int fileGetSize ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:getSize|size}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' o '''arquivo''' que você deseja obter o tamanho total.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna o tamanho do arquivo se tiver sido executado com sucesso, ou '''false''' se tiver ocorrido algum erro (ex.: um '''arquivo''' inválido for especificado)&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- tentamos criar um novo arquivo&lt;br /&gt;
if (newFile) then                                       -- verificamos se foi criado com sucesso&lt;br /&gt;
	fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- escrevemos uma linha de texto&lt;br /&gt;
	local size = fileGetSize(newFile)              -- obtemos o tamanho&lt;br /&gt;
	if size then&lt;br /&gt;
		outputChatBox(&amp;quot;Size of test.txt is: &amp;quot;..size, source) -- exibimos o tamanho&lt;br /&gt;
        end&lt;br /&gt;
	fileClose(newFile)                                -- fechamos o arquivo depois de trabalharmos com ele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPos&amp;diff=78709</id>
		<title>FileGetPos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPos&amp;diff=78709"/>
		<updated>2023-12-20T18:51:21Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Returns the current read/write position in the given file.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetPos ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:getPos|pos|fileSetPos}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' the file handle you wish to get the position of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the file position if successful, or ''false'' if an error occured (e.g. an invalid handle was passed).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the file test.txt and outputs its contents and current read position to the console. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- attempt to open the file (read only)&lt;br /&gt;
if hFile then                                  -- check if it was successfully opened&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- as long as we're not at the end of the file...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... read the next 500 bytes...&lt;br /&gt;
        outputConsole(buffer..&amp;quot;Current Position: &amp;quot;..fileGetPos(hFile))                  -- ... and output them to the console and outputs the current read position&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- close the file once we're done with it&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileGetPos]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPos&amp;diff=78708</id>
		<title>PT-BR/fileGetPos</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPos&amp;diff=78708"/>
		<updated>2023-12-20T18:51:16Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Retorna a posição atual na leitura/gravação de um determinado arquivo.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetPos ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;  {{PT-BR/POO||file:getPos|pos|PT-BR/fileSetPos}}  ===Argumentos necessários=== *'''theFile:''' o '''arquivo''' que você deseja obter a posição.  ===Retorna=== Retorna a posição do arquivo, ou ''false'' se tiver ocorrido algum erro (ex.: um '''arquivo''' inv...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Retorna a posição atual na leitura/gravação de um determinado arquivo.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int fileGetPos ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/POO||[[file]]:getPos|pos|PT-BR/fileSetPos}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' o '''arquivo''' que você deseja obter a posição.&lt;br /&gt;
&lt;br /&gt;
===Retorna===&lt;br /&gt;
Retorna a posição do arquivo, ou ''false'' se tiver ocorrido algum erro (ex.: um '''arquivo''' inválido for especificado).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo abre o arquivo &amp;quot;test.txt&amp;quot; e exibe o seu conteúdo e a posição de leitura atual no console.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local hFile = fileOpen(&amp;quot;test.txt&amp;quot;, true)       -- tentamos abrir o arquivo (em modo leitura)&lt;br /&gt;
if hFile then                                  -- verificamos se foi aberto com sucesso&lt;br /&gt;
    local buffer&lt;br /&gt;
    while not fileIsEOF(hFile) do              -- desde que não estejamos no fim do arquivo...&lt;br /&gt;
        buffer = fileRead(hFile, 500)          -- ... lemos os próximos 500 bytes ...&lt;br /&gt;
        outputConsole(buffer..&amp;quot;Current Position: &amp;quot;..fileGetPos(hFile))                  -- ... então exibimos o conteúdo desta parte e a posição de leitura atual no console&lt;br /&gt;
    end&lt;br /&gt;
    fileClose(hFile)                           -- fechamos o arquivo depois que terminarmos com ele&lt;br /&gt;
else&lt;br /&gt;
    outputConsole(&amp;quot;Unable to open test.txt&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=78707</id>
		<title>FileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetPath&amp;diff=78707"/>
		<updated>2023-12-20T18:43:54Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0153|1.5.3|7446|&lt;br /&gt;
This function retrieves the path of the given file.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:getPath|path}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file you want to get the path.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''string'' representing the file path, ''false'' if invalid file was provided.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                       -- check if the creation succeeded&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path, root, 0, 255, 0)&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileGetPath]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPath&amp;diff=78706</id>
		<title>PT-BR/fileGetPath</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetPath&amp;diff=78706"/>
		<updated>2023-12-20T18:43:51Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}} {{PT-BR/New feature/item|3.0153|1.5.3|7446| Esta função retorna o caminho de um determinado arquivo. }}  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; string fileGetPath ( file theFile ) &amp;lt;/syntaxhighlight&amp;gt; {{PT-BR/POO||file:getPath|path}}  ===Argumentos necessários=== *'''theFile:''' O '''arquivo''' que você quer obter o caminho.  ===Retorno=== Retorna uma ''string'' representando o caminho do arquivo, ''false'' se um arquivo inv...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
{{PT-BR/New feature/item|3.0153|1.5.3|7446|&lt;br /&gt;
Esta função retorna o caminho de um determinado arquivo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fileGetPath ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO||[[file]]:getPath|path}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você quer obter o caminho.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna uma ''string'' representando o caminho do arquivo, ''false'' se um arquivo inválido estiver sido especificado.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Exemplo 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- tentamos criar um arquivo&lt;br /&gt;
if (newFile) then                                       -- verificamos se o arquivo foi criado&lt;br /&gt;
    local path = fileGetPath(newFile)&lt;br /&gt;
    outputChatBox(&amp;quot;New file created at: &amp;quot;..path, root, 0, 255, 0)&lt;br /&gt;
    fileClose(newFile)                                -- fechamos o arquivo depois que trabalharmos com ele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileGetContents&amp;diff=78705</id>
		<title>FileGetContents</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileGetContents&amp;diff=78705"/>
		<updated>2023-12-20T18:30:32Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|21938|&lt;br /&gt;
Reads the entire contents of the file, optionally verifies the read contents by computing and comparing the checksum with the expected one, and returns the content as string. The file cursor position is not modified by calls to this function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Please note that even if you enable SD #22 and #23 on your server, you are not protected from user attacks, which can happen after verification of the file, but before you read the contents of such verified file. This function enables you to safely read the contents of a meta.xml-listed file on both client and server.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:getContents}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' A handle to the file you wish to get the contents from. Use [[fileOpen]] to obtain this handle.&lt;br /&gt;
*'''verifyContents:''' Set to true, to compare the computed and the expected checksum of the file content&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the bytes that were read from the file, but only if verification was disabled or if the checksum comparison succeeded. On failure, this function returns ''nil''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens the code.lua file, checks its contents, and then runs it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local handle = fileOpen(&amp;quot;code.lua&amp;quot;, true)&lt;br /&gt;
local buffer = fileGetContents(handle) -- code.lua must be listed in meta.xml (for example as &amp;lt;file&amp;gt; for this example)&lt;br /&gt;
fileClose(handle)&lt;br /&gt;
&lt;br /&gt;
if buffer then&lt;br /&gt;
    loadstring(buffer)()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileGetContents]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetContents&amp;diff=78704</id>
		<title>PT-BR/fileGetContents</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileGetContents&amp;diff=78704"/>
		<updated>2023-12-20T18:30:27Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  {{PT-BR/Added feature/item|1.6.1|1.6.0|21938| Faz a leitura de todo o conteúdo do arquivo, opcionalmente verifica o arquivo lido calculando e comparando a soma de verificação com o que é esperado, e retorna o conteúdo em formato de ''string''. A posição do cursor (caret) do arquivo não é modificada pelas execuções dessa função. }}  Por favor note que sempre que você habilitar SD #22 e #23 no seu servidor, você não es...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/Added feature/item|1.6.1|1.6.0|21938|&lt;br /&gt;
Faz a leitura de todo o conteúdo do arquivo, opcionalmente verifica o arquivo lido calculando e comparando a soma de verificação com o que é esperado, e retorna o conteúdo em formato de ''string''. A posição do cursor (caret) do arquivo não é modificada pelas execuções dessa função.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Por favor note que sempre que você habilitar SD #22 e #23 no seu servidor, você não estará protegido por ataques, que podem acontecer depois da verificação do arquivo, mas antes de ler o conteúdo de cada arquivo verificado. Essa função te permite, de uma forma segura, ler o conteúdo dos arquivos (que estão listados no meta.xml) tanto no lado client quanto server.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
nil|string fileGetContents ( file theFile [ , bool verifyContents = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO||[[file]]:getContents}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você deseja obter o conteúdo. Use [[PT-BR/fileOpen|fileOpen]] para obter esse '''arquivo'''.&lt;br /&gt;
*'''verifyContents:''' Defina para '''true''', para comparar o cálculo e a soma de verificação esperada do conteúdo do arquivo.&lt;br /&gt;
&lt;br /&gt;
===Retorna===&lt;br /&gt;
Retorna o conteúdo (bytes) que foram lidos do arquivo, mas apenas se a verificação for desabilitada ou se a comparação da soma de verificação tiver sido feita com sucesso. No caso de falha, essa função retorna '''nil'''.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
This example opens the code.lua file, checks its contents, and then runs it.&lt;br /&gt;
Este exemplo abre o arquivo &amp;quot;code.lua&amp;quot;, verifica seu conteúdo e então roda ele.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local handle = fileOpen(&amp;quot;code.lua&amp;quot;, true)&lt;br /&gt;
local buffer = fileGetContents(handle) -- &amp;quot;code.lua&amp;quot; deve estar especificado no meta.xml (por exemplo como &amp;lt;file&amp;gt; para este exemplo)&lt;br /&gt;
fileClose(handle)&lt;br /&gt;
&lt;br /&gt;
if buffer then&lt;br /&gt;
    loadstring(buffer)()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja tammbém==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Added_feature/item&amp;diff=78703</id>
		<title>Template:PT-BR/Added feature/item</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:PT-BR/Added_feature/item&amp;diff=78703"/>
		<updated>2023-12-20T18:17:56Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;&amp;lt;includeonly&amp;gt;{{#ifexpr: ({{{1|}}}) = {{Next Stable Version}} and ({{{2|}}}) = {{Current Stable Version}} |&amp;lt;div style='border: 2px solid #1b2027; border-radius: 10px; margin: 14px 0; overflow: hidden'&amp;gt;&amp;lt;div style='background: #1b2027; color: #fff; font-weight: bold; padding: 4px 8px'&amp;gt;&amp;lt;span style=&amp;quot;color: #fff; text-decoration: underline&amp;quot;&amp;gt;BETA&amp;lt;/span&amp;gt;: NOVO RECURSO (BUILD: {{{2}}} {{r|{{{3}}}}})&amp;lt;/div&amp;gt;&amp;lt;div style='padding: 4px 8px'&amp;gt;{{{4}}}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt; |{{#ifex...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#ifexpr: ({{{1|}}}) = {{Next Stable Version}} and ({{{2|}}}) = {{Current Stable Version}}&lt;br /&gt;
|&amp;lt;div style='border: 2px solid #1b2027; border-radius: 10px; margin: 14px 0; overflow: hidden'&amp;gt;&amp;lt;div style='background: #1b2027; color: #fff; font-weight: bold; padding: 4px 8px'&amp;gt;[[Beta Features|&amp;lt;span style=&amp;quot;color: #fff; text-decoration: underline&amp;quot;&amp;gt;BETA&amp;lt;/span&amp;gt;]]: NOVO RECURSO (BUILD: {{{2}}} {{r|{{{3}}}}})&amp;lt;/div&amp;gt;&amp;lt;div style='padding: 4px 8px'&amp;gt;{{{4}}}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
|{{#ifexpr: {{Next Stable Version}} &amp;gt; ({{{1|}}}) and ({{{1|}}}) = {{Current Stable Version}}&lt;br /&gt;
|&amp;lt;div style='border: 2px solid #232933; border-radius: 10px; margin: 14px 0; overflow: hidden'&amp;gt;&amp;lt;div style='background: #232933; color: #fff; padding: 4px 8px'&amp;gt;* RECURSO ADICIONADO EM {{{1}}} (REVISÃO: {{r|{{{3}}}}})&amp;lt;/div&amp;gt;&amp;lt;div style='padding: 4px 8px'&amp;gt;{{{4}}}&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;[[Category:Changes in {{{1}}}]]&lt;br /&gt;
|{{{4}}}&lt;br /&gt;
}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This template is used for highlighting beta and features introduced in the latest version of MTA: San Andreas. The highlighted appearance will automatically disappear when a newer version is released.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
#Stable version (the stable version the feature will appear in)&lt;br /&gt;
#Beta version (the beta version the feature appeared in)&lt;br /&gt;
#Revision (the build the feature appeared in)&lt;br /&gt;
#Description (the feature main description)&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{PT-BR/Added feature/item&lt;br /&gt;
| stable version&lt;br /&gt;
| beta version&lt;br /&gt;
| revision&lt;br /&gt;
| description&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Current stable version: &amp;lt;span style='color: #0cc'&amp;gt;'''{{Current Stable Version}}'''&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Next stable version: &amp;lt;span style='color: #3b3'&amp;gt;'''{{Next Stable Version}}'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Utility templates]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileFlush&amp;diff=78702</id>
		<title>FileFlush</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileFlush&amp;diff=78702"/>
		<updated>2023-12-20T18:14:20Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Forces pending disk writes to be executed. [[fileWrite]] doesn't directly write to the hard disk but places the data in a temporary buffer; only when there is enough data in the buffer it is actually written to disk. Call this function if you need the data written right now without closing the file. This is useful for log files that might want to be read while the resource is still executing. [[fileFlush]] can be called after each log entry is written. Without this, the file may appear empty or outdated to the user.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileFlush ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[file]]:flush}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theFile:''' The file handle of the file you wish to flush.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if succeeded, ''false'' in case of failure (e.g. the file handle is invalid).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)&lt;br /&gt;
if fileHandle then&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;Line 1&amp;quot;)&lt;br /&gt;
    fileFlush(fileHandle)&lt;br /&gt;
    -- ... further writing operations&lt;br /&gt;
    fileClose(fileHandle)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that [[fileClose]] automatically flushes the file.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileFlush]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileFlush&amp;diff=78701</id>
		<title>PT-BR/fileFlush</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileFlush&amp;diff=78701"/>
		<updated>2023-12-20T18:14:17Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}}  Força a execução de gravações pendentes no disco. fileWrite não grava diretamente no disco, mas coloca os dados em um buffer temporário; só quando existe dados o suficiente nesse buffer é que as informações são gravadas no disco. Execute essa função se você precisar que os dados sejam gravados no instante em que chamar, sem precisar fechar o arquivo que estiver aberto com as gravações pendentes....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Força a execução de gravações pendentes no disco. [[PT-BR/fileWrite|fileWrite]] não grava diretamente no disco, mas coloca os dados em um buffer temporário; só quando existe dados o suficiente nesse buffer é que as informações são gravadas no disco. Execute essa função se você precisar que os dados sejam gravados no instante em que chamar, sem precisar fechar o arquivo que estiver aberto com as gravações pendentes. Isso é útil para ''arquivos de log'' que podem querer ler as informações enquanto o resource ainda estiver rodando. [[PT-BR/fileFlush|fileFlush]] pode ser executado depois que cada parte do log for gravada. Sem isso, o arquivo pode parecer vazio ou dessincronizado para o usuário.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileFlush ( file theFile )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO||[[file]]:flush}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''theFile:''' O '''arquivo''' que você deseja liberar.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true''' se as gravações pendentes tiverem sido liberadas com sucesso, '''false''' no caso de falha (ex.: o '''arquivo''' especificado for inválido).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local fileHandle = fileCreate(&amp;quot;test.txt&amp;quot;)&lt;br /&gt;
if fileHandle then&lt;br /&gt;
    fileWrite(fileHandle, &amp;quot;Line 1&amp;quot;)&lt;br /&gt;
    fileFlush(fileHandle)&lt;br /&gt;
    -- ... outras operações de escrita&lt;br /&gt;
    fileClose(fileHandle)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tenha em mente que o [[PT-BR/fileClose|fileClose]] automaticamente ''libera'' essas gravações pendentes do disco, do arquivo especificado.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileExists&amp;diff=78700</id>
		<title>FileExists</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileExists&amp;diff=78700"/>
		<updated>2023-12-20T17:59:54Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This functions checks whether a specified file exists inside a resource.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileExists ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the File class.|[[File]].exists}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filePath:''' The [[filepath]] of the file, whose existence is going to be checked, in the following format: '''&amp;quot;:resourceName/path&amp;quot;'''. 'resourceName' is the name of the resource the file is checked to be in, and 'path' is the path from the root directory of the resource to the file.&lt;br /&gt;
:For example, if you want to check whether a file named 'myfile.txt' exists in the resource 'mapcreator', it can be done from another resource this way: ''fileExists(&amp;quot;:mapcreator/myfile.txt&amp;quot;)''.&lt;br /&gt;
:If the file, whose existence is going to be checked, is in the current resource, only the file path is necessary, e.g. ''fileExists(&amp;quot;myfile.txt&amp;quot;)''. Note that you must use forward slashes '/' for the folders, backslashes '\' will return false.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the file exists, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks if a file exists in a resource directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkExistingFile(player,cmd,filename,resourcename)&lt;br /&gt;
	if not filename then -- if the player didn't include a filename&lt;br /&gt;
		outputChatBox(&amp;quot;ERROR: Syntax '/checkfile filename resourcename(optional)'.&amp;quot;,player) -- display error&lt;br /&gt;
		return false  -- stop function&lt;br /&gt;
	end&lt;br /&gt;
	if not resourcename then -- if the player didn't specify the resource he wants to check, use current resource&lt;br /&gt;
		resourcename = getResourceName(resource) --every resource has a predefined global variable called resource that contains the resource pointer for that resource, in other words, the value that getThisResource() function returns.&lt;br /&gt;
	else&lt;br /&gt;
		if not getResourceFromName(resourcename) then -- if a resource with that name doesn't exist, output error and stop function&lt;br /&gt;
			outputChatBox(&amp;quot;ERROR: Resource &amp;quot;..resourcename..&amp;quot; doesn't exist.&amp;quot;,player) -- output error message&lt;br /&gt;
			return false -- stop the function here&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- as it hasn't stopped anywhere, we have both correct resourcename and filename&lt;br /&gt;
	local exists = fileExists((&amp;quot;:%s/%s&amp;quot;):format(resourcename,filename)) -- using shorter format of string.format, see StringLibraryTutorial in lua wiki for that&lt;br /&gt;
	if exists then&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q exists&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q doesn't exist&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;exists&amp;quot;,checkExistingFile)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileExists]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileExists&amp;diff=78699</id>
		<title>PT-BR/fileExists</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileExists&amp;diff=78699"/>
		<updated>2023-12-20T17:59:47Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}} Esta função verifica se um determinado arquivo existe em um resource.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileExists ( string filePath ) &amp;lt;/syntaxhighlight&amp;gt; {{PT-BR/POO|Esta é uma função estática abaixo da classe File.|File.exists}}  ===Argumentos necessários=== *'''filePath:''' O caminho do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
Esta função verifica se um determinado arquivo existe em um resource.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileExists ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].exists}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do resource do arquivo que vai estar lá, e '''path''' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
:Por exemplo, se você quiser verificar se um arquivo chamado ''myfile.txt'' existe em um resource chamado ''mapcreator'', poderá ser feito através de um outro resource da seguinte forma: &amp;lt;code&amp;gt;fileExists(&amp;quot;:mapcreator/myfile.txt&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Se o arquivo, que quiser verificar a existência, estiver no resource atual, apenas o caminho do arquivo é necessário, ex.: &amp;lt;code&amp;gt;fileExists(&amp;quot;myfile.txt&amp;quot;)&amp;lt;/code&amp;gt;. Note que você deve usar as ''barras'' &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; para as pastas, se utilizar ''barra inversa'' &amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt; a função vai retornar '''false'''.&lt;br /&gt;
&lt;br /&gt;
===Retorna===&lt;br /&gt;
Retorna '''true''' se o arquivo existir, '''false''' caso contrário.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo verifica se um arquivo existe no diretório de um resource.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkExistingFile(player,cmd,filename,resourcename)&lt;br /&gt;
	if not filename then -- se o jogador não especificar um nome/caminho de arquivo&lt;br /&gt;
		outputChatBox(&amp;quot;ERROR: Syntax '/checkfile filename resourcename(optional)'.&amp;quot;,player) -- exibe um erro&lt;br /&gt;
		return false  -- para a função aqui&lt;br /&gt;
	end&lt;br /&gt;
	if not resourcename then -- se o jogador não especificar o resource que quer verificar, então vamos usar o resource atual&lt;br /&gt;
		resourcename = getResourceName(resource) --todo resource tem uma variável global pré-definida chamada 'resource' que contém o objeto-resource daquele resource que o código estiver rodando, em outras palavras, a mesma coisa que utilizar getThisResource().&lt;br /&gt;
	else&lt;br /&gt;
		if not getResourceFromName(resourcename) then -- se um resource com o nome especificado não existir, será exibido o erro ao jogador e a função para&lt;br /&gt;
			outputChatBox(&amp;quot;ERROR: Resource &amp;quot;..resourcename..&amp;quot; doesn't exist.&amp;quot;,player) -- exibe a mensagem de erro&lt;br /&gt;
			return false -- para a função aqui&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- se a função não tiver parado em algum lugar acima, então teremos o resource e o caminho do arquivo corretos&lt;br /&gt;
	local exists = fileExists((&amp;quot;:%s/%s&amp;quot;):format(resourcename,filename)) -- usando uma forma mais curta de string.format, veja StringLibraryTutorial de Lua para saber mais&lt;br /&gt;
	if exists then&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q exists&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	else&lt;br /&gt;
		outputChatBox((&amp;quot;The file %q in resource %q doesn't exist&amp;quot;):format(filename,resourcename))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;exists&amp;quot;,checkExistingFile)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileDelete&amp;diff=78698</id>
		<title>FileDelete</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileDelete&amp;diff=78698"/>
		<updated>2023-12-20T17:45:35Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Deletes the specified file.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileDelete ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the File class.|[[File]].delete}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''filePath:''' The [[filepath]] of the file to delete in the following format: '''&amp;quot;:resourceName/path&amp;quot;'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.&lt;br /&gt;
:For example, if you want to delete a file name &amp;quot;myFile.txt&amp;quot; in the resource 'fileres', it can be deleted from another resource this way: ''fileDelete(&amp;quot;:fileres/myFile.txt&amp;quot;)''.&lt;br /&gt;
:If the file is in the current resource, only the file path is necessary, e.g. ''fileDelete(&amp;quot;myFile.txt&amp;quot;)''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise (for example if there exists no file with the given name, or it does exist but is in use).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will show us how to create a file &amp;quot;text.txt&amp;quot; spell it &amp;quot;This is a test file!&amp;quot;, Close the file and delete it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- attempt to create a new file&lt;br /&gt;
if (newFile) then                                     -- check if the creation succeeded&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- write a text line&lt;br /&gt;
    fileClose(newFile)                                -- close the file once you're done with it&lt;br /&gt;
    fileDelete(&amp;quot;test.txt&amp;quot;)                            -- delete file&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File_functions}}&lt;br /&gt;
[[pt-br:fileDelete]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileDelete&amp;diff=78697</id>
		<title>PT-BR/fileDelete</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileDelete&amp;diff=78697"/>
		<updated>2023-12-20T17:45:34Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;__NOTOC__ {{BR/Funcao compartilhada}} Deleta um determinado arquivo.  ==Sintaxe== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool fileDelete ( string filePath ) &amp;lt;/syntaxhighlight&amp;gt; {{PT-BR/POO|Esta é uma função estática abaixo da classe File.|File.delete}}  ===Argumentos necessários=== *'''filePath:''' O caminho do arquivo para deletar no seguinte formadt: '''&amp;quot;:resourceName/path&amp;quot;'''. ''resourceName'' é o nome do resource do arquivo que vai estar lá, e ''path''...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
Deleta um determinado arquivo.&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileDelete ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].delete}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo para deletar no seguinte formadt: '''&amp;quot;:resourceName/path&amp;quot;'''. ''resourceName'' é o nome do resource do arquivo que vai estar lá, e ''path'' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
:Por exemplo, se você quiser deletar um arquivo chamado ''myFile.txt'' no resource ''fileres'', então esse arquivo poderá ser deletado através de um outro resource dessa forma: &amp;lt;code&amp;gt;fileDelete(&amp;quot;:fileres/myFile.txt&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Se o arquivo está no resource atual, apenas o caminho do arquivo é necessário, ex.: &amp;lt;code&amp;gt;fileDelete(&amp;quot;myFile.txt&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true''' se deletado com sucesso, '''false''' caso contrário (por exemplo se o arquivo especificado não existir ou se estiver em uso no momento).&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo vai mostrar para nós como criar um arquivo chamado &amp;quot;text.txt&amp;quot; e digitar nele ''&amp;quot;This is a test file!&amp;quot;'', então '''fechamos''' o arquivo e o '''deletamos''':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- criamos o arquivo&lt;br /&gt;
if (newFile) then                                     -- verificamos se foi criado com sucesso&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- escrevemos a linha de texto&lt;br /&gt;
    fileClose(newFile)                                -- fecho o arquivo assim que trabalhar com ele&lt;br /&gt;
    fileDelete(&amp;quot;test.txt&amp;quot;)                            -- deleto o arquivo&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File_functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCopy&amp;diff=78696</id>
		<title>PT-BR/fileCopy</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCopy&amp;diff=78696"/>
		<updated>2023-12-20T17:35:23Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Created page with &amp;quot;{{BR/Funcao compartilhada}} __NOTOC__ Esta função copia um arquivo. {{BR/Nota|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as funções XML.}} {{BR/Tip|Se você não quiser compartilhar o conteúdo do arquivo criado com outros servidores, nomeie o caminho do arquivo com '''@''' no início. Veja a página filepath para entender melhor.}}  ==...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{BR/Funcao compartilhada}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Esta função copia um arquivo.&lt;br /&gt;
{{BR/Nota|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as [[Shared_Scripting_Functions#XML_functions|funções XML]].}}&lt;br /&gt;
{{BR/Tip|Se você não quiser compartilhar o conteúdo do arquivo criado com outros servidores, nomeie o caminho do arquivo com '''@''' no início. Veja a página [[filepath]] para entender melhor.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileCopy ( string filePath, string copyToFilePath [, bool overwrite = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].copy}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
* '''filePath''': O caminho do arquivo que você quer copiar.&lt;br /&gt;
* '''copyToFilePath''': Para onde o arquivo copiado deve ir.&lt;br /&gt;
&lt;br /&gt;
===Argumentos opcionais===&lt;br /&gt;
* '''overwrite''': Se definido para '''true''' esta operação vai sobrescrever o arquivo que já existir no caminho especificado em ''copyToFilePath''.&lt;br /&gt;
&lt;br /&gt;
==Retorno==&lt;br /&gt;
Retorna '''true''' se o arquivo foi copiado com sucesso, do caso contrário retorna '''false''' se o ''filePath'' não existir.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Lado server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo copia um arquivo chamado 'test.txt' e o chama de 'test1.txt'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, function(res)&lt;br /&gt;
    local filePath = &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test.txt&amp;quot;&lt;br /&gt;
    fileCreate(filePath) --cria o arquivo no resource o nomeia como 'test.txt'.&lt;br /&gt;
    if fileCopy(filePath, &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test1.txt&amp;quot;) then&lt;br /&gt;
         outputChatBox(&amp;quot;File was successfully copied!&amp;quot;, root, 0, 100, 0)&lt;br /&gt;
    else&lt;br /&gt;
         outputChatBox(&amp;quot;File was not successfully copied, probably because it doesn't exist.&amp;quot;, root, 100, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Lado client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Este exemplo copia um arquivo chamado 'test.txt' e o chama de 'test1.txt'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function(res)&lt;br /&gt;
    local filePath = &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test.txt&amp;quot;&lt;br /&gt;
    fileCreate(filePath) --cria o arquivo no resource o nomeia como 'test.txt'.&lt;br /&gt;
    if fileCopy(filePath,&amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test1.txt&amp;quot;) then&lt;br /&gt;
         outputChatBox(&amp;quot;File was successfully copied!&amp;quot;, 0, 100, 0)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;File was not successfully copied, probably because it doesn't exist.&amp;quot;, 100, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Requirements|1.3.1|1.3.1}}&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FileCopy&amp;diff=78695</id>
		<title>FileCopy</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FileCopy&amp;diff=78695"/>
		<updated>2023-12-20T17:35:18Z</updated>

		<summary type="html">&lt;p&gt;Lettify: Portuguese version indexed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function copies a file.{{Note|The file functions should not be used to implement configuration files. It is encouraged to use the XML functions for this instead.}}&lt;br /&gt;
{{Tip|If you do not want to share the content of the created file with other servers, prepend the file path with @ (See [[filepath]] for more information)}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool fileCopy ( string filePath, string copyToFilePath [, bool overwrite = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This function is a static function underneath the File class.|[[File]].copy}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''filePath''': The path of the file you want to copy.&lt;br /&gt;
* '''copyToFilePath''': Where to copy the specified file to.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''overwrite''': If set to true it will overwrite a file that already exists at copyToFilePath.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Return true if the file was copied, else false if the 'filePath' doesn't exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example copies a file called 'test.txt' and called it 'test1.txt'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, function(res)&lt;br /&gt;
    local filePath = &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test.txt&amp;quot;&lt;br /&gt;
    fileCreate(filePath) --create the file in this resource and name it 'test.txt'.&lt;br /&gt;
    if fileCopy(filePath, &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test1.txt&amp;quot;) then&lt;br /&gt;
         outputChatBox(&amp;quot;File was successfully copied!&amp;quot;, root, 0, 100, 0)&lt;br /&gt;
    else&lt;br /&gt;
         outputChatBox(&amp;quot;File was not successfully copied, probably because it doesn't exist.&amp;quot;, root, 100, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example copies a file called 'test.txt' and called it 'test1.txt'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, function(res)&lt;br /&gt;
    local filePath = &amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test.txt&amp;quot;&lt;br /&gt;
    fileCreate(filePath) --create the file in this resource and name it 'test.txt'.&lt;br /&gt;
    if fileCopy(filePath,&amp;quot;:&amp;quot;..getResourceName(res)..&amp;quot;/test1.txt&amp;quot;) then&lt;br /&gt;
         outputChatBox(&amp;quot;File was successfully copied!&amp;quot;, 0, 100, 0)&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;File was not successfully copied, probably because it doesn't exist.&amp;quot;, 100, 0, 0)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Requirements|1.3.1|1.3.1}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{File functions}}&lt;br /&gt;
[[pt-br:fileCopy]]&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCreate&amp;diff=78694</id>
		<title>PT-BR/fileCreate</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCreate&amp;diff=78694"/>
		<updated>2023-12-20T17:26:36Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Cria um novo arquivo em um diretório do resource. Se já existir algum arquivo com o nome e caminho especificado, então haverá uma substituição para este novo arquivo vazio criado.&lt;br /&gt;
{{BR/Nota|Para prevenir perdas de memória, certifique que está fechando o arquivo com [[PT-BR/fileClose|fileClose]] depois de aberto e trabalhado com esse arquivo.}}&lt;br /&gt;
{{BR/Nota|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as [[Shared_Scripting_Functions#XML_functions|funções XML]].}}&lt;br /&gt;
{{BR/Tip|Se você não quiser compartilhar o conteúdo do arquivo criado com outros servidores, nomeie o caminho do arquivo com '''@''' no início. Veja a página [[filepath]] para entender melhor.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fileCreate ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].new}}&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/New feature/item|9.0156|1.5.6|11865|&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File. Se usar '''File(...)''' para abrir um arquivo e esse mesmo não existir, então a função tentará criar um novo arquivo.|[[File]].new}}&lt;br /&gt;
|RU}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do resource do arquivo que vai estar lá, e '''path''' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
:Por exemplo, se você quiser criar um arquivo chamado 'meuarquivo.txt' no resource 'mapcreato', isso poderá ser criado de um outro resource desta forma: ''fileCreate(&amp;quot;:mapcreator/meuarquivo.txt&amp;quot;)''&lt;br /&gt;
:Já se o arquivo estiver no resource atual, apenas o caminho é necessário, ex.: ''fileCreate(&amp;quot;meuarquivo.txt&amp;quot;)''&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Se tiver tido sucesso na execução, retorna um '''arquivo''' que poderá ser usado com outras funções do tipo ([[PT-BR/fileWrite|fileWrite]], [[PT-BR/fileClose|fileClose]]...). E retorna '''false''' se algum erro tiver ocorrido.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo cria um arquivo de texto no resource atual e escreve um pequeno texto nele.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- tenta criar um novo arquivo&lt;br /&gt;
if (newFile) then                                       -- verifica se a criação foi um sucesso&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- escreve uma linha de texto&lt;br /&gt;
    fileClose(newFile)                                -- fecha o arquivo assim que terminar de trabalhar nele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observe que você não pode simplesmente fazer isso &amp;lt;code&amp;gt;fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;)&amp;lt;/code&amp;gt;. Em vez disso, as funções que manipulam os arquivos operam na variável '''arquivo''', que é um tipo de ''objeto especial'' representando um arquivo aberto. A função [[PT-BR/fileCreate|fileCreate]] cria um arquivo, abre ele e retorna o resultado deste arquivo.&lt;br /&gt;
&lt;br /&gt;
E também é importante lembrar de fechar um arquivo depois que você finalizar tudo o que precisa fazer nele, especialmente se você está definindo ou escrevendo novos valores nesse arquivo. Se você não fechar o arquivo e o resource travar de alguma forma, todas as mudanças no arquivo podem ser perdidas.&lt;br /&gt;
Se o arquivo já existir, um novo vai ser criado no lugar.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCreate&amp;diff=78693</id>
		<title>PT-BR/fileCreate</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/fileCreate&amp;diff=78693"/>
		<updated>2023-12-20T17:26:20Z</updated>

		<summary type="html">&lt;p&gt;Lettify: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao compartilhada}}&lt;br /&gt;
&lt;br /&gt;
Cria um novo arquivo em um diretório do resource. Se já existir algum arquivo com o nome e caminho especificado, então haverá uma substituição para este novo arquivo vazio criado.&lt;br /&gt;
{{BR/Nota|Para prevenir perdas de memória, certifique que está fechando o arquivo com [[PT-BR/fileClose|fileClose]] depois de aberto e trabalhado com esse arquivo.}}&lt;br /&gt;
{{BR/Nota|As funções que manipulam arquivos não devem ser utilizadas para implementar arquivos de configuração. É recomendado usar as [[Shared_Scripting_Functions#XML_functions|funções XML]].}}&lt;br /&gt;
{{BR/Tip|Se você não quiser compartilhar o conteúdo do arquivo criado com outros servidores, nomeie o caminho do arquivo com '''@''' no início. Veja a página [[filepath]] para entender melhor.}}&lt;br /&gt;
&lt;br /&gt;
==Sintaxe==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
file fileCreate ( string filePath )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File.|[[File]].new}}&lt;br /&gt;
&lt;br /&gt;
{{PT-BR/New feature/item|9.0156|1.5.6|11865|&lt;br /&gt;
{{PT-BR/POO|Esta é uma função estática abaixo da classe File. Se usar '''File(...)''' para abrir um arquivo e esse mesmo não existir, então a função tentará criar um novo arquivo.|[[File]].new}}&lt;br /&gt;
|RU}}&lt;br /&gt;
&lt;br /&gt;
===Argumentos necessários===&lt;br /&gt;
*'''filePath:''' O [[filepath|caminho]] do arquivo a ser criado seguindo o seguinte formato: '''&amp;quot;:resourceName/path&amp;quot;'''. '''resourceName''' é o nome do resource do arquivo que vai estar lá, e '''path''' é o caminho do arquivo relativo ao diretório do resource.&lt;br /&gt;
:Por exemplo, se você quiser criar um arquivo chamado 'meuarquivo.txt' no resource 'mapcreato', isso poderá ser criado de um outro resource desta forma: ''fileCreate(&amp;quot;:mapcreator/meuarquivo.txt&amp;quot;)''&lt;br /&gt;
:Já se o arquivo estiver no resource atual, apenas o caminho é necessário, ex.: ''fileCreate(&amp;quot;meuarquivo.txt&amp;quot;)''&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Se tiver tido sucesso na execução, retorna um '''arquivo''' que poderá ser usado com outras funções do tipo ([[PT-BR/fileWrite|fileWrite]], [[PT-BR/fileClose:fileClose]]...). E retorna '''false''' se algum erro tiver ocorrido.&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
Este exemplo cria um arquivo de texto no resource atual e escreve um pequeno texto nele.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local newFile = fileCreate(&amp;quot;test.txt&amp;quot;)                -- tenta criar um novo arquivo&lt;br /&gt;
if (newFile) then                                       -- verifica se a criação foi um sucesso&lt;br /&gt;
    fileWrite(newFile, &amp;quot;This is a test file!&amp;quot;)        -- escreve uma linha de texto&lt;br /&gt;
    fileClose(newFile)                                -- fecha o arquivo assim que terminar de trabalhar nele&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Observe que você não pode simplesmente fazer isso &amp;lt;code&amp;gt;fileWrite(&amp;quot;test.txt&amp;quot;, &amp;quot;File content&amp;quot;)&amp;lt;/code&amp;gt;. Em vez disso, as funções que manipulam os arquivos operam na variável '''arquivo''', que é um tipo de ''objeto especial'' representando um arquivo aberto. A função [[PT-BR/fileCreate|fileCreate]] cria um arquivo, abre ele e retorna o resultado deste arquivo.&lt;br /&gt;
&lt;br /&gt;
E também é importante lembrar de fechar um arquivo depois que você finalizar tudo o que precisa fazer nele, especialmente se você está definindo ou escrevendo novos valores nesse arquivo. Se você não fechar o arquivo e o resource travar de alguma forma, todas as mudanças no arquivo podem ser perdidas.&lt;br /&gt;
Se o arquivo já existir, um novo vai ser criado no lugar.&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{PT-BR/File functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
</feed>