Jump to content

GUI Not closing


Lloyd Logan

Recommended Posts

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
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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...