Ekko Posted November 2, 2018 Share Posted November 2, 2018 (edited) Server-side function onServerRegister ( player, email, password, code ) local accountAdded = addAccount( email, password ) if ( accountAdded) then logIn( player, accountAdded, password ) triggerClientEvent( player, "onCommand", player, "reg_success" ) if ( code and type(code) == "number" and #code == 4 ) then setAccountData( accountAdded, "Secret Code", code ) else setAccountData( accountAdded, "Secret Code", "none" ) end local time = getRealTime() local hours = time.hour local minutes = time.minute local second = time.second local year = time.year+1900 local month = time.month+1 local day = time.monthday local ymdhms = ( year.."-"..month.."-"..day.." "..hours..":"..minutes..":"..second ) setAccountData( accountAdded, "Register Date", ymdhms ) local userid = #getAccounts() setAccountData( accountAdded, "UID", userid + 1 ) outputChatBox( "ท่านลงทะเบียน สำเร็จแล้ว / ข้อมูลของท่านคือ", player, 255, 255, 255, true) outputChatBox( "#FF0000Email: #A6A6A6" .. email, player, 255, 255, 255, true) outputChatBox( "#FF0000Password: #A6A6A6" .. email, player, 255, 255, 255, true) else triggerClientEvent( player, "onCommand", player, "reg_error" ) end end addEvent( "onServerRegister", true ) addEventHandler( "onServerRegister", root, onServerRegister ) function onServerLogin ( player, email, password, checked ) local account = getAccount( email, password ) if ( account) then logIn( player, account, password ) triggerClientEvent( player, "onCommand", player, "login_success", checked, email, password ) setElementData( player, "Secret Code", getAccountData( account, "Secret Code" ) ) setElementData( player, "Register Date", getAccountData( account, "Register Date" ) ) setElementData( player, "UID", getAccountData( account, "UID" ) ) outputChatBox( "ยินดีต้อนรับ เข้าสู่เซิฟร์เวอร์", player, 255, 255, 255, true) else triggerClientEvent( player, "onCommand", player, "login_error" ) end end addEvent( "onServerLogin", true ) addEventHandler( "onServerLogin", root, onServerLogin ) Hello this is a login panel server side help me pls to connect it with MYSQL Edited November 2, 2018 by Ekko Link to comment
#\_oskar_/# Posted November 2, 2018 Share Posted November 2, 2018 use dbConnect or executeSQLQuery Link to comment
Ekko Posted November 2, 2018 Author Share Posted November 2, 2018 5 minutes ago, #\_oskar_/# said: use dbConnect or executeSQLQuery i did my best to fix it i couldn't bro i need some one to fix it for me Link to comment
Ekko Posted November 2, 2018 Author Share Posted November 2, 2018 (edited) 8 minutes ago, Dimos7 said: show us what you did deleted all what i did it wont work so i decided to do some thing stupid i'm gonna use 2 login panels in my server , the first one for the design i'm trying now to add a Gui button to stop it after the player log in with the secend login panel Edited November 2, 2018 by Ekko 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