pino-boy Posted July 5, 2013 Author Share Posted July 5, 2013 addEventHandler("onClientGUIClick",button[1],Click,false) Link to comment
PaiN^ Posted July 5, 2013 Share Posted July 5, 2013 Is "button" a table defined in the script, [1] = guiCreateButton ..., Is the button destroyed some where in the script ? if not, Post the full code . Link to comment
pino-boy Posted July 5, 2013 Author Share Posted July 5, 2013 Client GUIEditor = { button = {} } addEventHandler("onClientResourceStart",resourceRoot, function() myWindow = guiCreateWindow ( 0, 0.1, 1.0, 0.7, "test-panel", true ) guiSetVisible(myWindow, false) buttonRace = guiCreateButton ( 0.44, 0.31, 0.15, 0.24, "Race", true, myWindow ) buttonClose = guiCreateButton ( 0.43, 0.71, 0.15, 0.24, "Close", true, myWindow ) addEventHandler("onClientGUIClick",buttonRace,Click,false) addEventHandler("onClientGUIClick",buttonClose,close,false) end ) function Click( ) setElementDimension( localPlayer, 1 ) outputChatBox( tostring ( getElementDimension ( localPlayer ) ) ) triggerServerEvent( "racestart", localPlayer, localPlayer ) guiSetVisible( myWindow, false ) showCursor( false ) guiSetInputEnabled( false ) end function close( ) guiSetVisible(myWindow, false) showCursor(false) guiSetInputEnabled(false) end function open( ) guiSetVisible(myWindow, true) showCursor(true) guiSetInputEnabled(true) end bindKey ( "F2", "down", open ) 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