Lloyd Logan Posted January 3, 2014 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 If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Lloyd Logan Posted January 3, 2014 Author 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! If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
xXMADEXx Posted January 3, 2014 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. The Ultimate Lua Tutorial! | MTA PHP SDK
Lloyd Logan Posted January 3, 2014 Author 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! If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
xXMADEXx Posted January 3, 2014 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. The Ultimate Lua Tutorial! | MTA PHP SDK
Lloyd Logan Posted January 3, 2014 Author 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 If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
xXMADEXx Posted January 3, 2014 Posted January 3, 2014 Such simple things! Thanks again Welcome. The Ultimate Lua Tutorial! | MTA PHP SDK
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