Jump to content

Stanley Sathler

MTA Contributors
  • Posts

    563
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Stanley Sathler

  1. Shit Aibo, how you do this? O: Thank you so much, man. You're right, this script is working now. *_* I love you now, haha Thank you so much for all that tried help me too. Each detail posted here was important for my education.
  2. There is the updated code: -- PORTUGUES -- -- Nome: AbrePortoes.lua -- Funcao: automatiza o movimento de portoes -- Autor: Stanley Sathler - Ingame: |MS-13|F|-Sathler -- ENGLISH -- -- Name: OpenGates.lua -- Function: automates the movement of gates -- Author: Stanley Sathler - Ingame: |MS-13|F|-Sathler local portao_interior_1 = getElementByID("portao_interior_1") local portao_interior_2 = getElementByID("portao_interior_2") local posX, posY, posZ = getElementPosition(portao_interior_1) local zona_portao = createColTube(213.0, 1875.0, 12.10, 5.0, 5.0) function AbrePortao(jogador, na_dimensao) moveObject(portao_interior_1, 5000, 216.80000305176, 1875.5999755859, 12.10000038147) moveObject(portao_interior_2, 5000, 211.19999694824, 1875.5999755859, 12.10000038147) outputChatBox("Local 1: "..posX.." | "..posY.." | "..posZ.."", getRootElement()) end addEventHandler("onColShapeHit", zona_portao, AbrePortao) function FechaPortao(jogador, na_dimensao) moveObject(portao_interior_1, 5000, 216.799, 1785.59, 12.10) moveObject(portao_interior_2, 5000, 211.199, 1785.59, 12.10) posX, posY, posZ = getElementPosition(portao_interior_1) outputChatBox("Local 2: "..posX.." | "..posY.." | "..posZ.."", getRootElement()) end addEventHandler("onColShapeLeave", zona_portao, FechaPortao) NOTE: in this code, later of movement the code takes only portao_interior_1 position (because I won't use this part of the code) And here, the part of .map with gates objects: <object id="portao_interior_1" doublesided="true" model="2951" interior="0" dimension="0" posX="216.80000305176" posY="1875.5999755859" posZ="12.10000038147" rotX="0" rotY="0" rotZ="0"></object> <object id="portao_interior_2" doublesided="true" model="2951" interior="0" dimension="0" posX="211.19999694824" posY="1875.5999755859" posZ="12.10000038147" rotX="0" rotY="0" rotZ="0"></object>
  3. Hey guys, calm down! What is this? This is a forum, a comunnity. - I've working in the code and I'm right: the gate is moving in y position, and not in x. I use a getElementPosition for see the inicial position of the gate. And use an outputChatBox() for show the position later of movement. The X is the same of the initial, but the Y is: 1802.511. I'm lost ):
  4. I tried change the "z" position instead of "y" but it didn't work too. I tried use createObject() but it didn't work too [2]. The gates were not created. I think that problem is in moveObject() or in getElementByID(). Anyone can help me? ):
  5. Hi again, guys. How you can see, I'm still trying make something with Lua. Yeah, that's hard for me. I'm trying make a "gate movement". So I maked this code: -- PORTUGUES -- -- Nome: AbrePortoes.lua -- Funcao: automatiza o movimento de portoes -- Autor: Stanley Sathler - Ingame: |MS-13|F|-Sathler -- ENGLISH -- -- Name: OpenGates.lua -- Function: automates the movement of gates -- Author: Stanley Sathler - Ingame: |MS-13|F|-Sathler local portao_interior_1 = getElementByID("portao_interior_1") local portao_interior_2 = getElementByID("portao_interior_2") local zona_portao = createColTube(213.0, 1875.0, 12.10, 5.0, 5.0) function AbrePortao(jogador, na_dimensao) moveObject(portao_interior_1, 3000, 219.899, 1785.59, 12.10) moveObject(portao_interior_2, 3000, 207.699, 1785.59, 12.10) end addEventHandler("onColShapeHit", zona_portao, AbrePortao) function FechaPortao(jogador, na_dimensao) moveObject(portao_interior_1, 3000, 216.799, 1785.59, 12.10) moveObject(portao_interior_2, 3000, 211.199, 1785.59, 12.10) end addEventHandler("onColShapeLeave", zona_portao, FechaPortao) The objective is move the gate by side (your original position is the same of the indicated on "FechaPortao()" function). But he's moving to the bottom of the map (y position), and not x position. Anyone knows what I do? ): Thank you for attention, Stanley Sathler.
  6. Solidsnake, thank you very much. You're clear with your answer, I like that. Hugs, Stanley Sathler.
  7. Hi guys, Can I use onMarkerHit with a marker created in Map Editor or I must use only createMarker() for this? If so, how can I use? Thank you, Sathler.
  8. Hi guys, 1st: sorry for my bad english. I'll try be the more clear possible. My question is simple: can I use more than one event for call the same function? Example: function FirstFunction() ... function code here end addEventHandler("onPlayerJoin", getRootElement, FirstFunction) addEventHandler("onPlayerWasted", getRootElement, FirstFunction) Sorry for the ignorance. I'm trying learn Lua (in MTA) but it's a little hard. And my english isn't so good. Thanks for attention, Stanley Sathler.
  9. Convenhamos que a intenção é boa, mas infelizmente a tradução do Google Tradutor deixa a desejar. Sem querer fazer spam, mas segue abaixo um tutorial (baseado neste original) com minha tradução. Acho eu que esta esteja melhor explicada: http://mtasabrasil.com.br/index.php?showtopic=20 Um abraço, Stanley Sathler.
  10. Olá pessoal, Gostaria através desta postagem divulgar o MTA:SA Brasil (http://mtasabrasil.com.br). Este é um fórum relacionado ao MTA (logo, não possui qualquer rivalidade com o fórum original https://mtasa.com). Nele temos como objetivo abordar, além da documentação do MTA traduzida, qualquer conteúdo relacionado ao MTA utilizando a linguagem portuguesa. Isso para facilitar todos aqueles brasileiros/portugueses que queiram aprender mais sobre o MTA. O fórum é novo e por este motivo possui pouquíssimos membros. Logo, gostaria de pedí-los que o divulgassem também. Um forte abraço, Stanley Sathler http://mtasabrasil.com.br
×
×
  • Create New...