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

--[[
    ResourceOURGame
    DevelopersSplit <split.programista@gmail.com>
    Copyright <split.programista@gmail.com2015-2016
    You have no right to use this code without my permission.
    
    @updates
    Dodano porawkprzy sprawdzaniu loginu
]]

addEvent('onServerPlayerLogin'true)
addEventHandler('onServerPlayerLogin'root, function(loginpass)
    local result=exports['og-db']:getRekord('SELECT * FROM og_users WHERE login=? AND pass=MD5(?)'loginpass)
    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=truekomunikat=''})
    else
        triggerClientEvent(source'onClientLoginRequestResponse'resourceRoot, {success=falsekomunikat='Podane dane s? nieprawid?owe'})
    end
end)

addEvent('onServerPlayerRegister'true)
addEventHandler('onServerPlayerRegister'root, function(loginpass)
    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=falsekomunikat='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=falsekomunikat='Konto na tym serialu ju? istnieje'})
        else
            local result=exports['og-db']:setRekord('INSERT INTO og_users (login, pass, serial) VALUES (?,MD5(?),?)'loginpassgetPlayerSerial(source))
            if result then
                                triggerClientEvent(source'onClientLoginRequestResponse'resourceRoot, {success=falsekomunikat='Pomy?lnie za?o?ono konto'})
            else
                triggerClientEvent(source'onClientLoginRequestResponse'resourceRoot,  {success=falsekomunikat='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(passthen
            setPlayerName(clientlogin)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottruenil)
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s? nieprawid?owe.")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"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"resourceRootfalse"Podany login ju? istnieje w bazie.")
    else
        local query=exports["og-db"]:setRekord("INSERT INTO og_users (login,pass) VALUES (?,?)"loginmd5(pass))
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"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.2734375882.5585937538.51273727417,270.0,0)
fadeCamera(sourcefalse)
end)


function setCameraOnPlayerJoin()
     fadeCamera(sourcetrue5)
     setCameraMatrix(source1254.14155.1866.37)
     spawnPlayer source0.00.05.090.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: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

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: 3614 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: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

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