Jump to content

[HELP]CLOSE€DX


Recommended Posts

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
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
  • Moderators

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 by DNL291
  • Like 1
Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...