w7sH Posted April 26, 2017 Share Posted April 26, 2017 السلام عليكم عندي لوحة التسجيل اذا ضغطت على الأزرار ماتشتغل مع اني متأكد من جميع الكودات نطلب مساعدتكم .. Server addEventHandler ("onResourceStart", resourceRoot,function ()executeSQLQuery ("CREATE TABLE IF NOT EXISTS `login_register addEventHandler ("onResourceStart", resourceRoot,function ()executeSQLQuery ("CREATE TABLE IF NOT EXISTS `login_register` (l_serial TEXT,l_username TEXT,l_password TEXT)") end) addEvent ( "Load", true ) addEventHandler ( "Load", root,function () local result = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_serial` = ?", getPlayerSerial (source) ) if ( type (result) == "table" and #result == 0) or not result then else triggerClientEvent (source, "Get:Text",source,result) end end) addEvent("save_",true) addEventHandler("save_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account,l_password) executeSQLQuery("INSERT INTO login_register(l_serial,l_username,l_password) VALUES(?,?,?)",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("login_",true) addEventHandler("login_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account, l_password) executeSQLQuery("DELETE FROM `login_register` WHERE `l_serial`=?",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("register_",true) addEventHandler("register_",getRootElement(),function (username,password) if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then if(addAccount(username,password)) then outputChatBox("#00ff00Thank you " .. getPlayerName(source) .. " #FF0000username #00ff00"..username.." #FF0000password #00ff00"..password,source,255,255,0,true) else outputChatBox("اسم المستخدم مأخوذ",source,255,0,0) end else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) Client addEventHandler("onClientGUIClick",resourceRoot,function () if ( source == login ) then if guiGetText (user) ~= '' and guiGetText (pass) ~= '' then if guiCheckBoxGetSelected (remember) == true then -- save true triggerServerEvent("save_",localPlayer,guiGetText (user),guiGetText (pass)) elseif guiCheckBoxGetSelected (remember) == false then -- save false triggerServerEvent("login_",localPlayer,guiGetText (user),guiGetText (pass)) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end end end) -------------------------------- addEvent("closeall",true) addEventHandler("closeall",root, function () showCursor(false) guiSetVisible(wnd, false) end) end) addEventHandler("onClientGUIClick",reg,function () triggerServerEvent("register_",localPlayer,guiGetText (user),guiGetText (pass)) end,false) Link to comment
^iiEcoo'x_) Posted April 26, 2017 Share Posted April 26, 2017 addEventHandler("onClientGUIClick",resourceRoot,function () if ( source == login ) then if guiGetText (user) ~= '' and guiGetText (pass) ~= '' then if guiCheckBoxGetSelected (remember) == true then -- save true triggerServerEvent("save_",localPlayer,guiGetText (user),guiGetText (pass)) elseif guiCheckBoxGetSelected (remember) == false then -- save false triggerServerEvent("login_",localPlayer,guiGetText (user),guiGetText (pass)) end else outputChatBox("* You Must Write Username Or Password",255,0,0) end end end) -------------------------------- addEvent("closeall",true) addEventHandler("closeall",root, function () showCursor(false) guiSetVisible(wnd, false) end) addEventHandler("onClientGUIClick",reg,function () triggerServerEvent("register_",localPlayer,guiGetText (user),guiGetText (pass)) end,false) جربه لو ما زبط اكتب باف 8 debugscript 3 Link to comment
N3xT Posted April 26, 2017 Share Posted April 26, 2017 السيرفر سايد فيه تخبيص على مستوى عالمي Link to comment
w7sH Posted April 26, 2017 Author Share Posted April 26, 2017 ماضبط معي اللي حطيته^ هل من مجيب؟ Link to comment
AE. Posted April 26, 2017 Share Posted April 26, 2017 (edited) شيل اول سطرين ف السيرفر وحط دا executeSQLQuery ("CREATE TABLE IF NOT EXISTS `login_register` (l_serial TEXT,l_username TEXT,l_password TEXT)") Edited April 26, 2017 by 3laa33 Link to comment
w7sH Posted April 26, 2017 Author Share Posted April 26, 2017 انا كل شي ضابط معي بس أبي أحط تسجيل تلقائي هل أقدر؟ Link to comment
w7sH Posted April 27, 2017 Author Share Posted April 27, 2017 معي هذا الكود من صنع مبرمج هذا الكود يجيب يوزر + باس للسريال المذكور هل بإمكاني إضافته للكود حقي بأعلى الصفحة ؟ addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = dbPoll ( dbQuery ( AutoLogin_DB, "SELECT * FROM `AutoLogin` WHERE `UserName`=?", tostring(account) ), -1 ) if #DB > 0 then local user, pass = tostring(DB[1].UserName), tostring(DB[1].PassWord) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end ) Link to comment
iMr.WiFi..! Posted April 27, 2017 Share Posted April 27, 2017 (edited) أخوي انا مسوي نظام التسجيل التلقائي + مهو مشفر تفضل : بس لاتضيف حقوقك تعلم من الاكواد Edited April 27, 2017 by iMr.WiFi..! Link to comment
w7sH Posted April 27, 2017 Author Share Posted April 27, 2017 13 hours ago, w7sH said: معي هذا الكود من صنع مبرمج هذا الكود يجيب يوزر + باس للسريال المذكور هل بإمكاني إضافته للكود حقي بأعلى الصفحة ؟ addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = dbPoll ( dbQuery ( AutoLogin_DB, "SELECT * FROM `AutoLogin` WHERE `UserName`=?", tostring(account) ), -1 ) if #DB > 0 then local user, pass = tostring(DB[1].UserName), tostring(DB[1].PassWord) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end ) طيب مافيه اجابة بخصوص الكود ذا Link to comment
' A F . Posted April 27, 2017 Share Posted April 27, 2017 يب تقدر عدل على كود sqlite عدل على اسم الجدول واسم الكولمن حق اسم الحساب بس Link to comment
w7sH Posted April 27, 2017 Author Share Posted April 27, 2017 ممكن توضح أكثر أخوي؟ addEventHandler ("onResourceStart", resourceRoot,function ()executeSQLQuery ("CREATE TABLE IF NOT EXISTS `login_register` (l_serial TEXT,l_username TEXT,l_password TEXT)") end) addEvent ( "Load", true ) addEventHandler ( "Load", root,function () local result = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_serial` = ?", getPlayerSerial (source) ) if ( type (result) == "table" and #result == 0) or not result then else triggerClientEvent (source, "Get:Text",source,result) end end) addEvent("save_",true) addEventHandler("save_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account,l_password) executeSQLQuery("INSERT INTO login_register(l_serial,l_username,l_password) VALUES(?,?,?)",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("login_",true) addEventHandler("login_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account, l_password) executeSQLQuery("DELETE FROM `login_register` WHERE `l_serial`=?",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("register_",true) addEventHandler("register_",getRootElement(),function (username,password) if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then if(addAccount(username,password)) then outputChatBox("*Done",source,255,255,0,false) else outputChatBox("اسم المستخدم مأخوذ",source,255,0,0) end else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) أو أذا تقدر تساعدني وتضيفه هذا كود سيرفر ^؟ Link to comment
' A F . Posted April 27, 2017 Share Posted April 27, 2017 الكؤد الي انت حاطة فوق قاعدة بيانات خاصة والكود حقك executeSQLQuery Link to comment
F_F Posted April 27, 2017 Share Posted April 27, 2017 ان هذا الكود لـ عناد وهو لمعرفة كلمة السر الخاصة باللاعب المراد ايجاده واسم الحساب في ماذا ستستعمله ؟ Link to comment
w7sH Posted April 27, 2017 Author Share Posted April 27, 2017 بستعمله لمساعدة اللاعبين اذا نسوا كلمة السر .. وش المشكلة ؟؟؟ Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 1 hour ago, w7sH said: بستعمله لمساعدة اللاعبين اذا نسوا كلمة السر .. وش المشكلة ؟؟؟ غير لهم كامة السر وخلص Link to comment
w7sH Posted April 27, 2017 Author Share Posted April 27, 2017 أنا ماجيت هنا أبرر موقفي .. انا طلبت مساعدة من قسم البرمجة وفضلاً ليس أمراً .. هل ممكن مساعدتي أو لا ؟ #Edit: -------------------------------------- Up up Link to comment
w7sH Posted April 29, 2017 Author Share Posted April 29, 2017 On ٢٧/٤/٢٠١٧ at 19:36, w7sH said: ممكن توضح أكثر أخوي؟ addEventHandler ("onResourceStart", resourceRoot,function ()executeSQLQuery ("CREATE TABLE IF NOT EXISTS `login_register` (l_serial TEXT,l_username TEXT,l_password TEXT)") end) addEvent ( "Load", true ) addEventHandler ( "Load", root,function () local result = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_serial` = ?", getPlayerSerial (source) ) if ( type (result) == "table" and #result == 0) or not result then else triggerClientEvent (source, "Get:Text",source,result) end end) addEvent("save_",true) addEventHandler("save_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account,l_password) executeSQLQuery("INSERT INTO login_register(l_serial,l_username,l_password) VALUES(?,?,?)",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("login_",true) addEventHandler("login_",getRootElement(),function (l_username,l_password) local account = getAccount (l_username,l_password) if ( account ~= false ) then logIn(source, account, l_password) executeSQLQuery("DELETE FROM `login_register` WHERE `l_serial`=?",getPlayerSerial(source),l_username,l_password) triggerClientEvent (source,"closeall",source) else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) addEvent("register_",true) addEventHandler("register_",getRootElement(),function (username,password) if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then if(addAccount(username,password)) then outputChatBox("*Done",source,255,255,0,false) else outputChatBox("اسم المستخدم مأخوذ",source,255,0,0) end else outputChatBox("* كلمة المرور او اسم المستخدم خطاء",source,255,0,0) end end) أو أذا تقدر تساعدني وتضيفه هذا كود سيرفر ^؟ هذا كود سيرفر حقي حق لوحة التسجيل ابي أضيف عليه هذا الكود addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = dbPoll ( dbQuery ( AutoLogin_DB, "SELECT * FROM `AutoLogin` WHERE `UserName`=?", tostring(account) ), -1 ) if #DB > 0 then local user, pass = tostring(DB[1].UserName), tostring(DB[1].PassWord) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end ) Link to comment
3NAD Posted May 16, 2017 Share Posted May 16, 2017 On 4/29/2017 at 03:03, w7sH said: هذا كود سيرفر حقي حق لوحة التسجيل ابي أضيف عليه هذا الكود addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = dbPoll ( dbQuery ( AutoLogin_DB, "SELECT * FROM `AutoLogin` WHERE `UserName`=?", tostring(account) ), -1 ) if #DB > 0 then local user, pass = tostring(DB[1].UserName), tostring(DB[1].PassWord) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end ) addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_username` = ?", tostring(account) ) if #DB > 0 then local user, pass = tostring(DB[1].l_username), tostring(DB[1].l_password) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end ) 1 Link to comment
w7sH Posted May 16, 2017 Author Share Posted May 16, 2017 4 hours ago, 3NAD said: addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_username` = ?", tostring(account) ) if #DB > 0 then local user, pass = tostring(DB[1].l_username), tostring(DB[1].l_password) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end 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