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

Wysłany: 2021-02-21, 23:39


lolciaker12







Wiek: 26
Na forum: 2367 dni
Posty: 6
Nick w MP: Koral



Respekt: 50

Jak wgra?em nowy panel logowania ka?dy ma sid 0

kod panelu logowani c :

setElementData(localPlayer, "player:sid", nil)
setElementData(localPlayer, "player:logged", false)
--if getPlayerName(localPlayer) ~= "Liberty" then return end
if getElementData(localPlayer, "player:sid") then return end


local root = getRootElement()
local resourceRoot = getResourceRootElement(getThisResource())
local screenWidth, screenHeight = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local guiInfo = {
    browser = {
        volume = 200,
        dimness = 90,
        url = "https://www.youtube.com/embed/ZqAAjoeu0m4?rel=0&autoplay=1",
        loadTime = 8000,
}
}

x,y=2513.58, 1282.80-- my width
intro_step=math.random(0,850)

local sx,sy=guiGetScreenSize()
local data={ showed=nil, button={}, info=nil, misc=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(x, y, dist, angler)
    local a = math.rad(90 - angler)
    local dx = math.cos(a) * dist;
    local dy = math.sin(a) * dist;
    return x+dx, y+dy;
end

function loadBrowser() 
    loadBrowserURL(guiInfo.browser.browser, guiInfo.browser.url)
end

function onBrowserLoad(url)
    if url == guiInfo.browser.url then
        setTimer(setBrowserVolume, 1000, 2, guiInfo.browser.browser, guiInfo.browser.volume)
        setTimer(renderLoginBox, guiInfo.browser.loadTime, 1)
    end
end

local foncik = dxCreateFont('Regular.ttf', 16/1920 * sx)
local foncik2 = dxCreateFont('Regular.ttf', 11/1920 * sx)
function renderLoginBox()
    dxDrawImage(0, 0, sx, sy, guiInfo.browser.browser, 0, 0, 0)
    dxDrawRectangle(0, 0, sx, sy, tocolor(0, 0, 0, guiInfo.browser.dimness))
    dxDrawImage(0, 0, sx, sy, 'bg1.png', 0, 0, 0)
    
    if data.info then dxDrawText(data.info, 767/1920 * sx, 570/1080 * sy, 1152/1920 * sx, 625/1080* sy, tocolor(255, 255, 255, 200), 1.00, foncik2, "center", "center", false) end
    local x,y=getPointFromDistanceRotation(1413.58, 1082.80, dist, angler)
    setCameraMatrix(x,y,207.72+0.9,2623.69, 1285.66, 0+0.9)
    angler=(angler+0.1)
end





addEventHandler("onClientClick", root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(764/1920 * sx, 651/1080 * sy, 395/1920 * sx, 53/ 1080 * sy) and data.showed then
            local login=exports.editboxy:getEditboxText("login")
            local pass=exports.editboxy:getEditboxText("pass")
            if string.len(login) < 2 or string.len(pass) < 2 then
                data.info="NaleĹĽy wype?&#8218;ni?&#8225; wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
        end
        if isMouseIn(762/1920 * sx, 715/1080 * sy, 397/1920 * sx, 53/1080 *sy) and data.showed then
            local login=exports.editboxy:getEditboxText("login")
            local pass=exports.editboxy:getEditboxText("pass")
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
                data.info="Login i has?&#8218;o powinno zawiera?&#8225; od 3 do 22 znakĂłw."
                return
            end
            triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
        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
        exports.editboxy:destroyEditbox("login")
        exports.editboxy:destroyEditbox("pass")
        destroyElement(guiInfo.browser.browser)
        removeEventHandler("onClientRender", root, renderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end, 3000, 1)
    end
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
    guiInfo.browser.browser = createBrowser(sx, sy, false, false)
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    --data.misc=playSound("misc/intro.mp3",true)
    showPlayerHudComponent("radar",false)
    --setSoundVolume(data.misc, 1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?&#8482;")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender", root, renderLoginBox)
    local nick = getPlayerName( localPlayer )
--    data.button[1]=guiCreateEdit(0.045, 0.50, 0.22, 0.04, ""..nick.."", true)
    --data.button[2]=guiCreateEdit(0.045, 0.60, 0.22, 0.04, "", true)
    exports.editboxy:createEditbox("login", 0.40, 0.41, 0.20, 0.05, true, "", false, 90, foncik, false, 0, { 255, 255, 255, 120 }, true, { 0, 0, 0, 0 }, 2, true, 90, true, "Nazwa uĹĽytkownika", { 255, 255, 255, 160 }, true, 0, foncik, true, true, {0, 0, 0}, false)
    exports.editboxy:createEditbox("pass", 0.40, 0.47, 0.20, 0.05, true, "", true, 90, foncik, false, 0, { 255, 255, 255, 120 }, true, { 0, 0, 0, 0 }, 2, true, 90, true, "Has?&#8218;o", { 255, 255, 255, 160 }, true, 0, foncik, true, true, {0, 0, 0}, false)       
    addEventHandler("onClientBrowserCreated", guiInfo.browser.browser, loadBrowser)
    addEventHandler("onClientBrowserDocumentReady" , guiInfo.browser.browser, onBrowserLoad) 
end)


Ostatnio zmieniony przez NotPaladyn 2021-02-21, 23:57, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-21, 23:48


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

bledy db3? eldaty zgadzaja sie z pozostalymi ? :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-21, 23:49


_jvneczek







Wiek: 22
Na forum: 4466 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Auto_increment w bazie danych na ID.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-22, 13:30


lolciaker12







Wiek: 26
Na forum: 2367 dni
Posty: 6
Nick w MP: Koral



Respekt: 50

mam A_I w bazie danych i dalej to samo el sie zgadzaja w debugu wiec nwm ocb ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-22, 14:12


_jvneczek







Wiek: 22
Na forum: 4466 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5


setElementData(localPlayer, "player:sid", nil)

Nie dziwi mnie to, usu? t? linijke i wyczy?? konta.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-22, 15:28


lolciaker12







Wiek: 26
Na forum: 2367 dni
Posty: 6
Nick w MP: Koral



Respekt: 50

Dalej to samo ehhh

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-24, 15:47


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

W tabeli ustawione jest Auto_increment?
Tabela wyczyszczona i konta tworzone od nowa?

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dziala :: sid
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie dziala SID Odpowiedz do tematu

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