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

Wysłany: 2016-08-10, 16:18


serwer123







Wiek: 26
Na forum: 3614 dni
Posty: 4
Nick w MP: xCyceK



Respekt: 50

Witam, jak zablokowa? mo?liwo?? wej?cia 2 os?b na jedno konto w tym samym czasie - oczywi?cie jest to panel logowania z ogrpg. Dzi?kuje za pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 16:23


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Spr?buj tak ;

 if getPlayerFromName(zmienna_nazwy_kontathen 
outputChatBox("Kto? ju? zalogowa? si? na to konto")
else
..... 
kod na logowanie


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 16:37


serwer123







Wiek: 26
Na forum: 3614 dni
Posty: 4
Nick w MP: xCyceK



Respekt: 50

M?g?by? mi z tym pom?c? nie ogarniam zbytnio tego, jestem nowy w lua.

client:


    ResourceOURGame 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.


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("Second-World.pl"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(2698197255), false)
    else dxDrawRectangle(sx*256/1024sy*408/768sx*226/1024sy*45/768tocolor(000202), falseend
    if not isMouseIn(sx*573/1024sy*407/768sx*226/1024sy*45/768then dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(2698197255), false)
    else dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(000202), 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
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    showPlayerHudComponent("all",false)
    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)   
end)



side:




    ResourceOURGame 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.
]]

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("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("logging:newAccount"true)

addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("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"]:dbSet("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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 21:16


GabWas







Wiek: 24
Na forum: 3881 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5

Jak nie ogarniasz LUA to nie bierz si? za panele logowania. _Wicek_ pokaza? Ci jak to masz zrobi?, wystarczy przeanalizowa? i samemu co? zrobi?, a nie na skrawkach lecie?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 23:37


Kurczak23







Wiek: 32
Na forum: 5032 dni
Posty: 30

Piwa: 499

Respekt: 115,3
Respekt: 115,3

Kod:

addEvent("logging:checkAccount", true)
addEventHandler("logging:checkAccount", resourceRoot, function(login,pass)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?", login)
if result and #result > 0 then
if result[1].login == login and result[1].pass == md5(pass) then
for i,player in pairs(getElementsByType("player")) do
if getElementData(player,"player:uid") == result[1].id then
triggerClientEvent(client, "logging:result", resourceRoot, false, "Kto? jest zalogowany na to konto!!!!!.")
return
end
setPlayerName(client, login)
setElementData(client, "player:uid", result[1].id)
triggerClientEvent(client, "logging:result", resourceRoot, true, nil)
else
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podane dane s? nieprawid?owe.")
end
else
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login nie istnieje w bazie.")
end
end)

addEvent("logging:newAccount", true)

addEventHandler("logging:newAccount", resourceRoot, function(login,pass)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?", login)
if result and #result > 0 then
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login ju? istnieje w bazie.")
else
local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass) VALUES (?,?)", login, md5(pass))
if query then
triggerClientEvent(client, "logging:result", resourceRoot, false, "Pomy?lnie zalogowa?e?(a?) si?")
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-11, 17:44


THEGizmo

Modeler/Uczeń Lua






Wiek: 27
Na forum: 4141 dni
Posty: 255
Nick w MP: THEGizmo

Piwa: 3072

Respekt: 200
Respekt: 200Respekt: 200

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("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("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("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 result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE serial=?"getPlayerSerial(source))
        if #result > 0 then
            triggerClientEvent(source"logging:result"resourceRootfalse"Ju? robi?e?/a? konto na tym serialu.")
        else
            local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,serial) VALUES (?,?,?)"loginmd5(pass),getPlayerSerial(source))
            if query then
                triggerClientEvent(client"logging:result"resourceRootfalse"Pomy?lnie zalogowa?e?(a?) si?")
            else
                triggerClientEvent(client"logging:result"resourceRootfalse"Nie uda?o si? stworzy? konta")
        end
    end
end)


Podpis
Modeler Corporation Sp. Z.O.O

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-11, 18:26


serwer123







Wiek: 26
Na forum: 3614 dni
Posty: 4
Nick w MP: xCyceK



Respekt: 50

Zrobi?em to co mi pokaza?e? ale to nadal nie dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: pomoc :: przy :: panelu :: 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 » Pomoc przy panelu 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