HelpGuys Posted February 15, 2018 Share Posted February 15, 2018 addEvent("onGetSave",true) addEventHandler("onGetSave",root, function () local serial = getPlayerSerial(source) if isPlayerSave(serial) then local user,pass = getUserAndPass(serial) triggerClientEvent(source,"onPutSave",source,user,pass) end end ) عندي مشكلة في قيم مود لما اسجل دخولي واسوي حفظ وارجع اخش يطلع لى اول حساب دخلت بيه ومايتغير Link to comment
^iiEcoo'x_) Posted February 15, 2018 Share Posted February 15, 2018 سوي UPDATE لما يسجل دخول بحساب ثاني Link to comment
HelpGuys Posted February 15, 2018 Author Share Posted February 15, 2018 3 hours ago, DABL said: سوي UPDATE لما يسجل دخول بحساب ثاني كيف اخوي Link to comment
^iiEcoo'x_) Posted February 15, 2018 Share Posted February 15, 2018 إنت مستخدم قاعدة بيانات . Link to comment
HelpGuys Posted February 15, 2018 Author Share Posted February 15, 2018 ذا كود حق سيرفر تبي اوريك اكواد الكلينت ؟ اخوي عبرني Link to comment
' A F . Posted February 16, 2018 Share Posted February 16, 2018 إطرح لنا اكواد السيرفر كاملة Link to comment
HelpGuys Posted February 16, 2018 Author Share Posted February 16, 2018 executeSQLQuery("CREATE TABLE IF NOT EXISTS players_save( serial TEXT, user TEXT, pass TEXT)") function AddPlayer(serial,user,pass) executeSQLQuery("INSERT INTO players_save(serial,user,pass) VALUES(?,?,?)",serial,user,pass) end function isPlayerSave(serial) local sel = executeSQLQuery("SELECT serial FROM players_save WHERE serial=?",serial) if sel == 0 then return false else return true end end function getUserAndPass(serial) local user,pass = "","" if isPlayerSave(serial) then local sel = executeSQLQuery("SELECT * FROM players_save WHERE serial=?",serial) for i,player in ipairs(sel) do if i == 1 then user = player.user pass = player.pass end end return user,pass end return false end addEvent("onGetSave",true) addEventHandler("onGetSave",root, function () local serial = getPlayerSerial(source) if isPlayerSave(serial) then local user,pass = getUserAndPass(serial) triggerClientEvent(source,"onPutSave",source,user,pass) end end ) Link to comment
^iiEcoo'x_) Posted February 16, 2018 Share Posted February 16, 2018 function AddPlayer(serial,user,pass) local result = executeSQLQuery("SELECT serial,user,pass FROM players_save WHERE serial =?",serial) if ( result == 0 ) or ( not result ) then executeSQLQuery("INSERT INTO players_save(serial,user,pass) VALUES(?,?,?)",serial,user,pass) else executeSQLQuery("UPDATE players_save SET user =? , pass ? WHERE serial =?",user,pass,serial) end end 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