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