^~Xep Posted December 20, 2018 Share Posted December 20, 2018 function AbrirPainel () addEventHandler("onClientRender", root, Dx) end addEvent("open",true) addEventHandler("open", root, AbrirPainel) function Dx () dxDrawRectangle(61, 67, 1171, 607, tocolor(0, 0, 0, 209), false) dxDrawRectangle(61, 67, 1171, 48, tocolor(0, 0, 0, 255), false) dxDrawText("Seja Bem Vindo(A)", 458, 77, 806, 128, tocolor(255, 255, 255, 255), 2.00, "arial", "center", "top", false, false, false, false, false) dxDrawText("olá,sejam muitos bem vindos(as) ao", 105, 169, 713, 217, tocolor(255, 255, 255, 255), 2.00, "arial", "center", "top", false, false, false, false, false) dxDrawText("Perfect ", 415, 171, 933, 217, tocolor(29, 92, 235, 255), 2.00, "default-bold", "center", "top", false, false, false, false, false) dxDrawText("Life RolePlay!", 680, 171, 943, 223, tocolor(252, 252, 252, 255), 2.00, "arial", "center", "top", false, false, false, false, false) dxDrawText("Esse Sevidor foi baseado em servidores RolePlay de Five!", 209, 216, 943, 278, tocolor(255, 255, 255, 255), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Oque E RolePlay? ", 209, 259, 388, 299, tocolor(213, 143, 9, 255), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText(":RolePlay seria uma vida virtual,aonde voce pode seguir o mundo ", 418, 263, 960, 305, tocolor(254, 254, 254, 255), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Do Trafico,honesto ou ate policial!", 209, 309, 751, 351, tocolor(254, 254, 254, 255), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Como Jogar?", 209, 356, 751, 398, tocolor(52, 197, 7, 209), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText(":Pressione \"F9\" Para acessar nosso painel de ajuda!", 366, 356, 908, 398, tocolor(254, 254, 254, 209), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Regras Importantes", 209, 404, 751, 446, tocolor(52, 197, 7, 209), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText(":nao Cometer DM,Nao Cometer DB,Seja Feliz!", 437, 404, 979, 446, tocolor(254, 254, 254, 209), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Por Favor!Nao descumpra as REGRAS!!", 383, 456, 925, 498, tocolor(254, 254, 254, 209), 2.00, "arial", "left", "top", false, false, false, false, false) dxDrawText("Life RolePlay", 545, 580, 808, 632, tocolor(252, 252, 252, 255), 2.00, "arial", "center", "top", false, false, false, false, false) dxDrawText("Perfect ", 285, 580, 803, 626, tocolor(29, 92, 235, 255), 2.00, "default-bold", "center", "top", false, false, false, false, false) dxDrawRectangle(61, 109, 36, 565, tocolor(29, 69, 243, 255), false) dxDrawRectangle(1196, 109, 36, 565, tocolor(29, 69, 243, 255), false) end como faço esse painel fechar? Link to comment
DNL291 Posted December 20, 2018 Share Posted December 20, 2018 removeEventHandler("onClientRender", root, Dx) -> removeEventHandler Link to comment
^~Xep Posted December 20, 2018 Author Share Posted December 20, 2018 queria fechar ele com um botão. Link to comment
+[T]rakin Posted December 20, 2018 Share Posted December 20, 2018 function Fechar ( _, state ) if Painel == true then if state == "down" then if isCursorOnElement ( x*PosicaoX, y*PosicaoY, x*PosicaoX, y*PosicaoY ) then removeEventHandler ( "onClientRender", getRootElement(), Dx ) end end end end addEventHandler ( "onClientClick", root, Fechar ) Em cima do function Dx() colocar Painel = false Link to comment
DNL291 Posted December 20, 2018 Share Posted December 20, 2018 (edited) Como já foi mostrado o código, para fechar você vai precisar do evento "onClientClick" e desta função: https://wiki.multitheftauto.com/wiki/IsMouseInPosition Nos argumentos você passa as podições x, y, largura e altura da área de detecção do clique. Pesquisando pelo fórum você vai encontrar alguns tópicos com esse mesmo assunto e entender melhor. Aqui está um tópico que pode te ajudar também: Edited December 20, 2018 by DNL291 1 Link to comment
^~Xep Posted December 20, 2018 Author Share Posted December 20, 2018 function Fechar ( _, state ) if Painel == true then if state == "down" then if isCursorOnElement ( x*PosicaoX, y*PosicaoY, x*PosicaoX, y*PosicaoY ) then removeEventHandler ( "onClientRender", getRootElement(), Dx ) end end end end addEventHandler ( "onClientClick", root, Fechar ) eu colocaria isso no cliente? Link to comment
DNL291 Posted December 20, 2018 Share Posted December 20, 2018 Sim é lado client. Leia: https://wiki.multitheftauto.com/wiki/PT-BR/Introdução_ao_Scripting Link to comment
Vazern Posted December 21, 2018 Share Posted December 21, 2018 Mais um triste caso de pegar código pronto para painel DX sem ter conhecimento algum. ;-; 2 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