Lloyd Logan Posted January 3, 2014 Share Posted January 3, 2014 Why isn't this closing the GUI? SERVER function submitReg() dbExec(server, "CREATE TABLE IF NOT EXISTS accounts (accountname TEXT, password TEXT)") new = dbExec(server, "INSERT INTO accounts VALUES (accountname, password)", inputusernamereg, inputpasswordreg) output = outputChatBox("You have successfully created an account!") if new == true then triggerClientEvent("closedok", getRootElement()) triggerClientEvent("onErrorok", getRootElement()) end end addEvent( "submitRegister", true ) addEventHandler( "submitRegister", root, submitReg ) CLIENT function onErrorOk() guiSetVisible (GUIEditor.window[2], false) end addEventHandler("onErrorok", true) addEventHandler("onErrorok", getRootElement(), onErrorOk) function closeSuccess() guiSetVisible (GUIEditor.window[3], true ) end addEventHandler("closedok", true) addEventHandler("closedok", getRootElement(), closeSuccess) Thanks Link to comment
TAPL Posted January 3, 2014 Share Posted January 3, 2014 Line 9 CLIENT change true to false. Link to comment
Lloyd Logan Posted January 3, 2014 Author Share Posted January 3, 2014 Sorry, I should've been more specific, line 9 should be triggered to show, but line 2 should be triggered to hide! Link to comment
xXMADEXx Posted January 3, 2014 Share Posted January 3, 2014 on line 2, try chaning "GUIEditor.window[2]" to "GUIEditor.window[3]" and in triggerClientEvnet, you should just trigger it for the player, not all of the players. Link to comment
Lloyd Logan Posted January 3, 2014 Author Share Posted January 3, 2014 on line 2, try chaning "GUIEditor.window[2]" to "GUIEditor.window[3]"and in triggerClientEvnet, you should just trigger it for the player, not all of the players. Thanks for the triggerClientEvent, i'll change that! But, the real problem was addEventHandler, when it should have bee addEvent! Link to comment
xXMADEXx Posted January 3, 2014 Share Posted January 3, 2014 on line 2, try chaning "GUIEditor.window[2]" to "GUIEditor.window[3]"and in triggerClientEvnet, you should just trigger it for the player, not all of the players. Thanks for the triggerClientEvent, i'll change that! But, the real problem was addEventHandler, when it should have bee addEvent! Oh my bad, I didn't see that error. Link to comment
Lloyd Logan Posted January 3, 2014 Author Share Posted January 3, 2014 on line 2, try chaning "GUIEditor.window[2]" to "GUIEditor.window[3]"and in triggerClientEvnet, you should just trigger it for the player, not all of the players. Thanks for the triggerClientEvent, i'll change that! But, the real problem was addEventHandler, when it should have bee addEvent! Oh my bad, I didn't see that error. Such simple things! Thanks again Link to comment
xXMADEXx Posted January 3, 2014 Share Posted January 3, 2014 Such simple things! Thanks again Welcome. 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