mint3d Posted December 7, 2013 Share Posted December 7, 2013 When I hit close it doesn't close anyhelp? GUIEditor = { button = {} } function openAdminPanel () adminPanel = guiCreateWindow(157, 99, 481, 343, "Admin Panel - DayZ", false) guiWindowSetMovable(adminPanel, false) guiWindowSetSizable(adminPanel, false) adminPanelButton = guiCreateButton(388, 307, 84, 27, "Close", false, adminPanel) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") adminPanelMemo = guiCreateMemo(9, 24, 183, 48, "Do not abuse your admin powers , thank you.", false, adminPanel) guiSetAlpha(adminPanelMemo, 0.91) guiMemoSetReadOnly(adminPanelMemo, true) showCursor( true) end addCommandHandler("openadmin",openAdminPanel,true,false) function closeAdminPanel() root = getRootElement() destroyElement(root) end addEventHandler("onClientGUIClick",adminPanelButton,closeAdminPanel) Link to comment
Castillo Posted December 7, 2013 Share Posted December 7, 2013 addEventHandler("onClientGUIClick",adminPanelButton,closeAdminPanel) Move that inside your function, after you create the button. Link to comment
Markeloff Posted December 7, 2013 Share Posted December 7, 2013 function closeAdminPanel() guiSetVisible(adminPanel,false) showCursor(false) addEventHandler("onClientGUIClick",adminPanelButton,closeAdminPanel) This function returns the root node of the element tree, called root. This node contains every other element: all resource root elements, players and remote clients. It is never destroyed and cannot be destroyed using destroyElement. Read Carefully https://wiki.multitheftauto.com/wiki/GetRootElement Link to comment
mint3d Posted December 7, 2013 Author Share Posted December 7, 2013 Thanks Solid Works good Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now