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

Wysłany: 2016-08-05, 09:18


NeroNix







Wiek: 27
Na forum: 3755 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Witam mam problem, ot?? po zalogowaniu nie daj? mi Premium, gdy? mam zmieniony panel logowania i inne funkcje przedstawia to si? tak:
Stare Logowanie

--[[
    Resource: OURGame
    Developers: Split <split.programista@gmail.com>
    Copyright <split.programista@gmail.com> 2015-2016
    You have no right to use this code without my permission.
    
    @updates
    - Dodano porawk? przy sprawdzaniu loginu
]]

addEvent('onServerPlayerLogin', true)
addEventHandler('onServerPlayerLogin', root, function(login, pass)
    local result=exports['og-db']:getRekord('SELECT * FROM og_users WHERE login=? AND pass=MD5(?)', login, pass)
    if result[1] and result[1].id then
        source:setName(result[1].login)
        source:setData('player:uid', result[1].id)

        local organizations=exports['og-db']:getRekord('SELECT * FROM og_orgplayers WHERE uid=?', result[1].id)
        if organizations[1] and organizations[1].id then
            local organizationsPlayer=exports['og-db']:getRekord('SELECT * FROM og_organizations WHERE id=?', org[1].id)
            if organizationsPlayer[1] and organizationsPlayer[1].Shortcut then
                if organizationsPlayer[1].Shortcut then
                    source:setData('organization:ShroutName', organizationsPlayer[1].Shortcut) 
                end
            end
        end    


        triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot, {success=true, komunikat=''})
    else
        triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot, {success=false, komunikat='Podane dane s? nieprawid?owe'})
    end
end)

addEvent('onServerPlayerRegister', true)
addEventHandler('onServerPlayerRegister', root, function(login, pass)
    local result=exports['og-db']:getRekord('SELECT * FROM og_users WHERE login=?', login)
    if result[1] and result[1].id then
        triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot, {success=false, komunikat='Podany login ju? istnieje'})
    else
        local result=exports['og-db']:getRekord('SELECT * FROM og_users WHERE serial=?', getPlayerSerial(source))
        if result[1] and result[1].id then
            triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot, {success=false, komunikat='Konto na tym serialu ju? istnieje'})
        else
            local result=exports['og-db']:setRekord('INSERT INTO og_users (login, pass, serial) VALUES (?,MD5(?),?)', login, pass, getPlayerSerial(source))
            if result then
                                triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot, {success=false, komunikat='Pomy?lnie za?o?ono konto'})
            else
                triggerClientEvent(source, 'onClientLoginRequestResponse', resourceRoot,  {success=false, komunikat='Nie uda?o si? stworzy? konta\nPowiadom administratora'})
            end
        end
    end
end)


Nowe

addEvent("onClientSendRegisterDataToServer", true)
addEventHandler("onClientSendRegisterDataToServer", getRootElement(), dodaj)
addEvent("logging:checkAccount", true)
addEventHandler("logging:checkAccount", resourceRoot, function(login,pass)
    local result=exports["og-db"]:getRekord("SELECT * FROM og_users WHERE login=?", login)
    if result and #result > 0 then
        if result[1].login == login and result[1].pass == md5(pass) then
            setPlayerName(client, login)
            setElementData(client, "player:uid", result[1].id)
            triggerClientEvent(client, "logging:result", resourceRoot, true, nil)
        else
            triggerClientEvent(client, "logging:result", resourceRoot, false, "Podane dane s? nieprawid?owe.")
        end
    else
        triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login nie istnieje w bazie.")
    end
end)
addEvent("onClientSendRegisterDataToServer", true)
addEventHandler("onClientSendRegisterDataToServer", getRootElement(), dodaj)
addEvent("logging:newAccount", true)
addEventHandler("logging:newAccount", resourceRoot, function(login,pass)
    local result=exports["og-db"]:getRekord("SELECT * FROM og_users WHERE login=?", login)
    if result and #result > 0 then
        triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login ju? istnieje w bazie.")
    else
        local query=exports["og-db"]:setRekord("INSERT INTO og_users (login,pass) VALUES (?,?)", login, md5(pass))
        if query then
            triggerClientEvent(client, "logging:result", resourceRoot, false, "Pomy?lnie zalogowa?e?(a?) si?")
        end
    end
end)

addEvent("core:spawnPlayer", true)
addEventHandler("core:spawnPlayer", resourceRoot, function()
local pozycja = getElementData (source, "player:spawn")
spawnPlayer (source, -1936.2734375, 882.55859375, 38.51273727417,270.0,0)
fadeCamera(source, false)
end)


function setCameraOnPlayerJoin()
     fadeCamera(source, true, 5)
     setCameraMatrix(source, 1254.14, 155.18, 66.37)
     spawnPlayer ( source, 0.0, 0.0, 5.0, 90.0, 0 )
end
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin)

a tu kod premium:

addEventHandler("onServerPlayerLogin", root, function()
stan = exports["premium"]:isPremium(source)
if stan then
setElementData(source, "Premium", true)
end
end)

Nie wiem na co zamieni? to w kodzie premium "onServerPlayerLogin" bo nie widz? w 2 panelu funkcji , ?e po zalogowaniu jest premium. Za pomoc R* i :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:34


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

W starym te? nie widz? ?adnej linijki dotycz?cej nadawaniu premium. Masz je na account data, MySQL?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 15:05


NeroNix







Wiek: 27
Na forum: 3755 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Shuffle, W starym by?o
addEventHandler("onServerPlayerLogin", root, function()

i dzia?a?o. Skrypt jest w mysql jest tutaj na stronie System Premium v1.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 16:20


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Tak to m?j system, ale on dzia?a zupe?nie inaczej, nie odwo?ujesz nim ?adnych trigger?w.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: 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 » Panel Logowania 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