PashaBiceps Posted December 17, 2020 Posted December 17, 2020 for i = 1, #peds do ped = createPed(peds[i][1], peds[i][3], peds[i][4], peds[i][5]) setElementRotation(ped, 0, 0, peds[i][6]) setElementData(ped, "name", peds[i][2], true) setElementInterior (ped, 6) setElementDimension (ped, 90) setPedAnimation ( ped, "ped", "IDLE_CHAT", 1 ) end function clickPed(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (clickedElement) and (getElementType(clickedElement) == "ped" ) then local x, y, z = getElementPosition(getLocalPlayer()) local wx, wy, wz = getElementPosition(clickedElement) local jij = getLocalPlayer() if (getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3) and (button == "left") and (state == "down" ) then local ped = getElementData(clickedElement, "name") if (ped=="John") then Dx_Posto () end end end end addEventHandler("onClientClick", getRootElement(), clickPed, true) Bom eu coloquei isso, e está tudo funcional porém ao clicar no ped o painel "Dx_Posto" aparece e some no mesmo instante. Gostaria de solicitar ajuda.
Moderators Lord Henry Posted December 17, 2020 Moderators Posted December 17, 2020 Painéis em DX precisam ser ativados com um evento onClientRender para se manterem visíveis na tela. 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now