Jump to content

أخطا في أكواد


w7sH

Recommended Posts

السلام عليكم

عندي لوحة التسجيل اذا ضغطت على الأزرار ماتشتغل مع اني متأكد من جميع الكودات

نطلب مساعدتكم ..

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
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

معي هذا الكود من صنع مبرمج 

هذا الكود يجيب يوزر + باس 

للسريال المذكور

هل بإمكاني إضافته للكود حقي بأعلى الصفحة ؟

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
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

ممكن توضح أكثر أخوي؟

 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

أنا ماجيت هنا أبرر موقفي .. انا طلبت مساعدة من قسم البرمجة وفضلاً ليس أمراً .. هل ممكن مساعدتي أو لا ؟


#Edit:

-------------------------------------- Up up

Link to comment
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
  • 3 weeks later...
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 
) 

 

  • Like 1
Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...