lucascba Posted August 1, 2014 Share Posted August 1, 2014 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 Link to comment
alex17 Posted August 2, 2014 Share Posted August 2, 2014 postea tu codigo para poder ayudarte Link to comment
lucascba Posted August 2, 2014 Author Share Posted August 2, 2014 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) Link to comment
TheOskar Posted August 2, 2014 Share Posted August 2, 2014 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". Link to comment
Recommended Posts