PashaBiceps Posted December 17, 2020 Share 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. Link to comment
Other Languages Moderators Lord Henry Posted December 17, 2020 Other Languages Moderators Share Posted December 17, 2020 Painéis em DX precisam ser ativados com um evento onClientRender para se manterem visíveis na tela. 1 Link to comment
PashaBiceps Posted December 17, 2020 Author Share Posted December 17, 2020 Resolvido! Obrigado! Link to comment
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