Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-02-17, 22:53


chojnas

Serwerowspomagacz






Wiek: 23
Na forum: 3082 dni
Posty: 126
Nick w MP: xChojnas

Piwa: 383

Respekt: 35,8

Witam,
mam pewien problem, a mianowicie nie mog? si? zalogowa? na serwer, lecz wszystkie pliki db2 i ogrpg-db s? podpi?te pod baze danych, daje error oraz kod.
Kod:

[2018-02-17 22:44] ERROR: [bazadanych]/PanelLogowanie/s_logging.lua:83: attempt to concatenate field 'login2' (a nil value) [DUP x9]
[2018-02-17 22:44] WARNING: [bazadanych]/PanelLogowanie/s_logging.lua:82: Bad argument @ 'setPlayerName' [Expected string at argument 2, got nil] [DUP x9]
[2018-02-17 22:43] ERROR: [bazadanych]/PanelLogowanie/s_logging.lua:83: attempt to concatenate field 'login2' (a nil value)
[2018-02-17 22:43] WARNING: [bazadanych]/PanelLogowanie/s_logging.lua:82: Bad argument @ 'setPlayerName' [Expected string at argument 2, got nil]



--[[
     Panel Logowania by Kurianusz @2016 . 
     Regulamin /Licencja
     Korzystanie z tego kodu tylko jeĹĽeli posiadasz tzwcopyrightsZakaz usuwania tej notatki!
     Pami?™taj ĹĽe nielegalne korzystanie z kodu podpada pod kodeks karny :> Tak samo jak usuni?™cie tej notatki!
]]



function sprawdzorganizacje(plr)
local x exports['ogrpg-db']:dbGet("SELECT spawn from ogrpg_organization_list join ogrpg_organizations on ogrpg_organizations.code = ogrpg_organization_list.id WHERE uid=? and not(spawn=?)",getElementData(plr,"player:uid"),"0,0,0")
if and #x > 0 then
local t split(x[1].spawn",")
    return t
end
return false
end

function getAdmin(plr,level)
    if level then
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?"getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?"getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass,save)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        serial=getPlayerSerial(client)
        if result[1].register_serial~=serial then
            tak=true
            for i,v in ipairs(split(result[1].seriale,",")) do
                if v==serial then tak=false end
            end
            if tak then
                return triggerClientEvent(client"logging:result"resourceRootfalse"Nie moĹĽesz si?™ zalogowa?‡ na to konto!","nope")
            end
        end
        if result[1].login == login and result[1].pass == md5(passthen
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
            for i,player in pairs(getElementsByType("player")) do
                if getElementData(player,"player:uid") == result[1].id then
                triggerClientEvent(client"logging:result"resourceRootfalse"Kto?› jest zalogowany na to konto!!!!!.","blad")
                return
            end
            end
            --local result2=exports['ogrpg-db']:dbGet("SELECT login2 from ogrpg_users where id=?",result[1].id)
            if result[1].login2 == false then
            setPlayerName(clientlogin)
            else
            setPlayerName(clientresult[1].login2)
            triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?‚uge zmiana pseudonimu, twĂłj nick to: "..result[1].login2.."")
            end
            q=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            q3=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            if(tonumber(q[1].logowania_nagroda)<q3[1].logowania_nagroda)then
                nagrody[q3[1].logowania_nagroda](client)
                if(q3[1].logowania_nagroda==7)then
                    exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                end
            else
                exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            end
            if(savethen
                triggerClientEvent(client"createsaved:login",client,login,pass)
            else
                triggerClientEvent(client"deletesaved:login",client)
            end
            exports["ogrpg-db"]:dbSet("update ogrpg_users set ostatnio_online=NOW() where id=?"result[1].id)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottrue"Zalogowa?&#8218;e?&#8250; si?&#8482; pomyslnie","git")
            triggerEvent("SprawdzDom",root,client)
            setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))
            setElementData(client,"p:title",result[1].rp_tytul)
            if result[1].register_serial == false then
            --local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET register_serial=? WHERE login=?",getPlayerSerial(client),login)
            end
            local logs=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs_login (name,serial,data) VALUES (?,?,NOW())"string.format(login.."("..result[1].id..")"),getPlayerSerial(client))
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s?&#8230; nieprawid?&#8218;owe.","blad")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.","blad")
    end
end)
local maks_ilosc_kont -- Maksymalna ilosc kont do rejestracji
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
    if result and #result >= maks_ilosc_kont then
        triggerClientEvent(client"logging:result"resourceRootfalse"Na ten serial zostala utworzona maksymalna ilosc kont.","blad")
    return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login juĹĽ istnieje w bazie.","blad")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"wypierdalacchuje"),getPlayerSerial(client),1)
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Pomyslnie zarejestrowales(as) sie!","git")
            setElementData(client"player:logged"true)
        end
    end
end)


nagrody={
[1]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twoj pierwszy dzien kiedy jestes u nas pod rzad! Niedlugo otrzymasz na nagrode")
end,
[2]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj drugi dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 500PLN!")
    plr:giveMoney(500)
end,
[3]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj trzeci dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 600PLN!")
    plr:giveMoney(600)
end,
[4]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj czwarty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 750PLN!")
    plr:giveMoney(750)
end,
[5]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj pi?&#8230;ty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 900PLN!")
    plr:giveMoney(900)
end,
[6]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj szĂłsty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 1000PLN!")
    plr:giveMoney(1000)
end,
[7]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj siĂłdmy dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! 1 punkt premium!")
    exports["ogrpg-db"]:dbSet("update ogrpg_users set pp=pp+1 where id=? limit 1",plr:getData("player:uid"))
end,
 
}


Podpis

New experience incoming..
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-18, 14:40


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Hmm zobacz to ale nie jestem pewny
-[[
     Panel Logowania by Kurianusz @2016 . 
     Regulamin /Licencja
     Korzystanie z tego kodu tylko jeĹĽeli posiadasz tzwcopyrightsZakaz usuwania tej notatki!
     Pami?&#8482;taj ĹĽe nielegalne korzystanie z kodu podpada pod kodeks karny :> Tak samo jak usuni?&#8482;cie tej notatki!
]]



function sprawdzorganizacje(plr)
local x exports['ogrpg-db']:dbGet("SELECT spawn from ogrpg_organization_list join ogrpg_organizations on ogrpg_organizations.code = ogrpg_organization_list.id WHERE uid=? and not(spawn=?)",getElementData(plr,"player:uid"),"0,0,0")
if and #x > 0 then
local t split(x[1].spawn",")
    return t
end
return false
end

function getAdmin(plr,level)
    if level then
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?"getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?"getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass,save)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        serial=getPlayerSerial(client)
        if result[1].register_serial~=serial then
            tak=true
            for i,v in ipairs(split(result[1].seriale,",")) do
                if v==serial then tak=false end
            end
            if tak then
                return triggerClientEvent(client"logging:result"resourceRootfalse"Nie moĹĽesz si?&#8482; zalogowa?&#8225; na to konto!","nope")
            end
        end
        if result[1].login == login and result[1].pass == md5(passthen
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
            for i,player in pairs(getElementsByType("player")) do
                if getElementData(player,"player:uid") == result[1].id then
                triggerClientEvent(client"logging:result"resourceRootfalse"Kto?&#8250; jest zalogowany na to konto!!!!!.","blad")
                return
            end
            end
            local result2=exports['ogrpg-db']:dbGet("SELECT login2 from ogrpg_users where id=?",result[1].id)
            if result[1].login2 == false then
            setPlayerName(clientlogin)
            else
            setPlayerName(clientresult[1].login2)
            triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?&#8218;uge zmiana pseudonimu, twĂłj nick to: "..result[1].login2.."")
            end
            q=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            q3=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            if(tonumber(q[1].logowania_nagroda)<q3[1].logowania_nagroda)then
                nagrody[q3[1].logowania_nagroda](client)
                if(q3[1].logowania_nagroda==7)then
                    exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                end
            else
                exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            end
            if(savethen
                triggerClientEvent(client"createsaved:login",client,login,pass)
            else
                triggerClientEvent(client"deletesaved:login",client)
            end
            exports["ogrpg-db"]:dbSet("update ogrpg_users set ostatnio_online=NOW() where id=?"result[1].id)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottrue"Zalogowa?&#8218;e?&#8250; si?&#8482; pomyslnie","git")
            triggerEvent("SprawdzDom",root,client)
            setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))
            setElementData(client,"p:title",result[1].rp_tytul)
            if result[1].register_serial == false then
            --local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET register_serial=? WHERE login=?",getPlayerSerial(client),login)
            end
            local logs=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs_login (name,serial,data) VALUES (?,?,NOW())"string.format(login.."("..result[1].id..")"),getPlayerSerial(client))
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s?&#8230; nieprawid?&#8218;owe.","blad")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.","blad")
    end
end)
local maks_ilosc_kont -- Maksymalna ilosc kont do rejestracji
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
    if result and #result >= maks_ilosc_kont then
        triggerClientEvent(client"logging:result"resourceRootfalse"Na ten serial zostala utworzona maksymalna ilosc kont.","blad")
    return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login juĹĽ istnieje w bazie.","blad")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"wypierdalacchuje"),getPlayerSerial(client),1)
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Pomyslnie zarejestrowales(as) sie!","git")
            setElementData(client"player:logged"true)
        end
    end
end)


nagrody={
[1]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twoj pierwszy dzien kiedy jestes u nas pod rzad! Niedlugo otrzymasz na nagrode")
end,
[2]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj drugi dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 500PLN!")
    plr:giveMoney(500)
end,
[3]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj trzeci dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 600PLN!")
    plr:giveMoney(600)
end,
[4]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj czwarty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 750PLN!")
    plr:giveMoney(750)
end,
[5]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj pi?&#8230;ty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 900PLN!")
    plr:giveMoney(900)
end,
[6]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj szĂłsty dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! Otrzymujesz 1000PLN!")
    plr:giveMoney(1000)
end,
[7]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twĂłj siĂłdmy dzie?&#8222; kiedy jeste?&#8250; u nas pod rz?&#8230;d! 1 punkt premium!")
    exports["ogrpg-db"]:dbSet("update ogrpg_users set pp=pp+1 where id=? limit 1",plr:getData("player:uid"))
end,
 
}


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Tagi: niedziałający :: panel :: logowania
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku