mahmod3 Posted October 14, 2016 Share Posted October 14, 2016 السلام عليكم ورحمة الله نخش في الموضوع طول نبي اني ندير في لوحات تسجيل لاكن منديرش في زر حفظ حساب ومنعرفش نديره حطولي اكواد كامله او فنكشنات لان sql قاعد ماخشتش فيها ومقريتهاش يعني نبيهم ب lua او اي فنكشنات يا ريت مساعده Link to comment
iPrestege Posted October 14, 2016 Share Posted October 14, 2016 ومن قالك انه sql ماتسويها بلوا عموماً تقدر تسويها بالملف xml Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 Just now, FaHaD said: ومن قالك انه sql ماتسويها بلوا عموماً تقدر تسويها بالملف xml كيف يعني وش استخدم Link to comment
iPrestege Posted October 14, 2016 Share Posted October 14, 2016 xmlLoadFile xmlCreateFile xmlFindChild xmlCreateChild xmlNodeGetValue xmlNodeSetValue xmlSaveFile xmlUnloadFile guiSetText Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 3 minutes ago, FaHaD said: xmlLoadFile xmlCreateFile xmlFindChild xmlCreateChild xmlNodeGetValue xmlNodeSetValue xmlSaveFile xmlUnloadFile guiSetText بجرب وادا ماصار شي بطرح اكوادي وساعدني لان اول مرة تمر عليا هي الفنكشنات Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 3 hours ago, FaHaD said: xmlLoadFile xmlCreateFile xmlFindChild xmlCreateChild xmlNodeGetValue xmlNodeSetValue xmlSaveFile xmlUnloadFile guiSetText يعني حقيقة ماعرفت اسويها Link to comment
iPrestege Posted October 14, 2016 Share Posted October 14, 2016 ابحث في المنتدى عن طرق حفظ الحساب والرقم السري. Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 7 minutes ago, FaHaD said: ابحث في المنتدى عن طرق حفظ الحساب والرقم السري. كل الي شفتهم sql Link to comment
iPrestege Posted October 14, 2016 Share Posted October 14, 2016 سوية SQL افضل للسيرفر من الاق XML Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 3 minutes ago, FaHaD said: سوية SQL افضل للسيرفر من الاق XML انا ما اعرف sql انا داخل البرمجه من 4 او 5 اشهر بس راح اشوف اكواس سكيل وجيبهم واطرح معاهم اكواد لوحتي وانت ساعدني 4 minutes ago, FaHaD said: سوية SQL افضل للسيرفر من الاق XML اول انت اعملي اكواد sql للوحة تسجيل لحفظ الحسابات اكواد جاهزه امامها شرح مبسط Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 1 minute ago, iMr ~ MnHmAr said: شرح SQL انا شفت كل الشروحات على sql بس مافهمتها ما اعرف ليش Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 2 minutes ago, iMr ~ MnHmAr said: هذا حلو الشرح 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 ) addEventHandler("onPlayerLogin",root, function () name = getPlayerName(source) triggerClientEvent(root,"mahmod",root,name) end ) اكواد اللوحة سيرفر ماشتغل كود sql شخص عمله لي وما شتغل عموما شوفه وادا عرفت تصلحه بكون ممنون Link to comment
iMr ~ MnHmAr Posted October 14, 2016 Share Posted October 14, 2016 Just now, mahmod3 said: 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 ) addEventHandler("onPlayerLogin",root, function () name = getPlayerName(source) triggerClientEvent(root,"mahmod",root,name) end ) اكواد اللوحة سيرفر ماشتغل كود sql شخص عمله لي وما شتغل عموما شوفه وادا عرفت تصلحه بكون ممنون وش المشكله + ضيف المود لقروب الادمن جرب Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 Just now, iMr ~ MnHmAr said: وش المشكله + ضيف المود لقروب الادمن جرب ضفته بس ما يحفظ الحسابات Link to comment
iMr ~ MnHmAr Posted October 14, 2016 Share Posted October 14, 2016 اطرح الكلنت مثل ما قال الاخ Dr. Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 1 minute ago, iMr ~ MnHmAr said: اطرح الكلنت مثل ما قال الاخ Dr. sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 staticimage1 = guiCreateStaticImage(sx*5,sy*0,sx*1275,sy*764, "log.png", false) staticimage2 = guiCreateStaticImage(sx*476,sy*268, sx*358, sy*362, "dot_white.png", false, staticimage1) edit1 = guiCreateEdit(sx*85,sy*140,sx*204,sy*28, "", false, staticimage2) edit2 = guiCreateEdit(sx*85,sy*217,sx*204,sy*28, "", false, staticimage2) label2 = guiCreateLabel(sx*10,sy*141,sx*65,sy*33, "user name", false, staticimage2) label3 = guiCreateLabel(sx*10,sy*222,sx*65,sy*33, "password", false, staticimage2) close = guiCreateButton(sx*254,sy*307,sx*85,sy*39, "Gust", false, staticimage2) btn = guiCreateButton(sx*139,sy*272,sx*85,sy*39, "register", false, staticimage2) btn2 = guiCreateButton(sx*20,sy*306,sx*85,sy*39, "login", false, staticimage2) label1 = guiCreateLabel(sx*60,sy*64,sx*259,sy*67, "", false, staticimage2) remember = guiCreateCheckBox(sx*96,sy*254,sx*19,sy*18, "", false, false, staticimage2) label4 = guiCreateLabel(sx*115,sy*253,sx*66,sy*24, "remember", false, staticimage2) staticimage3 = guiCreateStaticImage(486, 53, 347, 242, "plus.png", false, staticimage1) 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(edit1) local pass = guiGetText(edit2) if ( source == btn2 ) 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 ) 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 == close ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn2 ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick",root, function (name) if source == btn then guiSetText( label1,"تم تسجيل قم ب الضغط على login?"..name.."") setTimer(guiSetVisible,3000,1, label1,false) end end ) Link to comment
iMr ~ MnHmAr Posted October 14, 2016 Share Posted October 14, 2016 جرب sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 staticimage1 = guiCreateStaticImage(sx*5,sy*0,sx*1275,sy*764, "log.png", false) staticimage2 = guiCreateStaticImage(sx*476,sy*268, sx*358, sy*362, "dot_white.png", false, staticimage1) edit1 = guiCreateEdit(sx*85,sy*140,sx*204,sy*28, "", false, staticimage2) edit2 = guiCreateEdit(sx*85,sy*217,sx*204,sy*28, "", false, staticimage2) label2 = guiCreateLabel(sx*10,sy*141,sx*65,sy*33, "user name", false, staticimage2) label3 = guiCreateLabel(sx*10,sy*222,sx*65,sy*33, "password", false, staticimage2) close = guiCreateButton(sx*254,sy*307,sx*85,sy*39, "Gust", false, staticimage2) btn = guiCreateButton(sx*139,sy*272,sx*85,sy*39, "register", false, staticimage2) btn2 = guiCreateButton(sx*20,sy*306,sx*85,sy*39, "login", false, staticimage2) label1 = guiCreateLabel(sx*60,sy*64,sx*259,sy*67, "", false, staticimage2) remember = guiCreateCheckBox(sx*96,sy*254,sx*19,sy*18, "", false, false, staticimage2) label4 = guiCreateLabel(sx*115,sy*253,sx*66,sy*24, "remember", false, staticimage2) staticimage3 = guiCreateStaticImage(486, 53, 347, 242, "plus.png", false, staticimage1) triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(edit1,puser) guiSetText(edit2,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(edit1) local pass = guiGetText(edit2) if ( source == btn2 ) 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 ) 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 == close ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn2 ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick",root, function (name) if source == btn then guiSetText( label1,"تم تسجيل قم ب الضغط على login?"..name.."") setTimer(guiSetVisible,3000,1, label1,false) end end ) Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 2 minutes ago, iMr ~ MnHmAr said: جرب sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 staticimage1 = guiCreateStaticImage(sx*5,sy*0,sx*1275,sy*764, "log.png", false) staticimage2 = guiCreateStaticImage(sx*476,sy*268, sx*358, sy*362, "dot_white.png", false, staticimage1) edit1 = guiCreateEdit(sx*85,sy*140,sx*204,sy*28, "", false, staticimage2) edit2 = guiCreateEdit(sx*85,sy*217,sx*204,sy*28, "", false, staticimage2) label2 = guiCreateLabel(sx*10,sy*141,sx*65,sy*33, "user name", false, staticimage2) label3 = guiCreateLabel(sx*10,sy*222,sx*65,sy*33, "password", false, staticimage2) close = guiCreateButton(sx*254,sy*307,sx*85,sy*39, "Gust", false, staticimage2) btn = guiCreateButton(sx*139,sy*272,sx*85,sy*39, "register", false, staticimage2) btn2 = guiCreateButton(sx*20,sy*306,sx*85,sy*39, "login", false, staticimage2) label1 = guiCreateLabel(sx*60,sy*64,sx*259,sy*67, "", false, staticimage2) remember = guiCreateCheckBox(sx*96,sy*254,sx*19,sy*18, "", false, false, staticimage2) label4 = guiCreateLabel(sx*115,sy*253,sx*66,sy*24, "remember", false, staticimage2) staticimage3 = guiCreateStaticImage(486, 53, 347, 242, "plus.png", false, staticimage1) triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(edit1,puser) guiSetText(edit2,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(edit1) local pass = guiGetText(edit2) if ( source == btn2 ) 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 ) 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 == close ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn2 ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick",root, function (name) if source == btn then guiSetText( label1,"تم تسجيل قم ب الضغط على login?"..name.."") setTimer(guiSetVisible,3000,1, label1,false) end end ) مشكور بس وش الي غيرته ؟ Link to comment
iMr ~ MnHmAr Posted October 14, 2016 Share Posted October 14, 2016 (edited) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(edit1,puser) -- هنا كنت حاط انت بدل اديت 1 اسم ثاني guiSetText(edit2,ppass) --وهنا بدال اديديت 2 اسم ثاني end ) العفووو Edited October 14, 2016 by iMr ~ MnHmAr Link to comment
mahmod3 Posted October 14, 2016 Author Share Posted October 14, 2016 2 minutes ago, iMr ~ MnHmAr said: addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(edit1,puser) -- هنا كنت حاط انت بدل اديت 1 اسم ثاني guiSetText(edit2,ppass) --وهنا بدال اديديت 2 اسم ثاني end ) العفووو طبعا الحين اكيد اقدر امسح التسجيلات يعني شخص سجل ابي امسح حسابه ومايرجع لما يدخل كيف ؟ وين الاقيه Link to comment
iMr ~ MnHmAr Posted October 14, 2016 Share Posted October 14, 2016 sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 staticimage1 = guiCreateStaticImage(sx*5,sy*0,sx*1275,sy*764, "log.png", false) staticimage2 = guiCreateStaticImage(sx*476,sy*268, sx*358, sy*362, "dot_white.png", false, staticimage1) edit1 = guiCreateEdit(sx*85,sy*140,sx*204,sy*28, "", false, staticimage2) edit2 = guiCreateEdit(sx*85,sy*217,sx*204,sy*28, "", false, staticimage2) label2 = guiCreateLabel(sx*10,sy*141,sx*65,sy*33, "user name", false, staticimage2) label3 = guiCreateLabel(sx*10,sy*222,sx*65,sy*33, "password", false, staticimage2) close = guiCreateButton(sx*254,sy*307,sx*85,sy*39, "Gust", false, staticimage2) btn = guiCreateButton(sx*139,sy*272,sx*85,sy*39, "register", false, staticimage2) btn2 = guiCreateButton(sx*20,sy*306,sx*85,sy*39, "login", false, staticimage2) label1 = guiCreateLabel(sx*60,sy*64,sx*259,sy*67, "", false, staticimage2) remember = guiCreateCheckBox(sx*96,sy*254,sx*19,sy*18, "", false, false, staticimage2) label4 = guiCreateLabel(sx*115,sy*253,sx*66,sy*24, "remember", false, staticimage2) staticimage3 = guiCreateStaticImage(486, 53, 347, 242, "plus.png", false, staticimage1) addEventHandler("onClientGUIClick",root, function () if guiCheckBoxGetSelected(remember) then triggerServerEvent("onGetSave",localPlayer) showCursor ( true ) else triggerServerEvent("onLogin",localPlayer,user,pass) end end ) addEvent("onPutSave",true) addEventHandler("onPutSave",root, function (puser,ppass) guiSetText(edit1,puser) guiSetText(edit2,ppass) end ) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(edit1) local pass = guiGetText(edit2) if ( source == btn2 ) 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 ) 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 == close ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn2 ) then guiSetVisible ( staticimage1, false ) guiSetVisible ( staticimage2, false ) guiSetVisible ( staticimage3, false ) showCursor ( false ) end end ) addEventHandler ( "onClientGUIClick",root, function (name) if source == btn then guiSetText( label1,"تم تسجيل قم ب الضغط على login?"..name.."") setTimer(guiSetVisible,3000,1, label1,false) 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