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

Wysłany: 2016-08-04, 19:47


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Witam, posiadam Gamemoda OGRPG v2 i mam problem z panelem logowania. Ot??, wgra?em ten z gtao i nie dzia?a mi ;( . Nie wczytuje kont ju? zajerejerstrowanych tylko nowe po rejerstracji jak to naprawi??.
Za pomoc R* i :piwo:
C_logging:

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local dist 10    
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(20 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function renderLoginBox()
    dxDrawImage(001366775"tlo.png"000tocolor(255255255255), false)
    dxDrawLine(415 1175 1415 1556tocolor(051169255), 1false)
    dxDrawLine(969175 1415 1175 1tocolor(051169255), 1false)
    dxDrawLine(415 1556969556tocolor(051169255), 1false)
    dxDrawLine(969556969175 1tocolor(051169255), 1false)
    dxDrawRectangle(415175554381tocolor(000200), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*222/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    dxDrawText("Login U?ytkownika:"522348788394tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Has?o U?ytkownika:"522440788476tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    if not isMouseIn(77837516542then dxDrawRectangle(77837516542tocolor(353535193), false)
    else dxDrawRectangle(77837516542tocolor(051169150), falseend
    if not isMouseIn(77847016540then dxDrawRectangle(77847016540tocolor(353535193), false)
    else dxDrawRectangle(77847016540tocolor(051169150), falseend
    dxDrawText("Zaloguj"836389979422tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Zarejestruj"8304801014515tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    dxDrawImage(50520035282"og.png"000tocolor(255255255255), false)

    local x,y=getPointFromDistanceRotation(1479.85486,-1700.9080distangler)
    setCameraMatrix(x,y,50)
    angler=(angler+0.1)
end
    
    
addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(77837516542) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info=" "
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(77847016540) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info=" "
                return
            end
            if string.len(login) > 22 or string.len(pass) > 30 then
                data.info="Login/Has?o musi mie? mniej ni? 22/30 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)


addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    showPlayerHudComponent("all",false)
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1] = guiCreateEdit(44437529239""false)
    data.button[2] = guiCreateEdit(44447029240""falseend)

addEvent("hideLoginWindow"true)
addEventHandler("hideLoginWindow"getResourceRootElement(getThisResource()), hideLoginWindow)


S_logging:

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)


c_zone:
local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function renderZoneBox()
    dxDrawImage(0/1440*sx0/900*sy1440/1440*sx900/900*sy"tlo.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    dxDrawText("Wyb?r Spawnu"sx*555/1024sy*215/768sx*288/1024sy*48/768tocolor(0155200193), 3.25"defualt-bold""center""center"false)
    --dxDrawText("Wyb?r Spawnu"sx*0/1024sy*157/768sx*1024/1024sy*237/768tocolor(0155200193), 3.25"defualt-bold""center""center"false)
    if not isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    if not isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    if not isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    dxDrawText("San Fierro"sx*98/1024sy*293/768sx*323/1024sy*386/768white1.00"default-bold""center""center"false)
    dxDrawText("Przechowywalnia"sx*416/1024sy*293/768sx*641/1024sy*386/768white1.00"default-bold""center""center"false)
    dxDrawText("Urz?d"sx*712/1024sy*293/768sx*937/1024sy*386/768white1.00"default-bold""center""center"false)
    dxDrawImage(50520035282"og.png"000tocolor(255255255255), false)
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{-1936.03883.5138.51})
            closeZones()
        end
        if isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{-2058.26466.3635.17})
            closeZones()
        end
        if isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{-1903.52486.8635.17})
               closeZones()
        end
    end
end)

function closeZones()
    showChat(true);
    showCursor(false);
    fadeCamera(false);
    setCameraTarget localPlayer )
    stopSound(data.misc)
    showPlayerHudComponent("all",true)
    showPlayerHudComponent("money",false)
    data.showed=false

    setTimer(triggerServerEvent20001"core:spawningPlayer"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
end

function showZones(misc)
    data.misc=misc
    data.showed=true
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender"rootrenderZoneBoxend


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 19:56


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Musisz doda? zarejestrowane konta do bazy danych

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 20:00


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
marcin778, S? w bazie danych i gdy pr?buje zalogowa? si? na swoje konto to "Podane dane s? nieprawid?owe."

[ Dodano: 2016-08-04, 20:13 ]
marcin778, Wiem co jest powodem tego ! w bazie danych zapisuje W DU?YCH LITERACH HASLO A JEST W MALYCH JAK TO ZMIENIC?

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