TheCrazy17 Posted July 21, 2013 Share Posted July 21, 2013 Hola de nuevo Estoy haciendo una ventana de comandos, que se abra con un comando, y se cierre con un botón, lo de abrirlo con un comando ya lo hice, pero no se como hacer para que se cierre con el botón (soy algo novato en script), me darían una ayuda? Esta seria la ventana: addEventHandler("onClientResourceStart", resourceRoot, function() VentanaComandos = guiCreateWindow(272, 208, 260, 103, "-AR- | Comandos", false) guiWindowSetSizable(VentanaComandos, false) cerrarPanel = guiCreateButton(202, 76, 48, 17, "Salir", false, VentanaComandos) guiSetProperty(cerrarPanel, "NormalTextColour", "FFAAAAAA") end ) y esto uso para que se abra con el comando, es lo único que conseguí para que se abra, creo que esta mal function onresourceStart () addCommandHandler("comandos", PanelComandos) guiSetVisible (VentanaComandos, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function PanelComandos () getVisible = guiGetVisible (VentanaComandos) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (VentanaComandos, false) showCursor (false) end if (getVisible == false) then guiSetVisible (VentanaComandos, true) showCursor (true) end end Si me pueden ayudar estaría muy agradecido Link to comment
Anyelberth Posted July 21, 2013 Share Posted July 21, 2013 (edited) function Panels() Panels = guiCreateWindow(272, 208, 260, 103, "-AR- | Comandos", false) guiWindowSetSizable(Panels, false) cerrarPanel = guiCreateButton(202, 76, 48, 17, "Salir", false, Panels) guiSetProperty(cerrarPanel, "NormalTextColour", "FFAAAAAA") showCursor ( true ) addEventHandler ( "onClientGUIClick", cerrarPanel, Exit, false ) end addCommandHandler ( "ElComando", Panels ) function Exit () guiSetVisible (Panels, not guiGetVisible ( Panels ) ) showCursor ( false ) end Si Te Da Error Dimelo ---------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------- EDITADO: y esto uso para que se abra con el comando, es lo único que conseguí para que se abra, creo que esta mal function onresourceStart () addCommandHandler("comandos", PanelComandos) guiSetVisible (VentanaComandos, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function PanelComandos () getVisible = guiGetVisible (VentanaComandos) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (VentanaComandos, false) showCursor (false) end if (getVisible == false) then guiSetVisible (VentanaComandos, true) showCursor (true) end end Eso Nó Te Servirá. Edited July 21, 2013 by Guest Link to comment
TheCrazy17 Posted July 21, 2013 Author Share Posted July 21, 2013 function Panels() Panels = guiCreateWindow(272, 208, 260, 103, "-AR- | Comandos", false) guiWindowSetSizable(Panels, false) cerrarPanel = guiCreateButton(202, 76, 48, 17, "Salir", false, Panels) guiSetProperty(cerrarPanel, "NormalTextColour", "FFAAAAAA") showCursor ( true ) addEventHandler ( "onClientGUIClick", cerrarPanel, Exit, false ) end addCommandHandler ( "ElComando", Panels ) function Exit () guiSetVisible (Panels, not guiGetVisible ( Panels ) ) showCursor ( false ) end Si Te Da Error Dimelo -------------------------------------------------------------------------------------------- EDITADO: y esto uso para que se abra con el comando, es lo único que conseguí para que se abra, creo que esta mal function onresourceStart () addCommandHandler("comandos", PanelComandos) guiSetVisible (VentanaComandos, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function PanelComandos () getVisible = guiGetVisible (VentanaComandos) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (VentanaComandos, false) showCursor (false) end if (getVisible == false) then guiSetVisible (VentanaComandos, true) showCursor (true) end end Eso Nó Te Servirá. Funciona perfecto ! No da ningún error, gracias amigo Link to comment
Anyelberth Posted July 21, 2013 Share Posted July 21, 2013 Denada. Acá Resolvemos Tus Problemas. Link to comment
Recommended Posts