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

Wysłany: 2020-06-25, 17:05


xyzzzikk

.gg






Wiek: 19
Na forum: 2915 dni
Posty: 175
Nick w MP: aspyk

Piwa: 6564

Respekt: 30,5

Czesc,
mam logowanie z pysa 3.0,

lecz zedytowalem c_logging i gui normalnie dzia?a, lecz: nie loguje i nie wiem dlaczego, poprostu jak by funkcja IsMouseIn nie dzia?a?? od
 addEventHandler("onClientClick", root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*1605/1024, sy*459/768, sx*269/1024, sy*55/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < 2 or string.len(pass) < 2 then
                data.info="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
        end
        if isMouseIn(sx*1605/1024, sy*524/768,  sx*273/1024, sy*55/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            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?o powinno zawiera? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
        end
    end
end) 
- Ta cz??? jak by nie dzia?a?a ^^^

if getElementData(localPlayer, "player:sid") then return end

local root = getRootElement()
local resourceRoot = getResourceRootElement(getThisResource())
local screenWidth, screenHeight = guiGetScreenSize()


local blurStrength = 20


local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)
        
        dxSetShaderValue(blurShader, "ScreenSource", myScreenSource);
        dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
        dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight);

        dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
    end
end
addEventHandler("onClientRender", root, renderblur)

addEventHandler("onClientResourceStop", resourceRoot,
function()
    if (blurShader) then
        destroyElement(blurShader)
        blurShader = nil
    end
end)

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



local codelight = dxCreateFont("codelight.ttf", 11)


function renderLoginBox()


    dxDrawImage(0, 0, 1920, 1080, "images/logging.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
    --dxDrawRectangle(sx*0/1025, sy*0/769, sx*320/1025, sy*958/767, tocolor(0, 0, 0, 185), false)
    --dxDrawImage(0, 0, 1920, 1080, "misc/drift.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
    if data.info then dxDrawText(data.info, sx*-230/1024, sy*272/768, sx*565/1024, sy*290/768, tocolor(255, 255, 0, 255), 1.00, "default", "center", "center", false) end
    --dxDrawLine(sx*0/1024, sy*199/768, sx*1022/1024, sy*200/768, tocolor(31, 111, 193, 255), 5, false)
    --dxDrawLine(sx*0/1024, sy*509/768, sx*1022/1024, sy*510/768, tocolor(31, 111, 193, 255), 5, false)
    dxDrawText("L O G I N", sx*570/1024, sy*365/768, sx*565/1024, sy*325/768, white, 1.30, codelight, "center", "center", false)
    dxDrawText("H A S L O", sx*570/1024, sy*480/768, sx*565/1024, sy*302/768, white, 1.30, codelight, "center", "center", false)

    if not isMouseIn(sx*850/1024, sy*325/768, sx*150/1024, sy*45/768) then   dxDrawImage(sx*850/1024, sy*325/768, sx*150/1024, sy*45/768, "b_off.png", 0, 0, 0, tocolor(255,255,255, 255), false)
    else dxDrawImage(sx*850/1024, sy*325/768, sx*150/1024, sy*45/768, "b_on.png", 0, 0, 0, tocolor(255,255,255, 255), false) end

    if not isMouseIn(sx*850/1024, sy*370/768, sx*150/1024, sy*45/768) then dxDrawImage(sx*850/1024, sy*370/768, sx*150/1024, sy*45/768, "b_off.png", 0, 0, 0, tocolor(255,255,255, 255), false)
    else dxDrawImage(sx*850/1024, sy*370/768, sx*150/1024, sy*45/768, "b_on.png", 0, 0, 0, tocolor(255,255,255, 255), false) end

--    dxDrawText("Zaloguj", 1199*w, 470*h, 1664*w, 539*h, tocolor(255, 255, 255, 255), 1.00, codelight15, "right", "center", false, false, false, false, false)
    dxDrawText("Z A L O G U J", sx*1290/1024, sy*650/768, sx*565/1024, sy*45/768, tocolor(0,0,0,255), 1.10, codelight, "center", "center", false)
    dxDrawText("Z A R E J E S T R U J", sx*1290/1024, sy*740/768, sx*565/1024, sy*45/768, tocolor(0,0,0,255), 1.10, codelight, "center", "center", false)
    --dxDrawImage(sx * 0.016, sy * 0.0413, sx * 0.2838, sy * 0.2749, "logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png", angle, 0, -120 )
    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(sx*1605/1024, sy*459/768, sx*269/1024, sy*55/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < 2 or string.len(pass) < 2 then
                data.info="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
        end
        if isMouseIn(sx*1605/1024, sy*524/768,  sx*273/1024, sy*55/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            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?o powinno zawiera? 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
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender", root, renderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end, 3000, 1)
    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)
    showPlayerHudComponent("radar",false)
    setSoundVolume(data.misc, 1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender", root, renderLoginBox)
    local nick = getPlayerName( localPlayer )
    data.button[1]=guiCreateEdit(0.600, 0.43, 0.22, 0.04, ""..nick.."", true)
    data.button[2]=guiCreateEdit(0.600, 0.49, 0.22, 0.04, "", true)   
    guiEditSetMasked(data.button[2],true)
end)


[ Dodano: 2020-06-25, 17:06 ]
Dodam, ?e b??d?w w db3 nie ma

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-26, 14:51


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Nie zmienia?e? koordynat?w ekranowych?

Postaw piwo autorowi tego posta
 

 
Tagi: logowanie :: nie :: dziala
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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