LiOneLMeSsIShoT Posted December 16, 2013 Share Posted December 16, 2013 I don't know why the gui don't close when i click on the button here! everything's okay and the event is on the function which have the event resource start. and i've started with everything but still not works. and no debugscript 3 errror too on "Close BUTTOn" GUIEditor = { button = {}, window = {}, label = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() Mission1_Window = guiCreateWindow(420, 252, 582, 526, "Mission 1", false) guiWindowSetSizable(Mission1_Window, false) guiSetVisible (Mission1_Window, false) GUIEditor.edit[1] = guiCreateEdit(43, 126, 498, 353, "Go meet Cesar at his place. Use my car holmes'.", false, Mission1_Window) guiEditSetReadOnly(GUIEditor.edit[1], true) GUIEditor.label[1] = guiCreateLabel(93, 32, 385, 79, "Meet Cesar", false, Mission1_Window) guiSetFont(GUIEditor.label[1], "sa-gothic") guiLabelSetColor(GUIEditor.label[1], 31, 253, 1) LetsGoNow = guiCreateButton(48, 487, 205, 30, "Lets Go!", false, Mission1_Window) GUIEditor.button[1] = guiCreateButton(337, 487, 205, 30, "Fuck that shit!", false, Mission1_Window) ---Handlers[sTART]--- addEventHandler ("onClientGUIClick", LetsGoNow, missionSTART, false) addEventHandler ("onClientGUIClick", GUIEditor.button[1], closeGUI, false) ---Handlers[END]--- end ) ---guiShown[sTART]--- function showGUI () guiSetVisible (Mission1_Window, true) showCursor (true) end addEvent ("showMission1", true) addEventHandler ("showMission1", getRootElement(), showGUI) ---guiShown[END]--- ---Mission[1]START[sTART]--- function missionSTART (button, state) if (button == "left" and state == "up") then if guiGetVisible (Mission1_Window) then guiSetVisible (Mission1_Window, false) triggerServerEvent ("STARTmission1", localPlayer) showCursor ( false ) end end end ---Mission[1]START[END]--- ---CloseGUI[sTART]--- function closeGUI (button, state) if (button == "left" and state == "up") then if guiGetVisible (Mission1_Window) then guiSetVisible (Mission1_Window, false) showCursor ( false ) end end end ---CloseGUI[END]--- Link to comment
TAPL Posted December 16, 2013 Share Posted December 16, 2013 Nothing wrong here, re-test your script again. Link to comment
LiOneLMeSsIShoT Posted December 16, 2013 Author Share Posted December 16, 2013 Nothing wrong here, re-test your script again. re tested a couple of times. but whatever it's not the full script. there're another sides triggerd. Link to comment
LiOneLMeSsIShoT Posted December 16, 2013 Author Share Posted December 16, 2013 Nothing wrong here, re-test your script again. aha fixed in function name GUI must be Changed. idk why but worked when i did that. Link to comment
Noki Posted December 19, 2013 Share Posted December 19, 2013 Make sure this is client-side in your meta.xml file. You can try removing the GUIEditor things, along with the table and renaming your GUI elements. 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