Jump to content

Bind para DxDrawText


vallejo

Recommended Posts

Posted

Buenas tardes, tengo este bind de la gui y el DxDrawText entonces quiero que cuando se presiones sea disable el DxDraw

Text ya que lo unico que desaparece es la Gui gracias.

GUIEditor = { 
    staticimage = {} 
} 
        ventanaP = guiCreateStaticImage(0.31, 0.24, 0.38, 0.53, ":ArmasVenta/imagenes/Fondo.png", true) 
        guiSetAlpha(ventanaP, 0.53) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.02, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/DEAGLE1icon.png", true, ventanaP) 
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.18, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/sawnicon.png", true, ventanaP) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(0.34, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/m4icon.png", true, ventanaP) 
        ComprarArma = guiCreateButton(0.32, 0.92, 0.17, 0.06, "Comprar arma", true, ventanaP) 
        guiSetProperty(ComprarArma, "NormalTextColour", "FF48FE08") 
        DeagleRadio = guiCreateRadioButton(0.04, 0.27, 0.10, 0.04, "Deagle", true, ventanaP) 
        guiSetFont(DeagleRadio, "default-bold-small") 
        Cerrar = guiCreateButton(0.51, 0.92, 0.17, 0.06, "Cerrar", true, ventanaP) 
        guiSetProperty(Cerrar, "NormalTextColour", "FF48FE08") 
        SawnRadio = guiCreateRadioButton(0.21, 0.27, 0.09, 0.04, "Sawn", true, ventanaP) 
        guiSetFont(SawnRadio, "default-bold-small") 
        guiRadioButtonSetSelected(SawnRadio, true) 
        M4Radio = guiCreateRadioButton(0.38, 0.27, 0.06, 0.04, "M4", true, ventanaP) 
        guiSetFont(M4Radio, "default-bold-small")    
        guiSetVisible(ventanaP, false)       
  
  
local screenW, screenH = guiGetScreenSize() 
 function text() 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) - 1, (screenH * 0.1673) - 1, (screenW * 0.7279) - 1, (screenH * 0.2369) - 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) + 1, (screenH * 0.1673) - 1, (screenW * 0.7279) + 1, (screenH * 0.2369) - 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) - 1, (screenH * 0.1673) + 1, (screenW * 0.7279) - 1, (screenH * 0.2369) + 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) + 1, (screenH * 0.1673) + 1, (screenW * 0.7279) + 1, (screenH * 0.2369) + 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", screenW * 0.2771, screenH * 0.1673, screenW * 0.7279, screenH * 0.2369, tocolor(254, 254, 254, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
 end 
  
  
 function abrirCerrar() -- Por medio del comando cerramos la GUI 
    if (guiGetVisible(ventanaP) == false) then 
        addEventHandler ( "onClientRender", root, text ) -- keep the text visible with onClientRender. 
        guiSetVisible(ventanaP, true) 
        showCursor(true) 
    else 
        guiSetVisible(ventanaP, false) 
        showCursor(false) 
    end 
end 
bindKey("f3","down",abrirCerrar) 
addEventHandler("onClientGUIClick", Cerrar, abrirCerrar, false) 

Posted
Buenas tardes, tengo este bind de la gui y el DxDrawText entonces quiero que cuando se presiones sea disable el DxDraw

Text ya que lo unico que desaparece es la Gui gracias.

GUIEditor = { 
    staticimage = {} 
} 
        ventanaP = guiCreateStaticImage(0.31, 0.24, 0.38, 0.53, ":ArmasVenta/imagenes/Fondo.png", true) 
        guiSetAlpha(ventanaP, 0.53) 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(0.02, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/DEAGLE1icon.png", true, ventanaP) 
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.18, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/sawnicon.png", true, ventanaP) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(0.34, 0.08, 0.15, 0.18, ":ArmasVenta/imagenes/m4icon.png", true, ventanaP) 
        ComprarArma = guiCreateButton(0.32, 0.92, 0.17, 0.06, "Comprar arma", true, ventanaP) 
        guiSetProperty(ComprarArma, "NormalTextColour", "FF48FE08") 
        DeagleRadio = guiCreateRadioButton(0.04, 0.27, 0.10, 0.04, "Deagle", true, ventanaP) 
        guiSetFont(DeagleRadio, "default-bold-small") 
        Cerrar = guiCreateButton(0.51, 0.92, 0.17, 0.06, "Cerrar", true, ventanaP) 
        guiSetProperty(Cerrar, "NormalTextColour", "FF48FE08") 
        SawnRadio = guiCreateRadioButton(0.21, 0.27, 0.09, 0.04, "Sawn", true, ventanaP) 
        guiSetFont(SawnRadio, "default-bold-small") 
        guiRadioButtonSetSelected(SawnRadio, true) 
        M4Radio = guiCreateRadioButton(0.38, 0.27, 0.06, 0.04, "M4", true, ventanaP) 
        guiSetFont(M4Radio, "default-bold-small")    
        guiSetVisible(ventanaP, false)       
  
  
local screenW, screenH = guiGetScreenSize() 
 function text() 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) - 1, (screenH * 0.1673) - 1, (screenW * 0.7279) - 1, (screenH * 0.2369) - 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) + 1, (screenH * 0.1673) - 1, (screenW * 0.7279) + 1, (screenH * 0.2369) - 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) - 1, (screenH * 0.1673) + 1, (screenW * 0.7279) - 1, (screenH * 0.2369) + 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", (screenW * 0.2771) + 1, (screenH * 0.1673) + 1, (screenW * 0.7279) + 1, (screenH * 0.2369) + 1, tocolor(218, 44, 10, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
        dxDrawText("Armas Comunidad Latina", screenW * 0.2771, screenH * 0.1673, screenW * 0.7279, screenH * 0.2369, tocolor(254, 254, 254, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false) 
 end 
  
  
 function abrirCerrar() -- Por medio del comando cerramos la GUI 
    if (guiGetVisible(ventanaP) == false) then 
        addEventHandler ( "onClientRender", root, text ) -- keep the text visible with onClientRender. 
        guiSetVisible(ventanaP, true) 
        showCursor(true) 
    else 
        guiSetVisible(ventanaP, false) 
        showCursor(false) 
    end 
end 
bindKey("f3","down",abrirCerrar) 
addEventHandler("onClientGUIClick", Cerrar, abrirCerrar, false) 

Espero te sirva.

  
activo = false --Creamos una variable con cualquier nombre 
 function abrirCerrar() -- Por medio del comando cerramos la GUI 
    if (guiGetVisible(ventanaP) == false) then 
        if not activo then -- 'if not' devolverá verdarero, así que aparecerá el dx 
        addEventHandler ( "onClientRender", root, text ) -- keep the text visible with onClientRender. 
        guiSetVisible(ventanaP, true) 
        showCursor(true) 
        activo = true --ponemos 'true'  para que 'detecte' que aquí aparecerá el dx 
    else 
        removeEventHandler ( "onClientRender", root, text ) --usamos removeEventHandler para remover el dx 
        guiSetVisible(ventanaP, false) 
        showCursor(false) 
        activo = false --ponemos 'false' para que 'detecte' que al precionar de nuevo f3, se cierre el dx. 
        end 
    end 
end 
bindKey("f3","down",abrirCerrar) 
addEventHandler("onClientGUIClick", Cerrar, abrirCerrar, false) 

  • Recently Browsing   0 members

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