Red-Pitbull Posted March 2, 2014 Share Posted March 2, 2014 hi all this is simple information panel it working great but when i start script it automatic open bind key not working GUIEditor = { tab = {}, tabpanel = {}, label = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(38, 81, 731, 495, "Information Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 126, 712, 359, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("SAM:RPG", GUIEditor.tabpanel[1]) GUIEditor.memo[1] = guiCreateMemo(1, 1, 711, 334, "Add your server information here", false, GUIEditor.tab[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.tab[2] = guiCreateTab("Rules", GUIEditor.tabpanel[1]) GUIEditor.memo[2] = guiCreateMemo(4, 4, 704, 331, "Add Rules here.", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tab[3] = guiCreateTab("Staff Member", GUIEditor.tabpanel[1]) GUIEditor.memo[3] = guiCreateMemo(2, 3, 710, 328, "Add your staff member here", false, GUIEditor.tab[3]) guiMemoSetReadOnly(GUIEditor.memo[3], true) GUIEditor.tab[4] = guiCreateTab("Event", GUIEditor.tabpanel[1]) GUIEditor.memo[4] = guiCreateMemo(1, 3, 711, 332, "Add your server Event here", false, GUIEditor.tab[4]) guiMemoSetReadOnly(GUIEditor.memo[4], true) GUIEditor.tab[5] = guiCreateTab("Commands", GUIEditor.tabpanel[1]) GUIEditor.memo[5] = guiCreateMemo(1, 2, 711, 333, "Add your server command here.", false, GUIEditor.tab[5]) guiMemoSetReadOnly(GUIEditor.memo[5], true) GUIEditor.tab[6] = guiCreateTab("Update", GUIEditor.tabpanel[1]) GUIEditor.memo[6] = guiCreateMemo(1, 2, 711, 333, "Add server update here", false, GUIEditor.tab[6]) guiMemoSetReadOnly(GUIEditor.memo[6], true) GUIEditor.tab[7] = guiCreateTab("Features", GUIEditor.tabpanel[1]) GUIEditor.memo[7] = guiCreateMemo(0, 2, 712, 333, "Add your server features here.", false, GUIEditor.tab[7]) guiMemoSetReadOnly(GUIEditor.memo[7], true) GUIEditor.label[1] = guiCreateLabel(164, 47, 409, 54, "Your Server Name Here", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "sa-gothic") end ) function open() if (guiGetVisible (helpwindow) == false) then guiSetVisible(helpwindow, true) showCursor(true) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(helpwindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(helpwindow,x,y,false) centerWindow(helpwindow) elseif (guiGetVisible (helpwindow) == true) then guiSetVisible(helpwindow, false) showCursor(false) end end bindKey ("F1", "down", open) Link to comment
pa3ck Posted March 2, 2014 Share Posted March 2, 2014 Just put guiSetVisible ( GUIEditor.window[1], false ) after line 10. Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 guiSetVisible - use this, when the resource is starting hide window. Link to comment
Red-Pitbull Posted March 2, 2014 Author Share Posted March 2, 2014 now window not appear Link to comment
Moderators Citizen Posted March 2, 2014 Moderators Share Posted March 2, 2014 now window not appear function open() local helpwindow = GUIEditor.window[1] if (guiGetVisible (helpwindow) == false) then guiSetVisible(helpwindow, true) showCursor(true) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(helpwindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(helpwindow,x,y,false) centerWindow(helpwindow) elseif (guiGetVisible (helpwindow) == true) then guiSetVisible(helpwindow, false) showCursor(false) end end bindKey ("F1", "down", open) Learn to use the right variables ... Note: I just added the line 2 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