#DaNiLiN Posted May 14, 2018 Share Posted May 14, 2018 Gente Gostaria de saber como adiciono priv acl por marker Ex: O player entra no marker mais não conseguir abrir o painel que está no marker Link to comment
DNL291 Posted May 15, 2018 Share Posted May 15, 2018 "onMarkerHit" getAccountName getPlayerAccount isObjectInACLGroup aclGetGroup triggerClientEvent Client addEvent addEventHandler guiSetVisible Link to comment
Other Languages Moderators Lord Henry Posted May 15, 2018 Other Languages Moderators Share Posted May 15, 2018 (edited) server: theMarker = createMarker ("o marker que vc criou") addEventHandler ("onMarkerHit", theMarker, function (hitElement) if hitElement and getElementType (hitElement) == "player" then local account = getAccountName (getPlayerAccount (hitElement)) if isObjectInACLGroup ("user."..account, aclGetGroup ("NOME DA ACL GROUP PERMITIDA")) then triggerClientEvent (hitElement, "ativaPainel", hitElement) end end end) client: janelaPainel = guiCreateWindow ("crie seu painel GUI e seus elementos") guiSetVisible (janelaPainel, false) addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), function () guiSetVisible (janelaPainel, true) showCursor (true) end) Se tiver dúvidas quanto a sintaxe de alguma função, leia a Wiki dela. Edited May 15, 2018 by Lord Henry Link to comment
#DaNiLiN Posted May 15, 2018 Author Share Posted May 15, 2018 9 hours ago, Lord Henry said: server: theMarker = createMarker ("o marker que vc criou") addEventHandler ("onMarkerHit", theMarker, function (hitElement) if hitElement and getElementType (hitElement) == "player" then local account = getAccountName (getPlayerAccount (hitElement)) if isObjectInACLGroup ("user."..account, aclGetGroup ("NOME DA ACL GROUP PERMITIDA")) then triggerClientEvent (hitElement, "ativaPainel", hitElement) end end end) client: janelaPainel = guiCreateWindow ("crie seu painel GUI e seus elementos") guiSetVisible (janelaPainel, false) addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), function () guiSetVisible (janelaPainel, true) showCursor (true) end) Se tiver dúvidas quanto a sintaxe de alguma função, leia a Wiki dela. Lord Ajudo Bastante, mais no caso seria 1 painel com botões e drawdx, eu usaria essas mesma funções? Link to comment
Other Languages Moderators Lord Henry Posted May 16, 2018 Other Languages Moderators Share Posted May 16, 2018 (edited) 4 hours ago, danilin said: Lord Ajudo Bastante, mais no caso seria 1 painel com botões e drawdx, eu usaria essas mesma funções? No server sim. No client não. Pois o painel DX precisa ser chamado a cada frame pra se manter na tela. Dai vc precisará de uma função onClientRender pra funcionar em vez do guiSetVisible. Edited May 16, 2018 by Lord Henry Link to comment
#DaNiLiN Posted May 16, 2018 Author Share Posted May 16, 2018 (edited) 20 hours ago, Lord Henry said: server: 7 hours ago, Lord Henry said: No server sim. No client não. Pois o painel DX precisa ser chamado a cada frame pra se manter na tela. Dai vc precisará de uma função onClientRender pra funcionar em vez do guiSetVisible. client: janelaPainel = guiCreateWindow ("crie seu painel GUI e seus elementos") guiSetVisible (janelaPainel, false) addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), function () guiSetVisible (janelaPainel, true) showCursor (true) end) Se tiver dúvidas quanto a sintaxe de alguma função, leia a Wiki dela. No meu client tá assim. sem ta privado. ai aparece a Dx function draw() base = dxDrawRectangle(422, 221, 353, 360, tocolor(0, 0, 0, 160), false) dxDrawRectangle(422, 187, 353, 34, tocolor(0, 0, 0, 230), false) dxDrawText("Favelas da CMD", 484, 192, 765, 216, tocolor(255, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(440, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Chapadão dxDrawRectangle(565, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Salgueiro dxDrawRectangle(677, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Penha dxDrawRectangle(440, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir1 dxDrawRectangle(565, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir2 dxDrawRectangle(677, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Alemão dxDrawRectangle(440, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir3 dxDrawRectangle(565, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir4 dxDrawRectangle(678, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir5 dxDrawRectangle(565, 412, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir6 dxDrawRectangle(567, 528, 83, 31, tocolor(255, 1, 1, 255), false) --- Close dxDrawText("Chapadão", 451, 261, 496, 276, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Salgueiro", 580, 262, 629, 278, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Penha", 699, 263, 748, 279, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve1", 462, 314, 511, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve2", 587, 314, 636, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Alemão", 695, 315, 744, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve3", 462, 367, 511, 383, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve4", 590, 368, 639, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve5", 699, 368, 748, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve6", 589, 419, 638, 435, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Fechar", 589, 536, 638, 552, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) showCursor (true) end ---- Botões button = guiCreateButton(440, 254, 83, 31, "Chapadão", false) button2 = guiCreateButton(565, 254, 83, 31, "Salgueiro", false) button3 = guiCreateButton(677, 254, 83, 31, "Penha", false) button4 = guiCreateButton(440, 307, 83, 31, "Abrir1", false) button5 = guiCreateButton(565, 307, 83, 31, "Abrir2", false) button6 = guiCreateButton(677, 307, 83, 31, "Alemão", false) button7 = guiCreateButton(440, 360, 83, 31, "Breve3", false) button8 = guiCreateButton(565, 360, 83, 31, "Breve4", false) button9 = guiCreateButton(678, 360, 83, 31, "Breve5", false) button11 = guiCreateButton(565, 412, 83, 31, "Breve6", false) button10 = guiCreateButton(567, 528, 83, 31, "Close", false) guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) local drawingPanel = false; function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) drawingPanel = true; showCursor(true) else removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) drawingPanel = false; showCursor(false) end end addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer then count = 10 addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) guiSetVisible(button2, true) guiSetVisible(button3, true) guiSetVisible(button4, true) guiSetVisible(button5, true) guiSetVisible(button6, true) guiSetVisible(button7, true) guiSetVisible(button8, true) guiSetVisible(button9, true) guiSetVisible(button11, true) guiSetVisible(button10, true) guiSetAlpha(button, 0) guiSetAlpha(button2, 0) guiSetAlpha(button3, 0) guiSetAlpha(button4, 0) guiSetAlpha(button5, 0) guiSetAlpha(button6, 0) guiSetAlpha(button7, 0) guiSetAlpha(button8, 0) guiSetAlpha(button9, 0) guiSetAlpha(button11, 0) guiSetAlpha(button10, 0) showCursor(true) end end ) addEventHandler("onClientGUIClick",button10,function() if ( source == button10) then removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) showCursor(false) end end ) addEventHandler("onClientGUIClick",button,function() if ( source == button) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2604.05981, -515.63080, 91.06875 ) outputChatBox("Foi para Complexo do chapadao",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button2,function() if ( source == button2) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2257.93848, -82.98331, 26.52718 ) outputChatBox("Foi para vila kenedy na salgueiro",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button3,function() if ( source == button3) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 1311.90369, -1971.93005, 51.46875 ) outputChatBox("Foi para o morro da Penha",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button4,function() if ( source == button4) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2036.68323, -1408.72253, 17.16406 ) outputChatBox("FAVELA AQUI1.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button5,function() if ( source == button5) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2037.74121, -1430.70630, 16.99219 ) outputChatBox("FAVELA AQUI2.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button6,function() if ( source == button6) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2473.34692, -900.75824, 115.17656 ) outputChatBox("Foi Pro Morro Do Alemão.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button7,function() if ( source == button7) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2027.36816, -1420.52002, 16.99219 ) outputChatBox("FAVELA3 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button8,function() if ( source == button8) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2030.99146, -1433.26086, 17.14842 ) outputChatBox("FAVELA4 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button9,function() if ( source == button9) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2009.01660, -1418.11768, 16.99219 ) outputChatBox("FAVELA5 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button11,function() if ( source == button11) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 1997.70728, -1445.59009, 13.56213 ) outputChatBox("FAVELA6 AQUI.",255,0,0,LocalPlayer) end end ) Client com priv --- BOTÕES button = guiCreateButton(440, 254, 83, 31, "Chapadão", false) button2 = guiCreateButton(565, 254, 83, 31, "Salgueiro", false) button3 = guiCreateButton(677, 254, 83, 31, "Penha", false) button4 = guiCreateButton(440, 307, 83, 31, "Abrir1", false) button5 = guiCreateButton(565, 307, 83, 31, "Abrir2", false) button6 = guiCreateButton(677, 307, 83, 31, "Alemão", false) button7 = guiCreateButton(440, 360, 83, 31, "Breve3", false) button8 = guiCreateButton(565, 360, 83, 31, "Breve4", false) button9 = guiCreateButton(678, 360, 83, 31, "Breve5", false) button11 = guiCreateButton(565, 412, 83, 31, "Breve6", false) button10 = guiCreateButton(567, 528, 83, 31, "Close", false) --- INVISIVEL guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), function () guiSetVisible (button, true) guiSetVisible (button2, true) guiSetVisible (button3, true) guiSetVisible (button4, true) guiSetVisible (button5, true) guiSetVisible (button6, true) guiSetVisible (button7, true) guiSetVisible (button8, true) guiSetVisible (button9, true) guiSetVisible (button10, true) guiSetVisible (button11, true) showCursor (true) end) function draw() base = dxDrawRectangle(422, 221, 353, 360, tocolor(0, 0, 0, 160), false) dxDrawRectangle(422, 187, 353, 34, tocolor(0, 0, 0, 230), false) dxDrawText("Favelas da CMD", 484, 192, 765, 216, tocolor(255, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(440, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Chapadão dxDrawRectangle(565, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Salgueiro dxDrawRectangle(677, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Penha dxDrawRectangle(440, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir1 dxDrawRectangle(565, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir2 dxDrawRectangle(677, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Alemão dxDrawRectangle(440, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir3 dxDrawRectangle(565, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir4 dxDrawRectangle(678, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir5 dxDrawRectangle(565, 412, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir6 dxDrawRectangle(567, 528, 83, 31, tocolor(255, 1, 1, 255), false) --- Close dxDrawText("Chapadão", 451, 261, 496, 276, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Salgueiro", 580, 262, 629, 278, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Penha", 699, 263, 748, 279, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve1", 462, 314, 511, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve2", 587, 314, 636, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Alemão", 695, 315, 744, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve3", 462, 367, 511, 383, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve4", 590, 368, 639, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve5", 699, 368, 748, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve6", 589, 419, 638, 435, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Fechar", 589, 536, 638, 552, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) showCursor (true) end ---- Botões button = guiCreateButton(440, 254, 83, 31, "Chapadão", false) button2 = guiCreateButton(565, 254, 83, 31, "Salgueiro", false) button3 = guiCreateButton(677, 254, 83, 31, "Penha", false) button4 = guiCreateButton(440, 307, 83, 31, "Abrir1", false) button5 = guiCreateButton(565, 307, 83, 31, "Abrir2", false) button6 = guiCreateButton(677, 307, 83, 31, "Alemão", false) button7 = guiCreateButton(440, 360, 83, 31, "Breve3", false) button8 = guiCreateButton(565, 360, 83, 31, "Breve4", false) button9 = guiCreateButton(678, 360, 83, 31, "Breve5", false) button11 = guiCreateButton(565, 412, 83, 31, "Breve6", false) button10 = guiCreateButton(567, 528, 83, 31, "Close", false) guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) local drawingPanel = false; function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) drawingPanel = true; showCursor(true) else removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) drawingPanel = false; showCursor(false) end end addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer then count = 10 addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) guiSetVisible(button2, true) guiSetVisible(button3, true) guiSetVisible(button4, true) guiSetVisible(button5, true) guiSetVisible(button6, true) guiSetVisible(button7, true) guiSetVisible(button8, true) guiSetVisible(button9, true) guiSetVisible(button11, true) guiSetVisible(button10, true) guiSetAlpha(button, 0) guiSetAlpha(button2, 0) guiSetAlpha(button3, 0) guiSetAlpha(button4, 0) guiSetAlpha(button5, 0) guiSetAlpha(button6, 0) guiSetAlpha(button7, 0) guiSetAlpha(button8, 0) guiSetAlpha(button9, 0) guiSetAlpha(button11, 0) guiSetAlpha(button10, 0) showCursor(true) end end ) addEventHandler("onClientGUIClick",button10,function() if ( source == button10) then removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) showCursor(false) end end ) addEventHandler("onClientGUIClick",button,function() if ( source == button) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2604.05981, -515.63080, 91.06875 ) outputChatBox("Foi para Complexo do chapadao",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button2,function() if ( source == button2) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2257.93848, -82.98331, 26.52718 ) outputChatBox("Foi para vila kenedy na salgueiro",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button3,function() if ( source == button3) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 1311.90369, -1971.93005, 51.46875 ) outputChatBox("Foi para o morro da Penha",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button4,function() if ( source == button4) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2036.68323, -1408.72253, 17.16406 ) outputChatBox("FAVELA AQUI1.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button5,function() if ( source == button5) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2037.74121, -1430.70630, 16.99219 ) outputChatBox("FAVELA AQUI2.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button6,function() if ( source == button6) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2473.34692, -900.75824, 115.17656 ) outputChatBox("Foi Pro Morro Do Alemão.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button7,function() if ( source == button7) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2027.36816, -1420.52002, 16.99219 ) outputChatBox("FAVELA3 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button8,function() if ( source == button8) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2030.99146, -1433.26086, 17.14842 ) outputChatBox("FAVELA4 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button9,function() if ( source == button9) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 2009.01660, -1418.11768, 16.99219 ) outputChatBox("FAVELA5 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button11,function() if ( source == button11) then showCursor(false) removeEventHandler("onClientPreRender", getRootElement(), draw); setElementPosition ( getLocalPlayer(), 1997.70728, -1445.59009, 13.56213 ) outputChatBox("FAVELA6 AQUI.",255,0,0,LocalPlayer) end end ) No caso eu querria privar mais a dx aparecer. Edited May 16, 2018 by DNL291 ... Link to comment
DNL291 Posted May 16, 2018 Share Posted May 16, 2018 (edited) Próxima vez clique no botão <> e formate o código com a linguagem Lua. Pelo que vi no seu código, tem alguns erros, como repetição das funções e showCursor dentro da função draw, que será chamada a cada frame (fora toda a gambiarra que é feito os botões). Sobre as markers eu não entendi como funciona, já que você não incluiu no código. Se o evento "onClientMarkerHit" for o que você usa para abrir o painel, então você vai ter que tirar ele e reescrever para receber a chamada do server e mostrar o DX. - Editei o código pra você, tente o seguinte: client local g_isDxShowing = false function draw() dxDrawRectangle(422, 221, 353, 360, tocolor(0, 0, 0, 160), false) dxDrawRectangle(422, 187, 353, 34, tocolor(0, 0, 0, 230), false) dxDrawText("Favelas da CMD", 484, 192, 765, 216, tocolor(255, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(440, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Chapadão dxDrawRectangle(565, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Salgueiro dxDrawRectangle(677, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Penha dxDrawRectangle(440, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir1 dxDrawRectangle(565, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir2 dxDrawRectangle(677, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Alemão dxDrawRectangle(440, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir3 dxDrawRectangle(565, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir4 dxDrawRectangle(678, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir5 dxDrawRectangle(565, 412, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir6 dxDrawRectangle(567, 528, 83, 31, tocolor(255, 1, 1, 255), false) --- Close dxDrawText("Chapadão", 451, 261, 496, 276, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Salgueiro", 580, 262, 629, 278, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Penha", 699, 263, 748, 279, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve1", 462, 314, 511, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve2", 587, 314, 636, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Alemão", 695, 315, 744, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve3", 462, 367, 511, 383, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve4", 590, 368, 639, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve5", 699, 368, 748, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve6", 589, 419, 638, 435, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Fechar", 589, 536, 638, 552, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end addEventHandler("onClientResourceStart", resourceRoot, function() ---- Botões button = guiCreateButton(440, 254, 83, 31, "Chapadão", false) button2 = guiCreateButton(565, 254, 83, 31, "Salgueiro", false) button3 = guiCreateButton(677, 254, 83, 31, "Penha", false) button4 = guiCreateButton(440, 307, 83, 31, "Abrir1", false) button5 = guiCreateButton(565, 307, 83, 31, "Abrir2", false) button6 = guiCreateButton(677, 307, 83, 31, "Alemão", false) button7 = guiCreateButton(440, 360, 83, 31, "Breve3", false) button8 = guiCreateButton(565, 360, 83, 31, "Breve4", false) button9 = guiCreateButton(678, 360, 83, 31, "Breve5", false) button11 = guiCreateButton(565, 412, 83, 31, "Breve6", false) button10 = guiCreateButton(567, 528, 83, 31, "Close", false) guiSetAlpha(button, 0) guiSetAlpha(button2, 0) guiSetAlpha(button3, 0) guiSetAlpha(button4, 0) guiSetAlpha(button5, 0) guiSetAlpha(button6, 0) guiSetAlpha(button7, 0) guiSetAlpha(button8, 0) guiSetAlpha(button9, 0) guiSetAlpha(button11, 0) guiSetAlpha(button10, 0) guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button8, false) guiSetVisible(button9, false) guiSetVisible(button11, false) guiSetVisible(button10, false) end) addEvent( "onRequestOpenTeleportPanel", true ) addEventHandler( "onRequestOpenTeleportPanel", root, function() if g_isDxShowing ~= true then setDXPanelVisible( true ) end end ) addEventHandler("onClientGUIClick",button10,function() if ( source == button10) then setDXPanelVisible( false ) end end ) function setDXPanelVisible( bool ) if type(bool) == "boolean" then _G[ (bool and "add" or "remove").."EventHandler" ]( "onClientRender", root, draw ) ativaPainel( bool ) showCursor( bool ) g_isDxShowing = bool end end addEventHandler("onClientGUIClick",button,function() if ( source == button) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2604.05981, -515.63080, 91.06875 ) outputChatBox("Foi para Complexo do chapadao",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button2,function() if ( source == button2) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2257.93848, -82.98331, 26.52718 ) outputChatBox("Foi para vila kenedy na salgueiro",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button3,function() if ( source == button3) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 1311.90369, -1971.93005, 51.46875 ) outputChatBox("Foi para o morro da Penha",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button4,function() if ( source == button4) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2036.68323, -1408.72253, 17.16406 ) outputChatBox("FAVELA AQUI1.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button5,function() if ( source == button5) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2037.74121, -1430.70630, 16.99219 ) outputChatBox("FAVELA AQUI2.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button6,function() if ( source == button6) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2473.34692, -900.75824, 115.17656 ) outputChatBox("Foi Pro Morro Do Alemão.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button7,function() if ( source == button7) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2027.36816, -1420.52002, 16.99219 ) outputChatBox("FAVELA3 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button8,function() if ( source == button8) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2030.99146, -1433.26086, 17.14842 ) outputChatBox("FAVELA4 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button9,function() if ( source == button9) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 2009.01660, -1418.11768, 16.99219 ) outputChatBox("FAVELA5 AQUI.",255,0,0,LocalPlayer) end end ) addEventHandler("onClientGUIClick",button11,function() if ( source == button11) then setDXPanelVisible( false ) setElementPosition ( getLocalPlayer(), 1997.70728, -1445.59009, 13.56213 ) outputChatBox("FAVELA6 AQUI.",255,0,0,LocalPlayer) end end ) function ativaPainel( bool) if bool then guiSetVisible (button, true) guiSetVisible (button2, true) guiSetVisible (button3, true) guiSetVisible (button4, true) guiSetVisible (button5, true) guiSetVisible (button6, true) guiSetVisible (button7, true) guiSetVisible (button8, true) guiSetVisible (button9, true) guiSetVisible (button10, true) guiSetVisible (button11, true) elseif bool == false then for _, btn in pairs({button, button2, button3, button4, button5, button6, button7, button8, button9, button10, button11}) do guiSetVisible( btn, false ) end end end server addEventHandler( "onMarkerHit", marker, function (hitPlayer, mdim) if getElementType(hitPlayer) ~= "player" then return end local acc = getPlayerAccount(hitPlayer) if not isGuestAccount(acc) then if isObjectInACLGroup( "user." .. getAccountName(acc), aclGetGroup( "admin" ) ) then triggerClientEvent( hitPlayer, "onRequestOpenTeleportPanel", hitPlayer ) end end end ) Antes de testar, ative o debug - /debugscript 3. E lembre-se de criar a marca no arquivo do lado server. Edited May 16, 2018 by DNL291 Link to comment
Other Languages Moderators Lord Henry Posted May 16, 2018 Other Languages Moderators Share Posted May 16, 2018 (edited) 16 hours ago, danilin said: No meu client tá assim. sem ta privado. ai aparece a Dx Nossa, que gambiarra maluca que vc fez aí. Está usando elementos GUI em painel DX, dai fica bem complicado mesmo. Eu recomendaria fazer tudo em GUI que é mais fácil. Como eu disse, os elementos DX precisam ser criados a cada frame usando o onClientRender para permanecerem na tela, pois no frame seguinte eles desaparecem. Já os elementos GUI só devem ser criados 1 vez. As funções de chamada são feitas 1 vez, vc deve mostrar o mouse 1 vez, vc deve ativar o painel 1 vez. Por isso que é mais fácil o painel GUI. Mas farei um exemplo que ativa um painel DX pelo marker: server: (exatamente igual ao exemplo anterior) theMarker = createMarker ("o marker que vc criou") addEventHandler ("onMarkerHit", theMarker, function (hitElement) if hitElement and getElementType (hitElement) == "player" then local account = getAccountName (getPlayerAccount (hitElement)) if isObjectInACLGroup ("user."..account, aclGetGroup ("NOME DA ACL GROUP PERMITIDA")) then triggerClientEvent (hitElement, "ativaPainel", hitElement) end end end) client: (aqui muda tudo) function drawDX() dxDrawRectangle(422, 221, 353, 360, tocolor(0, 0, 0, 160), false) dxDrawRectangle(422, 187, 353, 34, tocolor(0, 0, 0, 230), false) dxDrawText("Favelas da CMD", 484, 192, 765, 216, tocolor(255, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(440, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Chapadão dxDrawRectangle(565, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Salgueiro dxDrawRectangle(677, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Penha dxDrawRectangle(440, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir1 dxDrawRectangle(565, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir2 dxDrawRectangle(677, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Alemão dxDrawRectangle(440, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir3 dxDrawRectangle(565, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir4 dxDrawRectangle(678, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir5 dxDrawRectangle(565, 412, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir6 dxDrawRectangle(567, 528, 83, 31, tocolor(255, 1, 1, 255), false) --- Close dxDrawText("Chapadão", 451, 261, 496, 276, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Salgueiro", 580, 262, 629, 278, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Penha", 699, 263, 748, 279, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve1", 462, 314, 511, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve2", 587, 314, 636, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Alemão", 695, 315, 744, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve3", 462, 367, 511, 383, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve4", 590, 368, 639, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve5", 699, 368, 748, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve6", 589, 419, 638, 435, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Fechar", 589, 536, 638, 552, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end local isDxShowing = false function gerenciaPainel () if not isDxShowing then addEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (true) isDxShowing = true else removeEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (false) isDxShowing = false end end addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), gerenciaPainel) addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 567 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. end end end) É claro que, por se tratar de um elemento DX e não GUI, vc deve usar onClientClick e não onClientGUIClick. Obtendo a coordenada clicada e verificando se essa coordenada está dentro do botão de fechar, para executar a função de fechar o painel. Edited May 16, 2018 by Lord Henry Link to comment
#DaNiLiN Posted May 17, 2018 Author Share Posted May 17, 2018 3 hours ago, Lord Henry said: Nossa, que gambiarra maluca que vc fez aí. Está usando elementos GUI em painel DX, dai fica bem complicado mesmo. Eu recomendaria fazer tudo em GUI que é mais fácil. Como eu disse, os elementos DX precisam ser criados a cada frame usando o onClientRender para permanecerem na tela, pois no frame seguinte eles desaparecem. Já os elementos GUI só devem ser criados 1 vez. As funções de chamada são feitas 1 vez, vc deve mostrar o mouse 1 vez, vc deve ativar o painel 1 vez. Por isso que é mais fácil o painel GUI. Mas farei um exemplo que ativa um painel DX pelo marker: server: (exatamente igual ao exemplo anterior) theMarker = createMarker ("o marker que vc criou")addEventHandler ("onMarkerHit", theMarker, function (hitElement) if hitElement and getElementType (hitElement) == "player" then local account = getAccountName (getPlayerAccount (hitElement)) if isObjectInACLGroup ("user."..account, aclGetGroup ("NOME DA ACL GROUP PERMITIDA")) then triggerClientEvent (hitElement, "ativaPainel", hitElement) end endend) client: (aqui muda tudo) function drawDX() dxDrawRectangle(422, 221, 353, 360, tocolor(0, 0, 0, 160), false) dxDrawRectangle(422, 187, 353, 34, tocolor(0, 0, 0, 230), false) dxDrawText("Favelas da CMD", 484, 192, 765, 216, tocolor(255, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(440, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Chapadão dxDrawRectangle(565, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Salgueiro dxDrawRectangle(677, 254, 83, 31, tocolor(255, 1, 1, 255), false) --- Penha dxDrawRectangle(440, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir1 dxDrawRectangle(565, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir2 dxDrawRectangle(677, 307, 83, 31, tocolor(255, 1, 1, 255), false) --- Alemão dxDrawRectangle(440, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir3 dxDrawRectangle(565, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir4 dxDrawRectangle(678, 360, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir5 dxDrawRectangle(565, 412, 83, 31, tocolor(255, 1, 1, 255), false) --- Abrir6 dxDrawRectangle(567, 528, 83, 31, tocolor(255, 1, 1, 255), false) --- Close dxDrawText("Chapadão", 451, 261, 496, 276, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Salgueiro", 580, 262, 629, 278, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Penha", 699, 263, 748, 279, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve1", 462, 314, 511, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve2", 587, 314, 636, 330, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Alemão", 695, 315, 744, 331, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve3", 462, 367, 511, 383, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve4", 590, 368, 639, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve5", 699, 368, 748, 384, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Breve6", 589, 419, 638, 435, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Fechar", 589, 536, 638, 552, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)endlocal isDxShowing = falsefunction gerenciaPainel () if not isDxShowing then addEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (true) isDxShowing = true else removeEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (false) isDxShowing = false endendaddEvent ("ativaPainel", true)addEventHandler ("ativaPainel", getRootElement(), gerenciaPainel)addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 567 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. end endend) É claro que, por se tratar de um elemento DX e não GUI, vc deve usar onClientClick e não onClientGUIClick. Obtendo a coordenada clicada e verificando se essa coordenada está dentro do botão de fechar, para executar a função de fechar o painel. ajudo bastante agr como eu privaria isso lord usedKey = "n", usedCommand = "hedit", Link to comment
DNL291 Posted May 17, 2018 Share Posted May 17, 2018 (edited) Acho que você quer dizer usar uma tecla ou comando pra abrir? Se for isso, aqui vai um exemplo simples: -- client local tecla = "n" local comando = "vermsg" bindKey( tecla, "down", -- 'down': significa que a tecla está sendo pressionada -- 'up': significa que a tecla foi liberada function() -- mostra a menssagem quando apertar a tecla 'n' outputChatBox( "A tecla "..n.." foi pressionada" ) end ) -- mostrando no chat quando digitar o comando da variável 'comando' addCommandHandler( comando, function ( nome_do_comando ) outputChatBox( "O comando "..nome_do_comando.." foi digitado" ) end ) É muito fácil de usar essas funções, imagino que você conseguiu entender o código. Agora, avançando para o comando e a bind funcionar com o painel-DX: Talvez você já tenha entendido que: addEventHandler ("onClientRender", getRootElement(), drawDX) Vai manter o DX mostrando na tela, enquanto que: removeEventHandler ("onClientRender", getRootElement(), drawDX) Vai parar o evento, e o "DX" não será executado. O que mais será necessário? Bem, showCursor para mostrar o cursor do mouse, e, fora isso você provavelmente terá que manipular a variável que indica se o DX está mostrando ou não. Achei melhor te explicar pra você entender que na verdade é uma coisa fácil, mesmo que você não entenda os conceitos básicos da programação, você podia ter se esforçado e visto um exemplo de bindKey e addCommandHandler para ao menos ter tentado incluir no código que te foi dado aqui. Por exemplo, esse código dar alternar o DX para mostrar e ocultar quando digitar o comando: local tecla = 'n' bindKey( tecla, "down", function() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = true; showCursor(true) else removeEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = false; showCursor(false) end end ) ----- Não me entenda mal, mas não gosto de ver pessoas aqui buscando ajuda e no fim quem se esforça mais é quem vai ajudar, enquanto o dono do tópico é breve e mal consegue se expressar por comentar apenas 1 linha. Voltando ao assunto, a função isMouseInPosition te ajudará a configurar os cliques nos botões usando puro DX. Use o evento "onClientClick" e chame a função dentro desse evento (você pode dar um addEventHandler("onClientClick"..) e removeEventHandler), aqui no fórum tem alguns tópicos relacionado a isso. Edited May 17, 2018 by DNL291 1 Link to comment
Other Languages Moderators Lord Henry Posted May 17, 2018 Other Languages Moderators Share Posted May 17, 2018 Ué, como assim? Vc queria que o painel aparecesse ao entrar num marker não era? Pq vc está querendo mudar agora pra tecla específica? On 13/05/2018 at 23:16, danilin said: O player entra no marker mais não conseguir abrir o painel que está no marker 1 Link to comment
#DaNiLiN Posted May 17, 2018 Author Share Posted May 17, 2018 Nesta função aqui lord. function gerenciaPainel () if not isDxShowing then addEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (true) isDxShowing = true else removeEventHandler ("onClientRender", getRootElement(), drawDX) showCursor (false) isDxShowing = false end end addEvent ("ativaPainel", true) addEventHandler ("ativaPainel", getRootElement(), gerenciaPainel) addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 440, 254, 83, 31 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. end end end) o painel abriu certin como dx, mais o painel e teleport no caso como ficaria esse comando pra teleport? mais dentro do painel do marker. Link to comment
Other Languages Moderators Lord Henry Posted May 17, 2018 Other Languages Moderators Share Posted May 17, 2018 (edited) On 16/05/2018 at 08:17, DNL291 said: Próxima vez clique no botão <> e formate o código com a linguagem Lua. Leu isso? 15 minutes ago, danilin said: mais o painel e teleport no caso como ficaria esse comando pra teleport? mais dentro do painel do marker. Não entendi oq vc quer fazer. Edited May 17, 2018 by Lord Henry Link to comment
#DaNiLiN Posted May 17, 2018 Author Share Posted May 17, 2018 tipo, queria que desse pra da tp pelo marker privado. ai no caso da pra mudar a função de fchar pra de teleport? Link to comment
DNL291 Posted May 17, 2018 Share Posted May 17, 2018 (edited) 1 hour ago, danilin said: ai no caso da pra mudar a função de fchar pra de teleport? Em gerenciaPainel () vai fechar o painel (tem até o comentário ao lado da função, se você começar ler nossos posts você vai perceber) No caso, só colocar o setElementPosition ... Edited May 17, 2018 by DNL291 1 Link to comment
Other Languages Moderators Lord Henry Posted May 18, 2018 Other Languages Moderators Share Posted May 18, 2018 (edited) 18 hours ago, danilin said: ai no caso da pra mudar a função de fchar pra de teleport? Só adicionar setElementPosition depois de fechar o painel. Isso é mais simples do que fazer uma pergunta. addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 567 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. setElementPosition (localPlayer, 0, 0, 0) -- Onde 0, 0, 0 é as coordenadas X, Y, Z pra ir. end end end) Cara, vc pelo menos fez o mínimo de esforço para ler a Wiki? Ou vc nem sabe que ela existe? Lá também tem exemplos prontos pra vc estudar como funciona a função. Sabendo como funciona a função, vc pode usá-la para o propósito que vc quiser. Edited May 18, 2018 by Lord Henry 1 Link to comment
#DaNiLiN Posted May 19, 2018 Author Share Posted May 19, 2018 10 hours ago, Lord Henry said: Só adicionar setElementPosition depois de fechar o painel. Isso é mais simples do que fazer uma pergunta. addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 567 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. setElementPosition (localPlayer, 0, 0, 0) -- Onde 0, 0, 0 é as coordenadas X, Y, Z pra ir. end endend) Cara, vc pelo menos fez o mínimo de esforço para ler a Wiki? Ou vc nem sabe que ela existe? Lá também tem exemplos prontos pra vc estudar como funciona a função. Sabendo como funciona a função, vc pode usá-la para o propósito que vc quiser. ss, eu entendo +- to vindo por esse ramo agora, obrigado os 2 ajudo bastante conseguir fzr estou satisfeito <3 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