Castillo Posted October 23, 2011 Share Posted October 23, 2011 But, why do you need that? I suposed you wanted to save the login details for the next time you join the server. P.S: If the reinstalls MTA, these files will be lost. Link to comment
Charlie_Jefferson Posted October 23, 2011 Author Share Posted October 23, 2011 But, why do you need that? I suposed you wanted to save the login details for the next time you join the server.P.S: If the reinstalls MTA, these files will be lost. It saves the .xml file with the username and password into MY PC. Like a database, but in a .xml file... Why is it so hard to understand? >.> Link to comment
mjau Posted October 23, 2011 Share Posted October 23, 2011 So you just need a panel because mta aleready hase a database for that Example of login /Register code i removed the gui ... Server function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("Login Sucess", player) triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("Register Sucess!", player) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) Client function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(GUIEditor_Edit[1]) local password = guiGetText(GUIEditor_Edit[2]) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) end end end function clientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(GUIEditor_Edit[1]) local password = guiGetText(GUIEditor_Edit[2]) if username and password then triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) end end end Link to comment
Charlie_Jefferson Posted October 23, 2011 Author Share Posted October 23, 2011 Thanks. Finally someone understands. Haven't tried it yet though. I will soon. Link to comment
Castillo Posted October 23, 2011 Share Posted October 23, 2011 And where's the XML part in that? I don't see it. Link to comment
mjau Posted October 23, 2011 Share Posted October 23, 2011 Solidsnake he tought he needed XML to login register part but mta aleready has a datbase for that so no XML needed... Link to comment
Charlie_Jefferson Posted October 24, 2011 Author Share Posted October 24, 2011 Exactly. 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