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

Wysłany: 2018-11-02, 10:17


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Witam mam poblem z panelem logowania YAD 3.1 gdy podmieni?em sobie wszystko z bazy danych mojej pod to co by?o z YAD 3.1 nie mg si? zalogowa?
oto kod

--[[
     Panel Logowania by Kurianusz @2016 . 
     Regulamin /Licencja
     Korzystanie z tego kodu tylko je?eli posiadasz tzwcopyrightsZakaz usuwania tej notatki!
     Pami?taj ?e nielegalne korzystanie z kodu podpada pod kodeks karny :> Tak samo jak usuni?cie tej notatki!
]]

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass,save)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        serial=getPlayerSerial(client)
        if result[1].register_serial~=serial then
            tak=true
            for i,v in ipairs(split(result[1].seriale,",")) do
                if v==serial then tak=false end
            end
            if tak then
                return triggerClientEvent(client"logging:result"resourceRootfalse"Error: Wykryto inny serial logowania konta. Napisz na forum","nope")
            end
        end
        if result[1].login == login and result[1].pass == md5(passthen
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka321321"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"dafgudhg63268"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka1233213"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"gdfdcvhj"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Trwa logowanie do konta...","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
            for i,player in pairs(getElementsByType("player")) do
                if getElementData(player,"player:uid") == result[1].id then
                triggerClientEvent(client"logging:result"resourceRootfalse"Podane konto jest juz zalogowane na serwerze.","blad")
                return
            end
            end
            --local result2=exports['ogrpg-db']:dbGet("SELECT login2 from ogrpg_users where id=?",result[1].id)
            if result[1].login2 == false then
            setPlayerName(clientlogin)
            else
            setPlayerName(clientresult[1].login2)
            triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?uge zmiana pseudonimu, tw?j nick to: "..result[1].login2.."")
            end
            --q=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            --exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            --q3=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            --if(tonumber(q[1].logowania_nagroda)<q3[1].logowania_nagroda)then
                --nagrody[q3[1].logowania_nagroda](client)
                --if(q3[1].logowania_nagroda==7)then
                    --exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                --end
            --else
                --exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            --end
            --if(savethen
                --triggerClientEvent(client"createsaved:login",client,login,pass)
            --else
                --triggerClientEvent(client"deletesaved:login",client)
            --end
            --exports["ogrpg-db"]:dbSet("update ogrpg_users set ostatnio_online=NOW() where id=?"result[1].id)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottrue"Baza danych laczy z twoim kontem. Zalogowano!","git")
            triggerEvent("SprawdzDom",root,client)
            --setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))
            --setElementData(client,"p:title",result[1].rp_tytul)
            if result[1].register_serial == false then
            --local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET register_serial=? WHERE login=?",getPlayerSerial(client),login)
            end
            local logs=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs_login (name,serial,data) VALUES (?,?,NOW())"string.format(login.."("..result[1].id..")"),getPlayerSerial(client))
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s? nieprawid?owe.","blad")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podane konto nie istnieje w bazie danych serwera.","blad")
    end
end)
local maks_ilosc_kont -- Maksymalna ilosc kont do rejestracji
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
    if result and #result >= maks_ilosc_kont then
        triggerClientEvent(client"logging:result"resourceRootfalse"Na ten serial zostala utworzona maksymalna ilosc kont.","blad")
    return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podane konto istnieje juz w bazie danych.","blad")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"*****"),getPlayerSerial(client),1)
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Konto zostalo utworzone pomyslnie. Zaloguj sie!","git")
            setElementData(client"player:logged"true)
        end
    end
end)

addEvent("sprawdzBana"true)
addEventHandler("sprawdzBana"root, function()
    local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban"getPlayerSerial(source))
    local result=exports["DB2"]:pobierzWyniki(query)
    if (resultthen
        outputConsole("---------",source)
        outputConsole("| Wydruk bana z serwera Life Game",source)
        outputConsole(string.format("| Zosta?e? zbanowany z powodu: "..result["reason"]),source)
        outputConsole(string.format("| Wa?ny ban do: "..result["time"]),source)
        outputConsole("---------",source)
        triggerClientEvent(client"oknoZbanowany"root)
        triggerClientEvent(client"bShowedLogin"root)
    else
        exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?""ban"getPlayerSerial(source))
    end
end)

addEvent("banWyrzuc"true)
addEventHandler("banWyrzuc"root, function()
    kickPlayer(source"Zosta?e? zbanowany na serwerze Life Game (Sprawd? konsole)!")
end)


i po stronie clineta

--[[
    ResourceOUGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]
if getElementData(localPlayer"player:uid"then return end

local dxfont0_erlan dxCreateFont("fonts/erlan.otf"16)
local sx,sy=guiGetScreenSize()
local screenWscreenH 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

addEvent("bShowedLogin"true)
addEventHandler("bShowedLogin"root, function()
    destroyElement(data.button[1])
    destroyElement(data.button[2])
    destroyElement(data.button[3])
    destroyElement(data.button[4])
    removeEventHandler("onClientRender"rootwstep_gui)
    setTimer(function()
    triggerServerEvent("banWyrzuc"localPlayer)
  end300001)
end)

function wstep_gui()
    if data.info then dxDrawText(data.info, (screenW 0.3547) + 1, (screenH 0.3194) - 1, (screenW 0.6242) + 1, (screenH 0.3417) - 1tocolor(255255255255), 1.00"default-bold""center""center"falsefalsetruefalsefalseend
    dxDrawImage((screenW * -0.0039) + 1, (screenH * -0.0100) - 1, (screenW 1.0000) + 1, (screenH 1.0270) - 1"logowa.png"000tocolor(255255255255), false)
    dxDrawText("Witaj na serwerze Life Game 3.5!\nRozgrywka serwera toczy si? w San Fierro\nZapraszamy na nasz discord, tam b?d? dost?pne rekrutacje wszelkiego rodzaju\nMamy nadzieje, ?e b?dziesz si? ?wietnie bawi?! Nie zapomnij doda? serwera do ulubionych.\nW imieniu administracji ?yczymy mi?ego sp?dzenia czasu na serwerze!"screenW 0.2961screenH 0.8069screenW 0.6992screenH 0.9569tocolor(255255255255), 1.00"default""center""top"falsefalsetruefalsefalse)

end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn((screenW 0.1172) + 1, (screenH 0.6361) - 1, (screenW 0.1016) + 1, (screenH 0.0319) - 1) 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="[B??d - Logowanie] Musisz uzupe?ni? ka?de pole!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn((screenW 0.5930) + 1, (screenH 0.6389) - 1, (screenW 0.1016) + 1, (screenH 0.0319) - 1) and data.showed then
            local login=guiGetText(data.button[3])
            local pass=guiGetText(data.button[4])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="[B??d - Rejestracja] Musisz uzupe?ni? ka?de pole!"
                return
            end
            if string.len(login) > 22 or string.len(pass) > 30 then
                data.info="[B??d - Rejestracja] Tw?j login oraz has?o musz? zawieca? 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])
        destroyElement(data.button[3])
        destroyElement(data.button[4])
        removeEventHandler("onClientRender"rootwstep_gui)
    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
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    setPlayerHudComponentVisible("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    setElementData(localPlayer,"player:logged",false)
    setPlayerHudComponentVisible("radar",false)
    triggerServerEvent("sprawdzBana"localPlayer)
    addEventHandler("onClientRender"rootwstep_gui)
    data.button[1] = guiCreateEdit(0.120.460.260.04""true)
    data.button[2] = guiCreateEdit(0.120.540.260.04 ""true)
    data.button[3] = guiCreateEdit(0.600.460.260.04""true)
    data.button[4] = guiCreateEdit(0.600.540.260.04""true)      
    guiEditSetMasked(data.button[2],true)
    guiEditSetMasked(data.button[4],true)
end)


Podpis

Pomagam jak potrafię :)

Ostatnio zmieniony przez AsterBonzo 2018-11-25, 21:54, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 18:13


Zbigniewqq

Szkrypter Luła






Wiek: 23
Na forum: 3090 dni
Posty: 83
Nick w MP: Zbigniewqq

Piwa: 1083

Respekt: 61

Podpi??e? db?

Podpis

100 :piwo: - 28.12.2018r.
200 :piwo: - 24.01.2019r.
300 :piwo: - 01.02.2019r.
Support-Team - 03.02.2019r.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 18:51


Query

SyndicateMTA






Wiek: 24
Na forum: 3071 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

DjMaXimoMax, debugscript 3 ?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 20:15


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

db3


Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 20:25


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

nie masz modu?u mysql

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 20:28


Query

SyndicateMTA






Wiek: 24
Na forum: 3071 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

Tak?e w linijce 121 po stronie servera zmie?
ogrpg-db:pobierzWyniki

na
DB2:pobierzWyniki


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 20:34


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

"killercycDDS" napisał/a:

nie masz modu?u mysql


No napewno jak bym nie mia? to bym nie pisa? ja wiem co mam robi? typie ju? mam edycje 3.5 serwera na podstawie ogrpg a ta edycja jest lepsza wi?c jak nie mam podpi?te pod mysql ?

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 20:57


Query

SyndicateMTA






Wiek: 24
Na forum: 3071 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

wpisz w konsoli loadmodule mta_mysql.so

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 21:27


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

xD sory killercycDDS m?j b??d nie zauwa?y?em i nie mam modu?u sorka.
Da kto? modu? ? xd

[ Dodano: 2018-11-25, 21:50 ]
Prosze o szybk? pomoc daje piwerko za pomoc :piwo:

[ Dodano: 2018-11-25, 21:54 ]
plsss

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-26, 14:49


Mefis







Wiek: 28
Na forum: 4009 dni
Posty: 28
Nick w MP: Navviedzony

Piwa: 2

Respekt: 50

DjMaXimoMax, Tu masz wszytko opisane co i jak masz zrobi? + modu?y do pobrania gtao.pl/tut-jak-zainstalowac-modul-vt114466.htm

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
jarsa132
Wysłany: 2018-11-26, 15:18


Zbigniewqq

Szkrypter Luła






Wiek: 23
Na forum: 3090 dni
Posty: 83
Nick w MP: Zbigniewqq

Piwa: 1083

Respekt: 61

Nie nie, Moze zmieniles nazwe z ogrpg-db na jak?? inn? i dlatego nie dzia?a xD

Podpis

100 :piwo: - 28.12.2018r.
200 :piwo: - 24.01.2019r.
300 :piwo: - 01.02.2019r.
Support-Team - 03.02.2019r.

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: yad :: 3.1
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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