2013martin1212 Posted October 25, 2016 Share Posted October 25, 2016 function loginReguest(player,username,password) local account exports.mysql:_Query("SELECT 'users' WHERE username = " .. username) if (account) then local account = accounts[1] -- local password == accounts["password"] then outputChatBox("Succesfully logged In!") spawnPlayer(player,accounts["posX"],accounts["posY"],accounts["posZ"],accounts["pRot"],accounts["pSkin"],accounts["pInt"],accounts["pDim"]) else outputChatBox("Username or Password is wrong!") end end end triggerClientEvent(player,"showHide", getRootElement() ) end addEvent("logIn",false) addEventHandler("logIn",getRootElement(), loginReguest) I try to figure out the mysql but i dont now i am on the right track ?? Link to comment
pa3ck Posted October 25, 2016 Share Posted October 25, 2016 No, that's not how a SELECT statement looks and the rest of your code is terribly wrong as well. Like local password == accounts["password"]... What's that for? Shouldn't it be in an if statement? How do you define a variable? It's local variable = "value"... local account = exports.mysql:_Query("SELECT * FROM `users` WHERE `username` = ? LIMIT 1", username) Link to comment
2013martin1212 Posted October 25, 2016 Author Share Posted October 25, 2016 i am new in this part i just try to get the player login data from mysql and let them login but i am lost without no tutorial to how :*( Link to comment
Gravestone Posted October 25, 2016 Share Posted October 25, 2016 You can take reference from this. 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