darbka2002 Posted August 1, 2016 Share Posted August 1, 2016 hello, i want if player click on the tab with name close then close the gui please help Link to comment
Bonus Posted August 1, 2016 Share Posted August 1, 2016 guibutton = guiCreateButton ( ... ) addEventHandler ( "onClientGUIClick", guibutton, function ( button, state ) if button == "left" and state == "up" then destroyElement ( guibutton ) -- Hide GUI end end, false ) https://wiki.multitheftauto.com/wiki/OnClientGUIClick Link to comment
darbka2002 Posted August 1, 2016 Author Share Posted August 1, 2016 i dont mean button i mean tab in gui tabpanel Link to comment
Bonus Posted August 1, 2016 Share Posted August 1, 2016 guibutton = guiCreateButton ( ... ) addEventHandler ( "onClientGUIClick", guibutton, function ( button, state ) if button == "left" and state == "up" then destroyElement ( guibutton ) -- Hide GUI end end, false ) https://wiki.multitheftauto.com/wiki/OnClientGUIClick guitab = guiCreateTab ( ... ) addEventHandler ( "onClientGUIClick", guitab, function ( button, state ) if button == "left" and state == "up" then destroyElement ( guitab ) -- Hide GUI end end, false ) Didn't really change much My first answer was just an example, thought you will notice what I wanna say. Link to comment
darbka2002 Posted August 1, 2016 Author Share Posted August 1, 2016 it still not work close1 = guiCreateTab("close", tabpanel) addEventHandler ( "onClientGUIClick", close1, function ( button, state ) if state == "up" then guiSetVisible( rule, false ) end end, false ) and i try to use your codes but it not work and this not work i just need if i click in the tab in the top in the tab name the gui close Link to comment
Bonus Posted August 1, 2016 Share Posted August 1, 2016 It has to work. onClientGUIClick gets triggered when you click on a GUI. The source is the GUI element, which got clicked. It's probably your fault, but you show too less to see anything. 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