Jump to content

(AYUDA)Problema Con GUI


lucascba

Recommended Posts

Posted

Hola tengo un problema con un gui que cree, el problema es que cuando entro al server la gui aprece o cuando reinicio el resource, como puedo hacer que eso no pase? gracias

Posted
local markerP = createPickup( 2869.7590332031, 1103.896484375, 20.045986175537,0,3,1318) 
  
  
ventana = guiCreateWindow(514, 323, 291, 167, "CL vida", false) 
guiWindowSetSizable(ventana, false) 
texto = guiCreateLabel(21, 26, 242, 60, "Para rellenar la vida cuesta $1000", false, ventana) 
BontonC = guiCreateButton(155, 101, 108, 46, "Cerrar", false, ventana) 
botonB = guiCreateButton(21, 101, 108, 46, "$1000", false, ventana) 
guiSetProperty(botonB, "NormalTextColour", "FF00CB2B")     
  
     
    function VidaCQC(hitElement) 
         if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
              if not guiGetVisible(ventana) then 
                   guiSetVisible(ventana, true) 
                   showCursor(true) 
              end 
         end 
    end 
    addEventHandler("onClientMarkerHit", markerV, VidaCQC) 
     
        function VidaCQCL(leaveElement) 
         if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then 
              if guiGetVisible(ventana) then 
                   guiSetVisible(ventana, false) 
                   showCursor(false) 
              end 
         end 
    end 
    addEventHandler("onClientMarkerLeave", markerV, VidaCQCL) 
     
    function cerrarventana() 
         guiSetVisible(ventana, false) 
         showCursor(false) 
    end 
    addEventHandler("onClientGUIClick", BontonC , cerrarventana, false) 
     
function darvida () 
guiSetVisible(ventana,false) 
showCursor(false) 
triggerServerEvent("Darvida1", localPlayer) 
setElementHealth ( localPlayer, 200 ) 
end  
addEventHandler("onClientGUIClick", botonB , darvida, false) 

Posted
local markerP = createPickup( 2869.7590332031, 1103.896484375, 20.045986175537,0,3,1318) 
  
  
ventana = guiCreateWindow(514, 323, 291, 167, "CL vida", false) 
guiWindowSetSizable(ventana, false) 
texto = guiCreateLabel(21, 26, 242, 60, "Para rellenar la vida cuesta $1000", false, ventana) 
BontonC = guiCreateButton(155, 101, 108, 46, "Cerrar", false, ventana) 
botonB = guiCreateButton(21, 101, 108, 46, "$1000", false, ventana) 
guiSetProperty(botonB, "NormalTextColour", "FF00CB2B")     
  
     
    function VidaCQC(hitElement) 
         if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
              if not guiGetVisible(ventana) then 
                   guiSetVisible(ventana, true) 
                   showCursor(true) 
              end 
         end 
    end 
    addEventHandler("onClientMarkerHit", markerV, VidaCQC) 
     
        function VidaCQCL(leaveElement) 
         if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then 
              if guiGetVisible(ventana) then 
                   guiSetVisible(ventana, false) 
                   showCursor(false) 
              end 
         end 
    end 
    addEventHandler("onClientMarkerLeave", markerV, VidaCQCL) 
     
    function cerrarventana() 
         guiSetVisible(ventana, false) 
         showCursor(false) 
    end 
    addEventHandler("onClientGUIClick", BontonC , cerrarventana, false) 
     
function darvida () 
guiSetVisible(ventana,false) 
showCursor(false) 
triggerServerEvent("Darvida1", localPlayer) 
setElementHealth ( localPlayer, 200 ) 
end  
addEventHandler("onClientGUIClick", botonB , darvida, false) 

El problema Posiblemente sea que no Utilizaste el  "guiSetVisible" en donde creaste la Gui, Prueba poniendo  "guiSetVisible(ventana, false)", Puedes ponerlo abajo de "guiWindowSetSizable".

Vive la vida mientras puedas porque está se acaba muy pronto...

  • Recently Browsing   0 members

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