FSXTim Posted May 20, 2012 Posted May 20, 2012 I have two windows and I want to bring one of them to the front. But it's still in the background! function OpenRules_Button (state) if state == "left" then if source == GUIEditor_Button1 or source == GUIEditor_Button3 then guiSetVisible(Regeln_Window, true) guiBringToFront (Regeln_Window) end end end addEventHandler("onClientGUIClick", getRootElement(), OpenRules_Button) Can anybody help me? Greets
Jaysds1 Posted May 20, 2012 Posted May 20, 2012 try this: function OpenRules_Button (button,state) -- there's one more argument before state is defineed if state == "left" then if source == GUIEditor_Button1 or source == GUIEditor_Button3 then guiSetVisible(Regeln_Window, true) guiBringToFront (Regeln_Window) end end end addEventHandler("onClientGUIClick",guiRoot, OpenRules_Button) --defined root as guiRoot I've add a couple of comments for you
FSXTim Posted May 20, 2012 Author Posted May 20, 2012 @Jaysds1: Thanks, but: That should work. I tried again and it's working now. I'm sure I did something wrong! Thanks Greets
Jaysds1 Posted May 20, 2012 Posted May 20, 2012 @Jaysds1: Thanks, but:That should work. I tried again and it's working now. I'm sure I did something wrong! Thanks Greets np
Stanley Sathler Posted May 20, 2012 Posted May 20, 2012 You're using GUI Editor? Why the variable names are not GUIEditor_Button[1] and GUIEditor_Button[3]? '-'
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