Jump to content

GUI won't hide after click


BriGhtx3

Recommended Posts

Hey,

now i am asking that again ~,~

When I click F2, the GUI shows, when I click on Schliessen it hides.

But when I click on Jobs, close that and then on Schliessen or click F2 it doesn't hide!

Same with Regeln, when I click on it and then Schliessen, Regeln closes, but when I click in the Regeln GUI, on another TAB it doesn't close any more and the main GUI too.

    function hide() 
    guiSetVisible(GUIEditor_Window[2], false) 
    end 
    function hideRules() 
    guiSetVisible(GUIEditor_Window[3], false) 
    end 
     
        function hideGUI() 
    guiSetVisible(GUIEditor_Window[1], false) 
    showCursor(false) 
    end 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() 
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0,-2,800,48,"STATUS",false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[1],false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(78,-750,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_TabPanel[2] = guiCreateTabPanel(38,12,5,5,false,GUIEditor_Window[1]) 
GUIEditor_Tab[2] = guiCreateTab("Tab",GUIEditor_TabPanel[2]) 
GUIEditor_Button[1] = guiCreateButton(64,24,97,15,"JOBS",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(226,22,288,17,"BEDUERFNISSE",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Button[3] = guiCreateButton(559,22,75,16,"REGELN",false,GUIEditor_Window[1]) 
Beenden = guiCreateButton(660,22,75,16,"Schliessen",false,GUIEditor_Window[1]) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], showJobs ) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[3], showRules ) 
addEventHandler ( "onClientGUIClick", Beenden, hideGUI) 
end) 
  
bindKey("F2","down", function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 
  
  
     
    function showJobs() 
        GUIEditor_Window = {} 
        GUIEditor_TabPanel = {} 
        GUIEditor_Tab = {} 
        GUIEditor_Button = {} 
        GUIEditor_Label = {} 
        GUIEditor_Grid = {} 
  
        GUIEditor_Window[2] = guiCreateWindow(223,129,435,402,"JOBS",false) 
        guiWindowSetSizable(GUIEditor_Window[1],false) 
        GUIEditor_TabPanel[1] = guiCreateTabPanel(18,26,330,367,false,GUIEditor_Window[2]) 
        GUIEditor_Tab[1] = guiCreateTab("Anwalt",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[1] = guiCreateLabel(6,6,314,184,"Der Anwalt ist ein wichtiger \nPunkt im Leben. Ohne in hat \nman vor Gericht keine Chance. \nMan sollte sich lieber einen \nanschaffen.",false,GUIEditor_Tab[1]) 
        guiLabelSetColor(GUIEditor_Label[1],0,255,0) 
        guiSetFont(GUIEditor_Label[1],"sa-header") 
        GUIEditor_Button[1] = guiCreateButton(19,206,292,63,"ANNEHMEN",false,GUIEditor_Tab[1]) 
        GUIEditor_Tab[2] = guiCreateTab("Drogendealer",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[2] = guiCreateLabel(5,8,306,140,"Das ist der Drogendealer. \nEr baut sie entweder selbst an \noder kauft sich welche um sie \nspaeter zu verticken.",false,GUIEditor_Tab[2]) 
        guiLabelSetColor(GUIEditor_Label[2],0,255,0) 
        guiSetFont(GUIEditor_Label[2],"sa-header") 
        GUIEditor_Button[2] = guiCreateButton(16,172,293,71,"ANNEHMEN",false,GUIEditor_Tab[2]) 
        GUIEditor_Tab[3] = guiCreateTab("Mechaniker",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[3] = guiCreateLabel(6,10,303,183,"Bei diesem Beruf kann man, \nAutos reparieren als auch tunen. \nMan kann den Preis festlegen \nwie man will.",false,GUIEditor_Tab[3]) 
        guiLabelSetColor(GUIEditor_Label[3],0,255,0) 
        guiSetFont(GUIEditor_Label[3],"sa-header") 
        GUIEditor_Button[3] = guiCreateButton(26,206,267,62,"ANNEHMEN",false,GUIEditor_Tab[3]) 
        GUIEditor_Tab[4] = guiCreateTab("Taxifahrer",GUIEditor_TabPanel[1]) 
        GUIEditor_Button[4] = guiCreateButton(355,58,71,323,"SCHLIESSEN",false,GUIEditor_Window[2]) 
        addEventHandler ( "onClientGUIClick", GUIEditor_Button[4], hide) 
    end 
     
    function showRules() 
    GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Progress = {} 
  
GUIEditor_Window[3] = guiCreateWindow(16,56,768,405,"HILFE & REGELN",false) 
GUIEditor_TabPanel[4] = guiCreateTabPanel(13,25,746,371,false,GUIEditor_Window[3]) 
GUIEditor_Tab[1] = guiCreateTab("Allgemein",GUIEditor_TabPanel[4]) 
GUIEditor_Label[1] = guiCreateLabel(17,6,715,333,"",false,GUIEditor_Tab[1]) 
guiSetAlpha(GUIEditor_Label[1],1) 
GUIEditor_Tab[2] = guiCreateTab("Berufe",GUIEditor_TabPanel[4]) 
GUIEditor_Label[2] = guiCreateLabel(8,5,730,336,"Berufe sind sehr wichtig, da das Geld nicht einfach angeflogen kommt. \nMan sollte sich immer etwas aussuchen was einem Spass macht! \nEs gibt die Berufe : \n-Mechaniker\n-Anwalt\n-Taxifahrer\n-Drogendealer\nJeder Beruf hat einen gewissen Schwierigkeitsgrad! Empfohlen fuer den \nAnfang waeren : Mechaniker, Drogendealer",false,GUIEditor_Tab[2]) 
guiSetFont(GUIEditor_Label[2],"sa-header") 
GUIEditor_Tab[3] = guiCreateTab("Fraktionen",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[4] = guiCreateTab("Polizei",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[5] = guiCreateTab("Geld",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[6] = guiCreateTab("Tipps",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[7] = guiCreateTab("Commands",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[8] = guiCreateTab("Spielsystem",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[9] = guiCreateTab("REGELN",GUIEditor_TabPanel[4]) 
  
GUIEditor_Button[5] = guiCreateButton(609,26,162,24,"FENSTER SCHLIESSEN",false,GUIEditor_Window[3]) 
  
GUIEditor_Label[3] = guiCreateLabel(694,561,97,21,"HUNGER",false) 
guiSetFont(GUIEditor_Label[3],"clear-normal") 
  
GUIEditor_Progress[1] = guiCreateProgressBar(683,579,116,21,false) 
guiProgressBarSetProgress(GUIEditor_Progress[1],100) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[5], hideRules) 
end 
  

Link to comment
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Grid = {} 
GUIEditor_Progress = {} 
  
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() 
GUIEditor_Window[1] = guiCreateWindow(0,-2,800,48,"STATUS",false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[1],false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(78,-750,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_TabPanel[2] = guiCreateTabPanel(38,12,5,5,false,GUIEditor_Window[1]) 
GUIEditor_Tab[2] = guiCreateTab("Tab",GUIEditor_TabPanel[2]) 
GUIEditor_Button[1] = guiCreateButton(64,24,97,15,"JOBS",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(226,22,288,17,"BEDUERFNISSE",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Button[3] = guiCreateButton(559,22,75,16,"REGELN",false,GUIEditor_Window[1]) 
Beenden = guiCreateButton(660,22,75,16,"Schliessen",false,GUIEditor_Window[1]) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], showJobs ) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[3], showRules ) 
addEventHandler ( "onClientGUIClick", Beenden, hideGUI) 
end) 
  
bindKey("F2","down", function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 
     
function showJobs() 
        GUIEditor_Window[2] = guiCreateWindow(223,129,435,402,"JOBS",false) 
        guiWindowSetSizable(GUIEditor_Window[1],false) 
        GUIEditor_TabPanel[1] = guiCreateTabPanel(18,26,330,367,false,GUIEditor_Window[2]) 
        GUIEditor_Tab[1] = guiCreateTab("Anwalt",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[1] = guiCreateLabel(6,6,314,184,"Der Anwalt ist ein wichtiger \nPunkt im Leben. Ohne in hat \nman vor Gericht keine Chance. \nMan sollte sich lieber einen \nanschaffen.",false,GUIEditor_Tab[1]) 
        guiLabelSetColor(GUIEditor_Label[1],0,255,0) 
        guiSetFont(GUIEditor_Label[1],"sa-header") 
        GUIEditor_Button[1] = guiCreateButton(19,206,292,63,"ANNEHMEN",false,GUIEditor_Tab[1]) 
        GUIEditor_Tab[2] = guiCreateTab("Drogendealer",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[2] = guiCreateLabel(5,8,306,140,"Das ist der Drogendealer. \nEr baut sie entweder selbst an \noder kauft sich welche um sie \nspaeter zu verticken.",false,GUIEditor_Tab[2]) 
        guiLabelSetColor(GUIEditor_Label[2],0,255,0) 
        guiSetFont(GUIEditor_Label[2],"sa-header") 
        GUIEditor_Button[2] = guiCreateButton(16,172,293,71,"ANNEHMEN",false,GUIEditor_Tab[2]) 
        GUIEditor_Tab[3] = guiCreateTab("Mechaniker",GUIEditor_TabPanel[1]) 
        GUIEditor_Label[3] = guiCreateLabel(6,10,303,183,"Bei diesem Beruf kann man, \nAutos reparieren als auch tunen. \nMan kann den Preis festlegen \nwie man will.",false,GUIEditor_Tab[3]) 
        guiLabelSetColor(GUIEditor_Label[3],0,255,0) 
        guiSetFont(GUIEditor_Label[3],"sa-header") 
        GUIEditor_Button[3] = guiCreateButton(26,206,267,62,"ANNEHMEN",false,GUIEditor_Tab[3]) 
        GUIEditor_Tab[4] = guiCreateTab("Taxifahrer",GUIEditor_TabPanel[1]) 
        GUIEditor_Button[4] = guiCreateButton(355,58,71,323,"SCHLIESSEN",false,GUIEditor_Window[2]) 
        addEventHandler ( "onClientGUIClick", GUIEditor_Button[4], hide) 
end 
    
function showRules()  
GUIEditor_Window[3] = guiCreateWindow(16,56,768,405,"HILFE & REGELN",false) 
GUIEditor_TabPanel[4] = guiCreateTabPanel(13,25,746,371,false,GUIEditor_Window[3]) 
GUIEditor_Tab[1] = guiCreateTab("Allgemein",GUIEditor_TabPanel[4]) 
GUIEditor_Label[1] = guiCreateLabel(17,6,715,333,"",false,GUIEditor_Tab[1]) 
guiSetAlpha(GUIEditor_Label[1],1) 
GUIEditor_Tab[2] = guiCreateTab("Berufe",GUIEditor_TabPanel[4]) 
GUIEditor_Label[2] = guiCreateLabel(8,5,730,336,"Berufe sind sehr wichtig, da das Geld nicht einfach angeflogen kommt. \nMan sollte sich immer etwas aussuchen was einem Spass macht! \nEs gibt die Berufe : \n-Mechaniker\n-Anwalt\n-Taxifahrer\n-Drogendealer\nJeder Beruf hat einen gewissen Schwierigkeitsgrad! Empfohlen fuer den \nAnfang waeren : Mechaniker, Drogendealer",false,GUIEditor_Tab[2]) 
guiSetFont(GUIEditor_Label[2],"sa-header") 
GUIEditor_Tab[3] = guiCreateTab("Fraktionen",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[4] = guiCreateTab("Polizei",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[5] = guiCreateTab("Geld",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[6] = guiCreateTab("Tipps",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[7] = guiCreateTab("Commands",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[8] = guiCreateTab("Spielsystem",GUIEditor_TabPanel[4]) 
GUIEditor_Tab[9] = guiCreateTab("REGELN",GUIEditor_TabPanel[4]) 
  
GUIEditor_Button[5] = guiCreateButton(609,26,162,24,"FENSTER SCHLIESSEN",false,GUIEditor_Window[3]) 
  
GUIEditor_Label[3] = guiCreateLabel(694,561,97,21,"HUNGER",false) 
guiSetFont(GUIEditor_Label[3],"clear-normal") 
  
GUIEditor_Progress[1] = guiCreateProgressBar(683,579,116,21,false) 
guiProgressBarSetProgress(GUIEditor_Progress[1],100) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[5], hideRules) 
end 
  
function hideGUI() 
    guiSetVisible(GUIEditor_Window[1], false) 
    showCursor(false) 
end 
  
function hide() 
    guiSetVisible(GUIEditor_Window[2], false) 
end 
  
function hideRules() 
    guiSetVisible(GUIEditor_Window[3], false) 
end 

Try with that, i think you we're cleaning the past GUI elements.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...