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

Wysłany: 2016-07-29, 16:51


OzikGames|YT

Skrypter LUA






Wiek: 25
Na forum: 3766 dni
Posty: 53
Nick w MP: OzikGames

Piwa: 749

Respekt: 50

Ostrzeżeń: 100%
Wygl?da to tak nie mog? si? zalogowa?
DB 3

http://imgur.com/a/zW47u

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

function renderLoginBox()
    dxDrawRectangle(sx*0/1024sy*201/768sx*1024/1024sy*308/768tocolor(000188), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    dxDrawLine(sx*0/1024sy*199/768sx*1022/1024sy*200/768tocolor(31111193255), 5false)
    dxDrawLine(sx*0/1024sy*509/768sx*1022/1024sy*510/768tocolor(31111193255), 5false)
    dxDrawText("Our Stories"sx*0/1024sy*157/768sx*1024/1024sy*237/768white2.00"pricedown""center""center"false)
    dxDrawText("U?ytkownik:"sx*256/1024sy*272/768sx*484/1024sy*305/768white1.00"default-bold""center""center"false)
    dxDrawText("Has?o"sx*571/1024sy*269/768sx*799/1024sy*302/768white1.00"default-bold""center""center"false)
    if not isMouseIn(sx*256/1024sy*408/768sx*226/1024sy*45/768then dxDrawRectangle(sx*256/1024sy*408/768sx*226/1024sy*45/768tocolor(353535193), false)
    else dxDrawRectangle(sx*256/1024sy*408/768sx*226/1024sy*45/768tocolor(15000193), falseend
    if not isMouseIn(sx*573/1024sy*407/768sx*226/1024sy*45/768then dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(353535193), false)
    else dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(15000193), falseend
    dxDrawText("Zaloguj si?"sx*255/1024sy*408/768sx*482/1024sy*453/768white1.00"default""center""center"false)
    dxDrawText("Zarejestruj si?"sx*572/1024sy*407/768sx*799/1024sy*452/768white1.00"default""center""center"false)
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*256/1024sy*408/768sx*226/1024sy*45/768) 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="Wype?nij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*573/1024sy*407/768sx*226/1024sy*45/768) 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="Wype?nij wszystkie pola!"
                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)
        
        -- Usuwamy elementy
        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(0.250.410.220.05""true)
    data.button[2]=guiCreateEdit(0.560.410.220.05""true)  
        guiEditSetMasked(data.button[2], trueend)


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 (sourcepozycja,90.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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-29, 21:47


Michaler







Wiek: 26
Na forum: 3798 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

baza danych uzupe?niona? tabele s??

Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 02:00


OzikGames|YT

Skrypter LUA






Wiek: 25
Na forum: 3766 dni
Posty: 53
Nick w MP: OzikGames

Piwa: 749

Respekt: 50

Ostrzeżeń: 100%
Michaler, S?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 12:25


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Albo nie widze, albo nigdzie nie ma funkcji 'dodaj' lub jej nie doda?e? tutaj na gtao.
masz taki folder jak og-db? i czy w folderze og-db w pliku meta.xml jest linijka:

export function="getRekord" type="server"
??

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 21:49


OzikGames|YT

Skrypter LUA






Wiek: 25
Na forum: 3766 dni
Posty: 53
Nick w MP: OzikGames

Piwa: 749

Respekt: 50

Ostrzeżeń: 100%
Jurandovsky, Nie mam dodaje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 21:52


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3


addEvent("onClientSendRegisterDataToServer"true)
addEventHandler("onClientSendRegisterDataToServer"getRootElement(), dodaj)
addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:getRekord("SELECT * FROM ogrpg_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["ogrpg-db"]:getRekord("SELECT * FROM ogrpg_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["ogrpg-db"]:setRekord("INSERT INTO ogrpg_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 (sourcepozycja,90.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)


Zle cos tu da?es chyba :) M?wilismy o tym

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 21:53


OzikGames|YT

Skrypter LUA






Wiek: 25
Na forum: 3766 dni
Posty: 53
Nick w MP: OzikGames

Piwa: 749

Respekt: 50

Ostrzeżeń: 100%
mixLoLmix2, Dzia?a Piwo I repka]

Zamknij kto?

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: logowanie :: mysql
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 Logowanie MySQL 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