SAM!! Posted June 28, 2018 Share Posted June 28, 2018 السلام عليكم الحين مسوي لوحة تسجيل دخول بس المشكلة لو الرقم السري والباس خطأ اللوحة تختفي انا مابيها تختفي الا لو المعلومات حقة صح ككلنت triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(user,puser) guiSetText(pass,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(user) local pass = guiGetText(pass) if ( source == btn.login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("onLoginWith",localPlayer,user,pass) else triggerServerEvent("onLogin",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == btn.reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("onReg",localPlayer,user,pass) else outputChatBox("* You Must Write Username Or Password",255,0,0) end end end ) ---------------------------------------------------------------------------- addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn.login ) then guiSetVisible ( main, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == gust ) then guiSetVisible ( main, false ) showCursor ( false ) end end ) وابي كمان شئ لو سمحت ابي يسوي حفظ تلقائي للتسجيل الدخول يعني لو ادخل بعدين ماتظهر امامي اللوحة يسوي تسجيل دخول تلقائي ولو ابغا الغية اسوي مثلا unauto في اف8 لو ابي ارجعة auto وشكرااا Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 بالنسبة لمشكلتك حقت تختفي , تفضل triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(user,puser) guiSetText(pass,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(user) local pass = guiGetText(pass) if ( source == btn.login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("onLoginWith",localPlayer,user,pass) else triggerServerEvent("onLogin",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == btn.reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("onReg",localPlayer,user,pass) else outputChatBox("* You Must Write Username Or Password",255,0,0) end end end ) ---------------------------------------------------------------------------- addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == gust ) then guiSetVisible ( main, false ) showCursor ( false ) end end ) لكن ’ لازمني اكواد سيرفر عشان كذا حتى لو سجلت دخولك راح اللوحة تظل ظاهره " إطرح اكواد سيرفر أما مشكلتك الثانية مافهمتها صراحة , أها فهمت طلبك الثاني , طيب إرسل اكواد سيرفر وأسويه لك Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 (edited) AbU - W6N 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 ) addEvent("onLoginWith",true) addEventHandler("onLoginWith",root, function (user,pass) local acc = getAccount(user,pass) local serial = getPlayerSerial(source) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) AddPlayer(serial,user,pass) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة المرور خطأ",source,255,0,0) end end ) addEvent("onLogin",true) addEventHandler("onLogin",root, function (user,pass) local acc = getAccount(user,pass) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة مرور خطأ",source,255,0,0) end end ) addEvent("onReg",true) addEventHandler("onReg",root, function (user,pass) local acc = getAccount(user,pass) if acc then outputChatBox("* هذا الحساب مستخدم من قبل",source,255,0,0) else addAccount(user,pass) outputChatBox("* Username = " .. user .. "",source,0,255,0) outputChatBox("* Password = " .. pass .. "",source,0,255,0) end end ) Edited June 28, 2018 by SAM!! Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 (edited) Client :- triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(user,puser) guiSetText(pass,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(user) local pass = guiGetText(pass) if ( source == btn.login ) then if user ~= "" and pass ~= "" then if guiCheckBoxGetSelected(remember) then triggerServerEvent("onLoginWith",localPlayer,user,pass) else triggerServerEvent("onLogin",localPlayer,user,pass) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end elseif ( source == btn.reg ) then if user ~= "" and pass ~= "" then triggerServerEvent("onReg",localPlayer,user,pass) else outputChatBox("* You Must Write Username Or Password",255,0,0) end end end ) ---------------------------------------------------------------------------- addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == gust ) then guiSetVisible ( main, false ) showCursor ( false ) end end ) addEvent("onCl",true); addEventHandler("onCl",root,function() guiSetVisible(main,false) showCursor(false) end ) بالنسبة لـ حق التسجيل التلقائي , بروح الحمام وأجي اسويه لآ تنسى اللايك " Edited June 28, 2018 by AbU - W6N 1 1 1 Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 AbU - W6N سلامات وين رووحت Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 Server :- executeSQLQuery("CREATE TABLE IF NOT EXISTS players_auto( serialx TEXT, userx TEXT, passx TEXT)") 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 addPlayerxz(serial,user,pass) executeSQLQuery("INSERT INTO players_auto(serialx,userx,passx) 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 isPlayerSavedAuto(serial) local sel = executeSQLQuery("SELECT serial FROM players_auto WHERE serialx=?",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 function getUsernameAndPassword(serial) local user,pass = "","" if isPlayerSavedAuto(serial) then local sel = executeSQLQuery("SELECT * FROM players_auto WHERE serialx=?",serial) for i,player in ipairs(sel) do if i == 1 then userx = player.userx passx = player.passx end end return userx,passx 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 if isPlayerSavedAuto(serial) then local user,pass = getUsernameAndPassword(serial) logIn(source,user,pass) triggerClientEvent(source,"onCl",source) end end ) addEvent("onLoginWith",true) addEventHandler("onLoginWith",root, function (user,pass) local acc = getAccount(user,pass) local serial = getPlayerSerial(source) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) AddPlayer(serial,user,pass) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة المرور خطأ",source,255,0,0) end end ) addEvent("onLogin",true) addEventHandler("onLogin",root, function (user,pass) local acc = getAccount(user,pass) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) triggerClientEvent(source,"onCl",source) setElementData(source,"Password",""..pass.."") else outputChatBox("* الحساب او كلمة مرور خطأ",source,255,0,0) end end ) addEvent("onReg",true) addEventHandler("onReg",root, function (user,pass) local acc = getAccount(user,pass) if acc then outputChatBox("* هذا الحساب مستخدم من قبل",source,255,0,0) else addAccount(user,pass) outputChatBox("* Username = " .. user .. "",source,0,255,0) outputChatBox("* Password = " .. pass .. "",source,0,255,0) end end ) addCommandHandler("auto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( not isPlayerSavedAuto(serial) ) then local Data = getElementData(p,"Password") addPlayerxz(serial,acc,Data) outputChatBox("* تم تفعيل الميزة",p,0,255,0) else ouputChatBox("* لقد قمت بتفعيل الميزة من قبل",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) addCommandHandler("unauto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( isPlayerSavedAuto(serial) ) then executeSQLQuery("DELETE FROM players_auto WHERE serialx=?", serial) outputChatBox("* تم إلغاء تفعيل الميزة",p,0,255,0) else outputChatBox("* هذه الميزة غير مفعلة",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) بالتوفيق وأعتذر عالتأخير Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 AbU - W6N اخي ولا يهمك بس للاأسف المود وقف؟ اللوحة ماتظهر دي بق Database query faild: no such column: serial Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 اطرح سطر الدي بق كامل! وأي سطر المشكلة انت لاني ماشوف مشكلة بالاكواد Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 AbU - W6N اخي عرفت منين المشاكل وسويتها كنت انت كاتب حرف خطأ الحين ظهرت اللوحة بس لما اخرج وادخل من السيرفر تظهرلي تاني معا العلم اني كتبت في اف8 auto Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 1 minute ago, SAM!! said: AbU - W6N اخي عرفت منين المشاكل وسويتها كنت انت كاتب حرف خطأ الحين ظهرت اللوحة بس لما اخرج وادخل من السيرفر تظهرلي تاني معا العلم اني كتبت في اف8 auto لآ مو كاتب حرف غلط , وين الحرف الغلط !!؟ سجل دخولك , بعدين اكتب باف8 auto واطلع من السيرفر , وارجع ادخل وشوف شيصير , و شوف الدي بق من لوق السيرفر لو يطلع شي. Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 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 if isPlayerSavedAuto(serial) then local user,pass = getUsernameAndPassword(serial) logIn(source,user,pass)------------- ذا الي انت معطهولي شوف كاتب logIn لهيك مايشتغل بس سويتها login اشتغل triggerClientEvent(source,"onCl",source) end end ) ------- login(source,user,pass)---سويتها هيك Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 سطر 129 , الاوتبوت شات بوكس نسيت حرف t فقط . Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 AbU - W6N يب سويت الاوت بوت ------------ الدي بق كامل attempt to call global 'login' (anil value) Database query faild: no such column: serial Database query faild: no such column: serial Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 كيف سويتها كلها سمول واشتغل ؟ !!! يعني تسوقها !!!!!!!!!؟؟؟ مو موجودة بالويكي وهذا مو فنكشن أصلاً وراح يجيبلك بلدي بق nil تسوقها! Just now, SAM!! said: AbU - W6N يب سويت الاوت بوت ------------ الدي بق كامل attempt to call global 'login' (anil value) Database query faild: no such column: serial Database query faild: no such column: serial جاك كذا لانك غيرتها لسمول! Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 attempt to call global 'login' (anil value) دي في السطر ذا logIn(source,user,pass) AbU - W6N لما كانت كابتل المود ماكان يشتغل Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 Just now, SAM!! said: attempt to call global 'login' (anil value) دي في السطر ذا logIn(source,user,pass) AbU - W6N لما كانت كابتل المود ماكان يشتغل دامك تعرف تطرح موضوع ليه ؟ + لا تستهبل لأنه ماينفع سمول! مافي فنكشن كذا Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 شوف ذا الدي بق لما اسويها سمول وش الي استهبل؟ ابي اخلص المود يخي 69:Bad argument @ 'login' [Expected account at argument 2, got nill] Database query faild: no such column: serial AbU - W6N AbU - W6N وين روحت؟ Link to comment
Ram, Posted June 28, 2018 Share Posted June 28, 2018 لي ساعة أقلك مافي فنكشن كذا وماترد , دامك تعرف ف سوها بنفسك 1 Link to comment
SAM!! Posted June 28, 2018 Author Share Posted June 28, 2018 AbU - W6N وش ياخي انا ماعرف وش يععني مو فاهم والله؟ AbU - W6N والله رجعتها logIn بس المود كلة وقت ذا الديبق سويتها مثل مانت تبي 69:Bad argument @ 'login' [Expected account at argument 2, got nill] Database query faild: no such column: serial ماتيجي اللوحة اصلا الحين Link to comment
Ram, Posted June 29, 2018 Share Posted June 29, 2018 Try, executeSQLQuery("CREATE TABLE IF NOT EXISTS players_auto( serialx TEXT, userx TEXT, passx TEXT)") 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 addPlayerxz(serial,user,pass) executeSQLQuery("INSERT INTO players_auto(serialx,userx,passx) 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 isPlayerSavedAuto(serial) local sel = executeSQLQuery("SELECT serial FROM players_auto WHERE serialx=?",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 function getUsernameAndPassword(serial) local user,pass = "","" if isPlayerSavedAuto(serial) then local sel = executeSQLQuery("SELECT * FROM players_auto WHERE serialx=?",serial) for i,player in ipairs(sel) do if i == 1 then userx = player.userx passx = player.passx end end return userx,passx 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 if isPlayerSavedAuto(serial) then local user,pass = getUsernameAndPassword(serial) logIn(source,user,pass) triggerClientEvent(source,"onCl",source) end end ) addEvent("onLoginWith",true) addEventHandler("onLoginWith",root, function (user,pass) local acc = getAccount(user,pass) local serial = getPlayerSerial(source) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) AddPlayer(serial,user,pass) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة المرور خطأ",source,255,0,0) end end ) addEvent("onLogin",true) addEventHandler("onLogin",root, function (user,pass) local acc = getAccount(user,pass) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) triggerClientEvent(source,"onCl",source) setElementData(source,"Password",""..pass.."") else outputChatBox("* الحساب او كلمة مرور خطأ",source,255,0,0) end end ) addEvent("onReg",true) addEventHandler("onReg",root, function (user,pass) local acc = getAccount(user,pass) if acc then outputChatBox("* هذا الحساب مستخدم من قبل",source,255,0,0) else addAccount(user,pass) outputChatBox("* Username = " .. user .. "",source,0,255,0) outputChatBox("* Password = " .. pass .. "",source,0,255,0) end end ) addCommandHandler("auto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( not isPlayerSavedAuto(serial) ) then local Data = getElementData(p,"Password") local user = tostring(acc) addPlayerxz(serial,user,Data) outputChatBox("* تم تفعيل الميزة",p,0,255,0) else ouputChatBox("* لقد قمت بتفعيل الميزة من قبل",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) addCommandHandler("unauto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( isPlayerSavedAuto(serial) ) then executeSQLQuery("DELETE FROM players_auto WHERE serialx=?", serial) outputChatBox("* تم إلغاء تفعيل الميزة",p,0,255,0) else outputChatBox("* هذه الميزة غير مفعلة",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) جرب إلي فوق , ولو ماضبط جرب هذا executeSQLQuery("CREATE TABLE IF NOT EXISTS players_auto( serialx TEXT, userx TEXT, passx TEXT)") 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 addPlayerxz(serial,user,pass) executeSQLQuery("INSERT INTO players_auto(serialx,userx,passx) 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 isPlayerSavedAuto(serial) local sel = executeSQLQuery("SELECT serial FROM players_auto WHERE serialx=?",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 function getUsernameAndPassword(serial) local user,pass = "","" if isPlayerSavedAuto(serial) then local sel = executeSQLQuery("SELECT * FROM players_auto WHERE serial=?",serial) for i,player in ipairs(sel) do if i == 1 then userx = player.userx passx = player.passx end end return userx,passx 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 if isPlayerSavedAuto(serial) then local user,pass = getUsernameAndPassword(serial) logIn(source,user,pass) triggerClientEvent(source,"onCl",source) end end ) addEvent("onLoginWith",true) addEventHandler("onLoginWith",root, function (user,pass) local acc = getAccount(user,pass) local serial = getPlayerSerial(source) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) AddPlayer(serial,user,pass) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة المرور خطأ",source,255,0,0) end end ) addEvent("onLogin",true) addEventHandler("onLogin",root, function (user,pass) local acc = getAccount(user,pass) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) triggerClientEvent(source,"onCl",source) setElementData(source,"Password",""..pass.."") else outputChatBox("* الحساب او كلمة مرور خطأ",source,255,0,0) end end ) addEvent("onReg",true) addEventHandler("onReg",root, function (user,pass) local acc = getAccount(user,pass) if acc then outputChatBox("* هذا الحساب مستخدم من قبل",source,255,0,0) else addAccount(user,pass) outputChatBox("* Username = " .. user .. "",source,0,255,0) outputChatBox("* Password = " .. pass .. "",source,0,255,0) end end ) addCommandHandler("auto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( not isPlayerSavedAuto(serial) ) then local Data = getElementData(p,"Password") local user = tostring(acc) addPlayerxz(serial,user,Data) outputChatBox("* تم تفعيل الميزة",p,0,255,0) else ouputChatBox("* لقد قمت بتفعيل الميزة من قبل",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) addCommandHandler("unauto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( isPlayerSavedAuto(serial) ) then executeSQLQuery("DELETE FROM players_auto WHERE serialx=?", serial) outputChatBox("* تم إلغاء تفعيل الميزة",p,0,255,0) else outputChatBox("* هذه الميزة غير مفعلة",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) NOTE : جرب الأول بعدين جرب الثاني Link to comment
SAM!! Posted June 29, 2018 Author Share Posted June 29, 2018 (edited) AbU - W6N اخي لا الاول ولا الثاني ظبط لما ادخل يجي لوحة التسجيل من تاني + لو ضغطت علي auto يقول تم تفعيل الميزة من قبل unauto يلغي الميزة اضغط auto تاني يقولي مفعلة من قبل وانا مافعلتها! --------------------------------------------------------- الكود الاول يخلي اللوحة ماتيجي اصلا دي بق 69:Bad argument @ 'login' [Expected account at argument 2, got nill] Database query faild: no such column: serial ------------------------------------------------------------------------------------------------------ الكود الثاني اللوحة تيجي بس مافي auto دي بق bad argument #1 to 'ipairs' (table expected, got string) Database query faild: no such column: serial Database query faild: no such column: serial Edited June 29, 2018 by SAM!! Link to comment
SAM!! Posted June 29, 2018 Author Share Posted June 29, 2018 Rakan# ساعدني انت بلــيز 1 Link to comment
TOUNSI |, السعأدة Posted June 29, 2018 Share Posted June 29, 2018 49 minutes ago, SAM!! said: Rakan# ساعدني انت بلــيز يخي سعدني بليز ايش يخي سوي محاولتك ونصلح لك اما نعطيك جاهز للأسف Link to comment
SAM!! Posted June 29, 2018 Author Share Posted June 29, 2018 MR.TOUNSI محاولتي؟ خذ executeSQLQuery("CREATE TABLE IF NOT EXISTS players_auto( serialx TEXT, userx TEXT, passx TEXT)") 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 addPlayerxz(serial,user,pass) executeSQLQuery("INSERT INTO players_auto(serialx,userx,passx) 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 isPlayerSavedAuto(serial) local sel = executeSQLQuery("SELECT serial FROM players_auto WHERE serialx=?",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 function getUsernameAndPassword(serial) local user,pass = "","" if isPlayerSavedAuto(serial) then local sel = executeSQLQuery("SELECT * FROM players_auto WHERE serial=?",serial) for i,player in ipairs(sel) do if i == 1 then userx = player.userx passx = player.passx end end return userx,passx 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 if isPlayerSavedAuto(serial) then local user,pass = getUsernameAndPassword(serial) logIn(source,user,pass) triggerClientEvent(source,"onCl",source) end end ) addEvent("onLoginWith",true) addEventHandler("onLoginWith",root, function (user,pass) local acc = getAccount(user,pass) local serial = getPlayerSerial(source) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) AddPlayer(serial,user,pass) triggerClientEvent(source,"onCl",source) else outputChatBox("* الحساب او كلمة المرور خطأ",source,255,0,0) end end ) addEvent("onLogin",true) addEventHandler("onLogin",root, function (user,pass) local acc = getAccount(user,pass) if acc then logIn(source,acc,pass) outputChatBox("* تم بنجاح تسجيل دخول",source,0,255,0) triggerClientEvent(source,"onCl",source) setElementData(source,"Password",""..pass.."") else outputChatBox("* الحساب او كلمة مرور خطأ",source,255,0,0) end end ) addEvent("onReg",true) addEventHandler("onReg",root, function (user,pass) local acc = getAccount(user,pass) if acc then outputChatBox("* هذا الحساب مستخدم من قبل",source,255,0,0) else addAccount(user,pass) outputChatBox("* Username = " .. user .. "",source,0,255,0) outputChatBox("* Password = " .. pass .. "",source,0,255,0) end end ) addCommandHandler("auto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( not isPlayerSavedAuto(serial) ) then local Data = getElementData(p,"Password") local user = tostring(acc) addPlayerxz(serial,user,Data) outputChatBox("* تم تفعيل الميزة",p,0,255,0) else ouputChatBox("* لقد قمت بتفعيل الميزة من قبل",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) end end ) addCommandHandler("unauto",function(p) local acc = getPlayerAccount(p) if ( not isGuestAccount(acc) ) then local serial = getPlayerSerial(p) if ( isPlayerSavedAuto(serial) ) then executeSQLQuery("DELETE FROM players_auto WHERE serialx=?", serial) outputChatBox("* تم إلغاء تفعيل الميزة",p,0,255,0) else outputChatBox("* هذه الميزة غير مفعلة",p,255,0,0) end else outputChatBox("* عليك ان تسجل دخولك أولاً",p,255,0,0) 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