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

Wysłany: 2016-05-23, 20:31


Jakub123313

LUA / Mapper <3






Wiek: 31
Na forum: 4086 dni
Posty: 62
Nick w MP: DjBoreK

Piwa: 8

Respekt: 50

Od czasu kolega robi serwer Effect - Life i jako? nie dzia?a mu panel logowania

kod servera :

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)

Kod Clienta :


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

x,y=36.63,82.19 -- my width
intro_step=math.random(0,850)

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 100
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(90 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function renderLoginBox()
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    dxDrawRectangle(sx*270/1025sy*150/769sx*500/1025sy*458/767tocolor(000135), false)
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*272/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    --dxDrawLine(sx*0/1024sy*199/768sx*1022/1024sy*200/768tocolor(251690255), 5false)
    --dxDrawLine(sx*0/1024sy*509/768sx*1022/1024sy*510/768tocolor(251690255), 5false)
    dxDrawText("U?ytkownik:"sx*280/1024sy*270/768sx*760/1024sy*302/768white1.10"pricedown""center""center"false)
    dxDrawText("Has?o:"sx*-240/1024sy*480/768sx*1280/1024sy*302/768white1.10"pricedown""center""center"false)
    if not isMouseIn(sx*305/1024sy*506/768sx*200/1024sy*45/768then dxDrawRectangle(sx*305/1024sy*506/768sx*200/1024sy*45/768tocolor(020020165), false)
    else dxDrawRectangle(sx*305/1024sy*506/768sx*200/1024sy*45/768tocolor(505050165), falseend
    if not isMouseIn(sx*535/1024sy*506/768sx*200/1024sy*45/768then dxDrawRectangle(sx*535/1024sy*506/768sx*200/1024sy*45/768tocolor(020020165), false)
    else dxDrawRectangle(sx*535/1024sy*506/768sx*200/1024sy*45/768tocolor(505050165), falseend
    dxDrawText("Zaloguj"sx*685/1024sy*1015/768sx*130/1024sy*45/768white1.00"default-bold""center""center"false)
    dxDrawText("Zarejestruj"sx*1140/1024sy*1013/768sx*130/1024sy*45/768white1.00"default-bold""center""center"false)
    dxDrawImage(sx 0.3118sy 0.1813sx 0.3838sy 0.1549"logo.png"000tocolor(255255255255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png"angle0, -120 )
    
    --local x,y=getPointFromDistanceRotation(-1753.77,885.21distangler)
    --setCameraMatrix(x,y,242.08+5,-1753.77,885.21,242.08)
    --angler=(angler+0.3)

    local zone1=math.sin(intro_step/500)*9000
    local zone2=math.cos(intro_step/500)*9000
    setCameraMatrix (-2062.8857421875249.911132812550.4609375zone1zone22)
    --setCameraMatrix(zone1zone2120zone1zone2120)
    intro_step=intro_step-1.5
end



addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*305/1024sy*506/768sx*200/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*535/1024sy*506/768sx*200/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)
    setElementData localPlayer"shader"true )
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    showPlayerHudComponent("all",false)
    showPlayerHudComponent("money",false)
    showPlayerHudComponent("clock",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1]=guiCreateEdit(0.400.400.220.04""true)
    data.button[2]=guiCreateEdit(0.400.530.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Prosz? stosowa? znaczniki lua/code //Emm

Ostatnio zmieniony przez Emm 2016-05-23, 20:41, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-24, 19:42


_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%
Jakub123313, Ale co Ci tu nie dzia?a ?

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-24, 21:03


limitowanyy







Wiek: 43
Na forum: 4556 dni
Posty: 41

Piwa: 281

Respekt: 20,5

Ostrzeżeń: 20%
Zapewne na plik ogrpg-db a nie og-db, dlatego og_users nie transferuje i nie da sie zalogowac. :)

Postaw piwo autorowi tego posta
 

 
Tagi: efect :: life :: logowanie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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