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

Wysłany: 2021-03-02, 13:47


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60



C.lua


if getElementData(localPlayer"player:sid"then return end
local sxsy guiGetScreenSize()

local sw,sh guiGetScreenSize()
local zoom 1
if sw 1920 then
    zoom math.min(21920 sw)
end
local font dxCreateFont('font.ttf',12/zoom)
local font2 dxCreateFont('font.ttf',20/zoom)
local actual false
local root getRootElement()
local tick getTickCount()
local resourceRoot getResourceRootElement(getThisResource())




local checkbox = {}
checkbox.login nil 


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

local sm = {}
sm.moov 0
sm.object1,sm.object2 nil,nil

local function removeCamHandler()
    if(sm.moov == 1)then
        sm.moov 0
    end
end
 
local function camRender()
    if (sm.moov == 1then
        local x1,y1,z1 getElementPosition(sm.object1)
        local x2,y2,z2 getElementPosition(sm.object2)
        setCameraMatrix(x1,y1,z1,x2,y2,z2)
    end
end
addEventHandler("onClientPreRender",root,camRender)
 
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
    if(sm.moov == 1)then return false end
    sm.object1 createObject(1337,x1,y1,z1)
    sm.object2 createObject(1337,x1t,y1t,z1t)
    setElementAlpha(sm.object1,0)
    setElementAlpha(sm.object2,0)
    setObjectScale(sm.object1,0.01)
    setObjectScale(sm.object2,0.01)
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
    sm.moov 1
    setTimer(removeCamHandler,time,1)
    setTimer(destroyElement,time,1,sm.object1)
    setTimer(destroyElement,time,1,sm.object2)
    return true
end

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

local muzyka false

local sw,sh guiGetScreenSize()
local zoom 1
if sw 1920 then
    zoom math.min(21920 sw)
end

function getCenter(xy)
    x,zoomzoom
    return (sw 2) - (2), (sh 2) - (2)
end
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 200
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(270 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end


function renderLoginBox()
        if actual == 'login' then
        dxDrawImage(0/zoom0/zoom1920/zoom1080/zoom"img/login.png"000tocolor(255,255,255,255), false)
    end
        if actual == 'register' then
        dxDrawImage(0/zoom0/zoom1920/zoom1080/zoom"img/login.png"000tocolor(255,255,255,255), false)
    end    
        if isMouseIn(853/zoom579/zoom214/zoom53/zoomthen
        dxDrawImage(853/zoom579/zoom214/zoom53/zoom":psrpg-logging/img/click2.png"000tocolor(255255255255), false)
    else
        dxDrawImage(853/zoom579/zoom214/zoom53/zoom":psrpg-logging/img/click.png"000tocolor(255255255255), false)
    end
    if actual == 'login' then
        dxDrawText("Kliknij aby przejsc do rejestracji"850/zoom781/zoom1070/zoom805/zoomtocolor(255255255255), 1font"center""center"falsefalsefalsefalsefalse)
dxDrawText("ZALOGUJ"881/zoom580/zoom1039/zoom630/zoomtocolor(255255255255), 1font2"center""center"falsefalsefalsefalsefalse)
    

        dxDrawText(guiGetText(zaloguj), 841/zoom386/zoom1119/zoom424/zoomtocolor(255255255255), 1font"left""center"false)
        if guiEditIsMasked(zarejestrujthen
        dxDrawText(string.gsub(guiGetText(zarejestruj), ".""*"), 841/zoom500/zoom1119/zoom538/zoomtocolor(255255255255), 1font"left""center"false)
    end
            dxDrawText("Zapami?taj mnie", (1920/2), 658lefttoptocolor(150150150255), 1"default-bold""center""center"falsefalsefalsefalsefalse)

        if checkbox.login == true then 
            dxDrawRectangle((1920/2)-956472020tocolor(2552040255), false)
        elseif checkbox.login == false then 
            dxDrawRectangle((1920/2)-956472020tocolor(404040255), false)
        end
end
    if actual == 'register' then
        dxDrawText("Kliknij aby przejsc do logowania"850/zoom781/zoom1070/zoom805/zoomtocolor(255255255255), 1font"center""center"falsefalsefalsefalsefalse)

        
        dxDrawText("ZAREJESTRUJ"881/zoom580/zoom1039/zoom630/zoomtocolor(255255255255), 1font2"center""center"falsefalsefalsefalsefalse)
        dxDrawText(guiGetText(zaloguj), 841/zoom386/zoom1119/zoom424/zoomtocolor(255255255255), 1font"left""center"false)
        if guiEditIsMasked(zarejestrujthen
        dxDrawText(string.gsub(guiGetText(zarejestruj), ".""*"), 841/zoom500/zoom1119/zoom538/zoomtocolor(255255255255), 1font"left""center"false)
    end
end

    if data.info then
        
        dxDrawText(""..data.info730/zoom826/zoom1193/zoom1047/zoomtocolor(25500255), 1font"center""center"falsefalsefalsefalsefalse)
    end

end


function math.round(numberdecimalsmethod)
    decimals decimals or 0
    local factor 10 decimals
    if (method == "ceil" or method == "floor"then return math[method](number factor) / factor
    else return tonumber(("%."..decimals.."f"):format(number)) end
end

addEvent("zapamietajMnie"true)
addEventHandler"zapamietajMnie"root, function(  )
    login =  editbox:dxGetEditText("login")
    pass =  editbox:dxGetEditText("has?o")
    if checkbox.login == true then 
    if not xml then
        xml xmlCreateFile("zapamietaj.xml","login")
        loginXML xmlCreateChild(xml,"login")
        passXML xmlCreateChild(xml,"password")
        checkboxXML xmlCreateChild(xml,"checkboxState")
        xmlNodeSetValue(loginXMLlogin)
        xmlNodeSetValue(passXMLpass)
        xmlNodeSetValue(checkboxXML"1")
        xmlSaveFile(xml)
      else
        loginXML xmlFindChild(xml,"login",0)
        passXML xmlFindChild(xml,"password",0)
        checkboxXML xmlFindChild(xml,"checkboxState",0)
        end
    end 
end)
        

addEvent("usunXML"true)
addEventHandler"usunXML"root, function(  )
    if checkbox.login == false then 
    fileDelete ("zapamietaj.xml")
    end 
end)



addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        local x_2y_2 getCenter(328,-115)
        local x_4y_4 getCenter(300,800)
        if isMouseIn(853/zoom579/zoom214/zoom53/zoom) and data.showed and actual == 'login' then
            setTimer(function()
            local login=guiGetText(zaloguj)
            local pass=guiGetText(zarejestruj)
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Aby si? zalogowa? nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
             end10001)
        elseif isMouseIn(853/zoom579/zoom214/zoom53/zoom) and data.showed and actual == 'register' then
            setTimer(function()
            local login=guiGetText(zaloguj)
            local pass=guiGetText(zarejestruj)
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                data.info="Nazwa/Has?o U?ytkownika musi zawiera? od 3 do 22 znak?w"
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
                end10001)
        elseif isMouseIn(874/zoom781/zoom179/zoom19/zoom) and data.showed and actual == 'login' then
            actual 'register'
        elseif isMouseIn(874/zoom781/zoom179/zoom19/zoom) and data.showed and actual == 'register' then
            actual 'login'
        
        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(muzyka)
        
        -- Usuwamy elementy
        destroyElement(zaloguj)
        destroyElement(zarejestruj)
        removeEventHandler("onClientRender"rootrenderLoginBox)
        removeEventHandler("onClientPreRender",root,camRender)

        local tick getTickCount()
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)



    local xml xmlLoadFile("zapamietaj.xml")
    if not xml then 
        checkbox.login false 
    end 
    local checkXML xmlFindChild(xml,"checkboxState"0)
    local checkGetChildValue xmlNodeGetValue(checkXML)
    if checkGetChildValue == "1" then 
        logXML xmlFindChild(xml,"zaloguj"0)
        passXML xmlFindChild(xml,"zarejestruj"0)
        logGetChildValue =  xmlNodeGetValue(logXML)
        passGetChildValue xmlNodeGetValue(passXML)
        
        checkbox.login true 
        dxSetEditText("zaloguj"logGetChildValue)
        dxSetEditText("zarejestruj"passGetChildValue)
        else 
            checkbox.login false  
    end  


addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    local tick getTickCount()
    muzyka=playSound("misc/intro2.mp3",true)
    actual 'login'
    setSoundVolume(muzyka1.0)
    showPlayerHudComponent("all",false)
    showPlayerHudComponent("radar",false)
    showPlayerHudComponent("crosshair",true)
    showPlayerHudComponent("weapon",false)
    showPlayerHudComponent("radar",false)
    showPlayerHudComponent("health",false)
    showPlayerHudComponent("breath",false)
    showPlayerHudComponent("clock",false)
    showPlayerHudComponent("ammo",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    zaloguj=guiCreateEdit(840/zoom386/zoom279/zoom38/zoom""false)
    zarejestruj=guiCreateEdit(840/zoom500/zoom2799/zoom38/zoom""false)  
    guiEditSetMasked(zarejestruj,true)
    guiEditSetMaxLength(zaloguj22)
    guiEditSetMaxLength(zarejestruj22)
    guiSetAlpha(zaloguj,0.0)
    guiSetAlpha(zarejestruj,0.0)
    guiSetVisible(zaloguj,true)
    guiSetVisible(zarejestruj,true)
end)



Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-03, 08:45


xyzzzikk

.gg






Wiek: 18
Na forum: 2774 dni
Posty: 175
Nick w MP: aspyk

Piwa: 6499

Respekt: 30,5

kt?ra to linia 252?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: zapamietywanie :: db3
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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