<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PT-BR/setElementPosition?action=history&amp;feed=atom</id>
	<title>PT-BR/setElementPosition - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PT-BR/setElementPosition?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;action=history"/>
	<updated>2026-05-25T12:18:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82441&amp;oldid=prev</id>
		<title>Lettify: Lettify moved page BR-PT/setElementPosition to PT-BR/setElementPosition: Wrongly titled during creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82441&amp;oldid=prev"/>
		<updated>2025-09-06T00:02:05Z</updated>

		<summary type="html">&lt;p&gt;Lettify moved page &lt;a href=&quot;/wiki/BR-PT/setElementPosition&quot; class=&quot;mw-redirect&quot; title=&quot;BR-PT/setElementPosition&quot;&gt;BR-PT/setElementPosition&lt;/a&gt; to &lt;a href=&quot;/wiki/PT-BR/setElementPosition&quot; title=&quot;PT-BR/setElementPosition&quot;&gt;PT-BR/setElementPosition&lt;/a&gt;: Wrongly titled during creation&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:02, 6 September 2025&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-82439:rev-82441 --&gt;
&lt;/table&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82439&amp;oldid=prev</id>
		<title>Lettify: Translation to Brazilian Portuguese</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/setElementPosition&amp;diff=82439&amp;oldid=prev"/>
		<updated>2025-09-05T23:59:06Z</updated>

		<summary type="html">&lt;p&gt;Translation to Brazilian Portuguese&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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>
</feed>