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

Wysłany: 2016-05-02, 16:03


amama5







Wiek: 39
Na forum: 4745 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
Witam, mam problem z panelem logowania, ot?? chc? aby po rejerstacji nie przenosi?o od razu do gry , lecz trzeba b?dzie klikn?? przycisk "zaloguj". Jak to zrobi? prosz? o szybk? pomoc!!!! za pomoc R* i :piwo:

Client:

--[[
    Resourceog-login
    DevelopersSplit <split.programista@gmail.com>
    Copyright <split.programista@gmail.com2015-2016
    You have no right to use this code without my permission.

    @update
    Dodano poprawke trigger?w
]]

local data={}
data.textShowbox=''
data.GUI={}
data.music=false
data.guiLU=getTickCount()
data.infoLU=getTickCount()

local intro_step=math.random(100010000)

local font=dxCreateFont('opensans.ttf'11)
local function render()
    local zone1=math.sin(intro_step/100)*1500
    local zone2=math.cos(intro_step/100)*1500
    setCameraMatrix(zone1zone2120zone1zone2120)
    intro_step=intro_step-0.01

    if data.GUI[1then
        local height=interpolateBetween(-0.3*20.00.00.30.00.0, (getTickCount()-data.guiLU)/1500'OutBounce')
        data.GUI[1]:setPosition(0.32heighttrue)
    end

    if data.textShowbox:len()<3 then return end

    local height=interpolateBetween(-0.050*20.00.00.0500.00.0, (getTickCount()-data.infoLU)/700'OutBounce')
    dxDrawRelativeRectangle(0.7height0.250.15tocolor(58129196196), false)
    dxDrawRelativeText(data.textShowbox0.65height+0.110.1white1.30font'center''center')
end

local function intro_fadeInGUI()
    if not data.GUI[1then return end
    local alpha=data.GUI[1]:getAlpha()
    alpha=alpha+0.050
    if alpha>=1 then
        showCursor(true)
        return
    else
        data.GUI[1]:setAlpha(alpha)
        Timer(intro_fadeInGUI801)
    end
end

local function intro_fadeOutAudio()
    local vol=data.music:getVolume()
    vol=vol-0.05
    data.music:setVolume(vol)
    if vol<=0 then
        data.music:destroy()
    else
        Timer(intro_fadeOutAudio1501)
    end
end

addEventHandler('onClientGUIClick'resourceRoot, function()
    local login=data.GUI[4]:getText()
    local pass=data.GUI[5]:getText()

    if source==data.GUI[2then
        if login:len()<and pass:len()<6 then
            data.textShowbox='Login jak i has?o jest wymagane'
            data.infoLU=getTickCount()
            Timer(function()
                data.textShowbox=''
            end20001)
            return
        end
        triggerServerEvent('onServerPlayerLogin'localPlayerloginpass)
    end
    if source==data.GUI[3then
        if login:len()<and pass:len()<6 then
            data.textShowbox='Odnotowano ma?? liczb? znak?w\nw ha?le i w loginie'
            data.infoLU=getTickCount()
            Timer(function()
                data.textShowbox=''
            end20001)
            return
        elseif login:len()>24 and pass:len()>20 then 
            data.textShowbox='Odnotowano zbyt du?? liczb? znak?w\nw ha?le i w loginie'
            data.infoLU=getTickCount()
            Timer(function()
                data.textShowbox=''
            end20001)
            return
        end
        triggerServerEvent('onServerPlayerRegister'localPlayerloginpass)
    end
end)

addEventHandler('onClientResourceStart'resourceRoot, function()
    if localPlayer:getData('player:logged'then return end

    showChat(true); showCursor(true); fadeCamera(true)
    
    guiSetInputMode('no_binds_when_editing')
    data.GUI[1]=guiCreateStaticImage(0.320.30.360.26'img/bg.png'true)
    data.GUI[2]=guiCreateStaticImage(0.70.380.280.18'img/btnlogin.png'truedata.GUI[1])
    data.GUI[3]=guiCreateStaticImage(0.70.620.280.18'img/btnregister.png'truedata.GUI[1])
    data.GUI[4]=guiCreateEdit(0.0900.40.50.16''truedata.GUI[1])
    data.GUI[4]:setMaxLength(24)
    data.GUI[5]=guiCreateEdit(0.0900.70.50.16''truedata.GUI[1])
    data.GUI[4]:setMaxLength(16)
    data.GUI[5]:setMasked(true)

    data.GUI[1]:setAlpha(1)
    -- intro_fadeInGUI()
    data.infoLU=getTickCount()
    data.guiLU=getTickCount()
    -- intro music
    data.music=playSound('audio/a_intro.ogg');
    data.music:setVolume(0.5)

    addEventHandler('onClientRender'rootrender)
    outputDebugString('[og-login]: was initiated on ' .. localPlayer:getName())
end)

addEvent('onClientLoginRequestResponse'true)
addEventHandler('onClientLoginRequestResponse'resourceRoot, function(response)
    if response.success then
        intro_fadeOutAudio();
        showChat(true); showCursor(false); fadeCamera(false)
        
        data.GUI[1]:destroy()
        removeEventHandler('onClientRender'rootrender)
        Timer(function()
            triggerServerEvent('core:spawningPlayer'localPlayer)
        end30001)
    else
        if not response.komunikat then return end
        data.textShowbox=response.komunikat
        data.infoLU=getTickCount()
        Timer(function()
            data.textShowbox=''
        end20001)
    end
end)


Server:

--[[
    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=?'organizations[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[555] and result[555].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=truekomunikat='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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-02, 21:45


PolskiSebek12

Programista






Wiek: 28
Na forum: 4347 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3883

Respekt: 288,8
Respekt: 288,8Respekt: 288,8Respekt: 288,8

Ostrzeżeń: 100%
spytaj si? autora skryptu, Splita

Podpis
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