Drakath Posted January 12, 2014 Share Posted January 12, 2014 MTA gui system could really use an update. Sometimes when you place a button and press on the window, the button is pressed. Link to comment
Castillo Posted January 12, 2014 Share Posted January 12, 2014 They plan on creating their own GUI, it's aimed for MTA 2.0 though. Link to comment
Piorun Posted January 13, 2014 Share Posted January 13, 2014 Add false on last parametr in addEventHandler (i mean after function name) and it should work Link to comment
Castillo Posted January 13, 2014 Share Posted January 13, 2014 Yeah, the getPropagated argument. Link to comment
qaisjp Posted January 13, 2014 Share Posted January 13, 2014 For example, instead of addEventHandler("onClientGUIClick", loginbutton, doLogin) you need to do addEventHandler("onClientGUIClick", loginbutton, doLogin,false) Link to comment
Noki Posted January 16, 2014 Share Posted January 16, 2014 Or, function closeGUI() if (source == buttonName) then guiSetVisible(myAwesomeWindow, false) end end addEventHandler("onClientGUIClick", guiRoot, closeGUI) Link to comment
qaisjp Posted January 16, 2014 Share Posted January 16, 2014 That's only if you're using multiple buttons that do small simple things. One medium sized function for lots of small things for different buttons is a better idea than using lots of different functions for each button. Link to comment
Recommended Posts