Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/02/21 in Posts

  1. I always recommend using default MTA variables like root instead of getRootElement() as it’s faster
    1 point
  2. Hello, I wrote some stuff I think it might help you out. local sx, sy = guiGetScreenSize() local progress = 0; local borderY = 0; local animState = 0 local panelTick = getTickCount() function animatePanel() local tick = getTickCount() - panelTick local progress = tick/1000 if progress >= 1 then -- anim finished --togglePanel() -- uncomment if you want it to go back down once the animation finishes end if animState == 1 then borderY = interpolateBetween ( sy/1, 0, 0, sy/1.15, 0, 0, progress, "Linear") else borderY = interpolateBetween ( sy/1.15, 0, 0, sy/1, 0, 0, progress, "Linear") end dxDrawRectangle ( 0, borderY, sx, 100, tocolor(0,0,0,255),false) -- panel end function togglePanel() if animState == 0 then animState = 1 -- opening else animState = 0 -- closing end panelTick = getTickCount() removeEventHandler("onClientRender",getRootElement(),animatePanel) addEventHandler("onClientRender",getRootElement(),animatePanel) end addCommandHandler("tog", togglePanel)
    1 point
  3. Its work. Thank you so much for your help and for your time ??
    1 point
  4. Hello, I assume that this code is meant to be server-sided then this should do the work: function onStartSetStats() for i, player in pairs (getElementsByType("player")) do setPedStat (player, 22, 0) setPedStat (player, 23, 0) outputChatBox("Stats Changed To Default!", player, 255, 0, 0) end end addEventHandler("onResourceStart",resourceRoot,onStartSetStats)
    1 point
  5. A opacidade está sendo aplicada? O negócio da colisão precisa estar atualizando sempre que um novo carro é criado, você precisa desenvolver alguma lógica pra isso - não irei explicar aqui, pois não faz parte do tópico. Mas de qualquer forma, é pra funcionar. Inclusive, este tópico já está com muitas postagens. Dê mais algumas olhadas, faça testes no seu servidor local e afins. Porque pode ser que algo esteja dando conflito no servidor em si, diante aos outros resources. Aplique mais detalhes nas suas respostas, também. Como imagens da pasta onde os arquivos estão, conteúdo do meta.xml, possíveis erros no debugscript 3.
    1 point
  6. O código está funcionando. Fiz os testes. Veja o resultado abaixo: (aquele "Funcionou" ali, é porque o veículo teve o ghostmode ativado com sucesso)
    1 point
  7. Although have no experience with matrix and I'm a noob in mathematics I have found something interesting in python and convert it to Lua, not sure it will work try converting the matrix with this function: function convertRotationMatrixToEulerAngles(matrix) local roll, pitch, yaw = false, false, false; local pi = math.pi; local atan2 = math.atan2; local m_cos = math.cos; local m_sin = math.sin; if matrix then local m11, m12, m13 = matrix[1][1], matrix[1][2], matrix[1][3]; local m21, m22, m23 = matrix[2][1], matrix[2][2], matrix[2][3]; local m31, m32, m33 = matrix[3][1], matrix[3][2], matrix[3][3]; if m31 ~= 1 and m31 ~= -1 then pitch_1 = -1*m_sin(m31); pitch_2 = pi - pitch_1; roll_1 = m_atan2(m32/m_cos(pitch_1), m33/m_cos(pitch_1)); roll_2 = m_atan2(m33/m_cos(pitch_2), m33/m_cos(pitch_2)); yaw_1 = m_atan2(m21/m_cos(pitch_1), m11/m_cos(pitch_1)); yaw_2 = m_atan2(m21/m_cos(pitch_2), m11/m_cos(pitch_2)); pitch = pitch_1; roll = roll_1; yaw = yaw_1; else if m31 == -1 then pitch = pi/2; roll = yaw + m_atan2(m12, m13); else pitch = -pi/2; roll = -1*yaw + m_atan2(-1*m12,-1*m13); end yaw = 0; end roll = roll*180/pi; pitch = pitch*180/pi; yaw = yaw*180/pi; return roll, pitch, yaw; end end It will return (in theory) rotX, rotY, rotZ in degrees Hope that helps!
    1 point
  8. Welcome to the forums @diwalewaleskosko Thread has been moved into the Portuguese programming section, as that's your primary language.
    1 point
  9. Usei o seu código para exemplificar melhor, pois você parece estar começando com scripting. Não há nenhum problema nisso. Inclusive, continue assim pedindo ajuda. Porém, peço que leia a documentação das funções, é de suma importância. Também, tente não copiar códigos. Escreva para que fixe melhor na sua mente como o problema poderia ser resolvido.
    1 point
  10. Lá, no client-side. Também, por favor, verifique os parâmetros da função setElementCollidableWith. Não são apenas dois. Leia a documentação da página de ajuda.
    1 point
  11. Muito bom que tenha conseguido aplicar a opacidade no veículo. ? Agora, sobre a colisão, se você visitar o site da função setElementCollidableWith, verá que é client-side! Isso significa que você deverá usar uma outra função, triggerClientEvent, para executar a colisão lá. Visite o site dela e veja como funciona. Apenas reforçando o seu código acima: source já é o veículo, você não precisa utilizar getPedOccupiedVehicle para obtê-lo novamente. Evite redundâncias.
    1 point
  12. Você está adicionando o evento onClientClick dentro da função que é ativada com onClientRender Apenas adicione-o fora desta função
    1 point
  13. * A taxometer from this resource has been added - https://github.com/DELOFRAM/cloudmta-mta/tree/3842d36b03e6055754d6501330f4a0e7343cc1a7/titan_taximeter * Code improvement and optimization * Improved driving style - better enters curves and turns. * Added higher speed on highways than in the city. * If a taxi is on the road, its "rooster" lights up - if it is standing, the "rooster" does not light * If the taxi is on the road, we will charge you. - if there is an amount to be paid, it will not change. * Vehicle registration is charged on the taxometer. * Get the remaining distance displayed on the taxometer. * Driver's name, currently hard-coded. (value does not change) Big problems: * I have to add more nodes to the route finder because sometimes it chooses the direction of movement wrong sometimes. I don't know if everything is translated well, I don't know English well.
    1 point
  14. The map editor can now remove collisionless world objects, if you toggle "Enable collision patches" in the options. This will also make these models selectable when placed as objects. https://mirror.multitheftauto.com/mtasa/resources/
    1 point
×
×
  • Create New...