KieronWiltshire Posted January 18, 2014 Share Posted January 18, 2014 Issue with my event handlers. ServerSide local SQL_HOST = "127.0.0.1" local SQL_USERNAME = "root" local SQL_PASSWORD = "" function connect() accountsDatabase = dbConnect( "mysql", SQL_HOST, SQL_USERNAME, SQL_PASSWORD, "share=0" ) outputChatBox("connected") checkExists() triggerClientEvent("hideLoginWindow", getRootElement()) triggerClientEvent("hideRegisterWindow", getRootElement()) end addEventHandler ( "onResourceStart", getRootElement(), connect ) ClientSide --Display the login window to the root element function displayLoginWindow() --source is the player in this case. guiSetVisible(loginWindow, true ) outputChatBox("displayed") end --Hide the login window to the root element function hideLoginWindow() --source is the player in this case. guiSetVisible(loginWindow, false ) end --Display the register window to the root element function displayRegisterWindow() --source is the player in this case. guiSetVisible(registerWindow, true ) end --Hide the login window to the root element function hideRegisterWindow() --source is the player in this case. guiSetVisible(registerWindow, false ) end --[[ LOGIN ALERT LABEL FUNCTIONS ]]-- --Set the login label to a custom message function setLoginAlertLabel(message) guiSetText( loginAlertLabel, message ) end --"Your email or password maybe incorrect or doesn't exit. If the account \ndoesn't exist please create an account before attempting to login." --[[ REGISTER ALERT LABEL FUNCTIONS ]]-- --Set the register label to a custom message function setRegisterFullNameAlertLabel(message) guiSetText( registerFullNameAlertLabel, message ) end --Set the email alert label to a custom message function setRegisterEmailAlertLabel(message) guiSetText( registerEmailAlertLabel, message ) end --Set the password alert label to a custom message function setRegisterPasswordAlertLabel(message) guiSetText( registerPasswordAlertLabel, message ) end addEvent( "displayLoginWindow", true ) addEvent( "hideLoginWindow", true ) addEvent( "displayRegisterWindow", true ) addEvent( "hideRegisterWindow", true ) addEvent( "setLoginAlertLabel", true ) addEvent( "setRegisterFullNameAlertLabel", true ) addEvent( "setRegisterEmailAlertLabel", true ) addEvent( "setRegisterPasswordAlertLabel", true ) addEventHandler( "displayLoginWindow", getRootElement(), displayLoginWindow ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler( "displayRegisterWindow", getRootElement(), displayRegisterWindow ) addEventHandler( "hideRegisterWindow", getRootElement(), hideRegisterWindow ) addEventHandler( "setLoginAlertLabel", getRootElement(), setLoginAlertLabel ) addEventHandler( "setRegisterFullNameAlertLabel", getRootElement(), setRegisterFullNameAlertLabel ) addEventHandler( "setRegisterEmailAlertLabel", getRootElement(), setRegisterEmailAlertLabel ) addEventHandler( "setRegisterPasswordAlertLabel", getRootElement(), setRegisterPasswordAlertLabel ) My meta: <meta> <!-- SCRIPT INFORMATION --> <info author="Kieron Wiltshire" type="script" name="ZedLogin" description="Zed login script" /> <script src="gui.lua" type="client" /> <script src="login-server.lua" type="server" /> <script src="login-client.lua" type="client" /> </meta> Link to comment
Castillo Posted January 18, 2014 Share Posted January 18, 2014 And what is the problem? Link to comment
KieronWiltshire Posted January 18, 2014 Author Share Posted January 18, 2014 Just says they don't exist client side... Link to comment
Castillo Posted January 18, 2014 Share Posted January 18, 2014 That's because the client side script loads after the server side. Link to comment
KieronWiltshire Posted January 19, 2014 Author Share Posted January 19, 2014 No it honestly doesn't all the code is in gui, the client-script is empty for now... Link to comment
Castillo Posted January 19, 2014 Share Posted January 19, 2014 Why do you even trigger a event to hide the GUI server side? you can just hide it client side. Link to comment
KieronWiltshire Posted January 19, 2014 Author Share Posted January 19, 2014 I am, but my events were not working, so i tried other events to make sure what the issue was... Besides i need to hide the gui after login etc... Link to comment
Castillo Posted January 19, 2014 Share Posted January 19, 2014 Hiding after login is one thing, and hiding when the resource starts from the server side is another. 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