Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
Wysłany: 2018-09-09, 15:05


SataN.







Wiek: 15
Na forum: 1811 dni
Posty: 741
Nick w MP: SataN

Piwa: 3660

Respekt: 44


Ostrzeżeń: 100%
Loading script failed: login-panel\c.lua:214: 'end' expected(to close 'function' at line 95) near '<eof>'
if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
local selectedLanguage false 

local startTicking getTickCount()
local blurStrength 20

local sx,sy=guiGetScreenSize()

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")

function handleKeys(keypress)
    if key == "mouse1" then 
        if press then 
            if selectedLanguage then 
                if isCursorOnElement(504*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryLogin"localPlayerguiGetText(login), guiGetText(pass))
                elseif isCursorOnElement(701*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryRegister"localPlayerguiGetText(login), guiGetText(pass))
                end
            end
        end
    end
end 

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

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

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

dxfont0_gz dxCreateFont("gz.ttf",30)
dxfont1_gz dxCreateFont("gz.ttf",20)
dxfont2_gz dxCreateFont("gz.ttf"14)

x,y=-2006.86,45.18,67.34-- my width
intro_step=math.random(0,850)

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 roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
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
local screenWscreenH guiGetScreenSize()

function renderLoginBox()
if data.misc then
            local bit getSoundFFTData(data.misc20483)
            for i,v in ipairs(bit) do
                rytm math.round((v*320),0)>100 and 100 or math.round((v*320),0)
                dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"light.png"000tocolor(0114255rytm), false)
            end
    local localization exports["br_localization"]
    
    if not selectedLanguage then 
        dxDrawRectangle(381*sx268*sy604*sx235*sytocolor(000202), false)
        if isCursorOnElement(405*sx313*sy254*sx143*sythen 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "english"
                localization:setPlayerLocalization(localPlayer"english")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255155), false)
        end 
        
        if isCursorOnElement(705*sx313*sy254*sx143*sythen 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "polish"
                localization:setPlayerLocalization(localPlayer"polish")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255155), false)
        end
                   dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"graficzka.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.info,  screenW 0.1875screenH 0.7025screenW 0.8305screenH 0.7488tocolor(255255255255), 1.00dxfont2_gz"center""center"falsefalsefalsefalsefalseend
    dxDrawText("Login"screenW 0.1945screenH 0.3850screenW 0.4430screenH 0.4725tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Hasło"screenW 0.5750screenH 0.3862screenW 0.8234screenH 0.4738tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    if not isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255170), false)
    else roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend

    if not isMouseIn(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0144255170), false)
    else roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend
    dxDrawText("Zaloguj na serwer"screenW 0.2055screenH 0.6100screenW 0.4211screenH 0.6837tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
    dxDrawText("Załóż konto"screenW 0.5953screenH 0.6138screenW 0.8109screenH 0.6875tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
                   local hype interpolateBetween(000, -151000, ((getTickCount() - startTicking) / 2500), "SineCurve")
    dxDrawImage(screenW 0.2805screenH 0.1412 hypescreenW 0.4688screenH 0.1875"logo.png"000tocolor(255255255255), false)
    local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
    setCameraMatrix(-2006.86,45.18,67.34)
    angler=(angler+0.1)
end
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700) 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(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700) 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) < or string.len(pass) < 3 then
                data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 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)
                        removeEventHandler("onClientKey"roothandleKeys)

    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.190.470.260.06""true)
    data.button[2]=guiCreateEdit(0.570.470.260.06""true) 
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 15:06


OchIAch







Wiek: 19
Na forum: 600 dni
Posty: 152
Nick w MP: OchIAch

Piwa: 674

Respekt: 105,3
Respekt: 105,3


Ostrzeżeń: 100%
Brakuje ci enda

if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
local selectedLanguage false 

local startTicking getTickCount()
local blurStrength 20

local sx,sy=guiGetScreenSize()

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")

function handleKeys(keypress)
    if key == "mouse1" then 
        if press then 
            if selectedLanguage then 
                if isCursorOnElement(504*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryLogin"localPlayerguiGetText(login), guiGetText(pass))
                elseif isCursorOnElement(701*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryRegister"localPlayerguiGetText(login), guiGetText(pass))
                end
            end
        end
    end
end 

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

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

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

dxfont0_gz dxCreateFont("gz.ttf",30)
dxfont1_gz dxCreateFont("gz.ttf",20)
dxfont2_gz dxCreateFont("gz.ttf"14)

x,y=-2006.86,45.18,67.34-- my width
intro_step=math.random(0,850)

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 roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
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
local screenWscreenH guiGetScreenSize()

function renderLoginBox()
if data.misc then
            local bit getSoundFFTData(data.misc20483)
            for i,v in ipairs(bit) do
                rytm math.round((v*320),0)>100 and 100 or math.round((v*320),0)
                dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"light.png"000tocolor(0114255rytm), false)
            end
    local localization exports["br_localization"]
    
    if not selectedLanguage then 
        dxDrawRectangle(381*sx268*sy604*sx235*sytocolor(000202), false)
        if isCursorOnElement(405*sx313*sy254*sx143*sythen 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "english"
                localization:setPlayerLocalization(localPlayer"english")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255155), false)
        end 
        
        if isCursorOnElement(705*sx313*sy254*sx143*sythen 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "polish"
                localization:setPlayerLocalization(localPlayer"polish")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255155), false)
        end
    end
                   dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"graficzka.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.info,  screenW 0.1875screenH 0.7025screenW 0.8305screenH 0.7488tocolor(255255255255), 1.00dxfont2_gz"center""center"falsefalsefalsefalsefalseend
    dxDrawText("Login"screenW 0.1945screenH 0.3850screenW 0.4430screenH 0.4725tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Hasło"screenW 0.5750screenH 0.3862screenW 0.8234screenH 0.4738tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    if not isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255170), false)
    else roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend

    if not isMouseIn(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0144255170), false)
    else roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend
    dxDrawText("Zaloguj na serwer"screenW 0.2055screenH 0.6100screenW 0.4211screenH 0.6837tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
    dxDrawText("Załóż konto"screenW 0.5953screenH 0.6138screenW 0.8109screenH 0.6875tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
                   local hype interpolateBetween(000, -151000, ((getTickCount() - startTicking) / 2500), "SineCurve")
    dxDrawImage(screenW 0.2805screenH 0.1412 hypescreenW 0.4688screenH 0.1875"logo.png"000tocolor(255255255255), false)
    local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
    setCameraMatrix(-2006.86,45.18,67.34)
    angler=(angler+0.1)
end
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700) 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(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700) 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) < or string.len(pass) < 3 then
                data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 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)
                        removeEventHandler("onClientKey"roothandleKeys)

    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.190.470.260.06""true)
    data.button[2]=guiCreateEdit(0.570.470.260.06""true) 
    guiEditSetMasked(data.button[2],true)
end)


Podpis
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
SataN.
Wysłany: 2018-09-09, 15:32


SataN.







Wiek: 15
Na forum: 1811 dni
Posty: 741
Nick w MP: SataN

Piwa: 3660

Respekt: 44


Ostrzeżeń: 100%
OchIAch, działa ale
nie pokazuje wyboru języka, tylko odrazu logowanie, wpierw niech pokaze wybór języka a później logowanie ;-;
kod:
if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
local selectedLanguage false 

local startTicking getTickCount()
local blurStrength 20

local sx,sy=guiGetScreenSize()

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")

function handleKeys(keypress)
    if key == "mouse1" then 
        if press then 
            if selectedLanguage then 
                if isCursorOnElement(504*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryLogin"localPlayerguiGetText(login), guiGetText(pass))
                elseif isCursorOnElement(701*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryRegister"localPlayerguiGetText(login), guiGetText(pass))
                end
            end
        end
    end
end 

function isCursorOnElement(x,y,w,h)
    local mx,my getCursorPosition ()
    local fullx,fully guiGetScreenSize()
    cursorx,cursory mx*fullx,my*fully
    if cursorx and cursorx and cursory and cursory h then
        return true
    else
        return false
    end
end


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

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

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

dxfont0_gz dxCreateFont("gz.ttf",30)
dxfont1_gz dxCreateFont("gz.ttf",20)
dxfont2_gz dxCreateFont("gz.ttf"14)

x,y=-2006.86,45.18,67.34-- my width
intro_step=math.random(0,850)

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 roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
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
local screenWscreenH guiGetScreenSize()

function renderLoginBox()
if data.misc then
            local bit getSoundFFTData(data.misc20483)
            for i,v in ipairs(bit) do
                rytm math.round((v*320),0)>100 and 100 or math.round((v*320),0)
                dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"light.png"000tocolor(0114255rytm), false)
            end
    local localization exports["br_localization"]
    
    if not selectedLanguage then 
        dxDrawRectangle(381*sx268*sy604*sx235*sytocolor(000202), false)
        if isCursorOnElement(405*sx313*sy254*sx143*sythen 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "english"
                localization:setPlayerLocalization(localPlayer"english")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255155), false)
        end 
        
        if isCursorOnElement(705*sx313*sy254*sx143*sythen 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "polish"
                localization:setPlayerLocalization(localPlayer"polish")
                guiSetVisible(logintrue)
                guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                guiBringToFront(login)
            end
        else 
            dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255155), false)
        end
    end
                   dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"graficzka.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.info,  screenW 0.1875screenH 0.7025screenW 0.8305screenH 0.7488tocolor(255255255255), 1.00dxfont2_gz"center""center"falsefalsefalsefalsefalseend
    dxDrawText("Login"screenW 0.1945screenH 0.3850screenW 0.4430screenH 0.4725tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Hasło"screenW 0.5750screenH 0.3862screenW 0.8234screenH 0.4738tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    if not isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255170), false)
    else roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend

    if not isMouseIn(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0144255170), false)
    else roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend
    dxDrawText("Zaloguj na serwer"screenW 0.2055screenH 0.6100screenW 0.4211screenH 0.6837tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
    dxDrawText("Załóż konto"screenW 0.5953screenH 0.6138screenW 0.8109screenH 0.6875tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
                   local hype interpolateBetween(000, -151000, ((getTickCount() - startTicking) / 2500), "SineCurve")
    dxDrawImage(screenW 0.2805screenH 0.1412 hypescreenW 0.4688screenH 0.1875"logo.png"000tocolor(255255255255), false)
    local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
    setCameraMatrix(-2006.86,45.18,67.34)
    angler=(angler+0.1)
end
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700) 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(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700) 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) < or string.len(pass) < 3 then
                data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 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)
                        removeEventHandler("onClientKey"roothandleKeys)

    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.190.470.260.06""true)
    data.button[2]=guiCreateEdit(0.570.470.260.06""true) 
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 16:16


OchIAch







Wiek: 19
Na forum: 600 dni
Posty: 152
Nick w MP: OchIAch

Piwa: 674

Respekt: 105,3
Respekt: 105,3


Ostrzeżeń: 100%
To to musisz sam sobie zrobić, gtao to pomoc a nie darmowa siła robocza, polecam jakąś zmienną

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 16:19


SataN.







Wiek: 15
Na forum: 1811 dni
Posty: 741
Nick w MP: SataN

Piwa: 3660

Respekt: 44


Ostrzeżeń: 100%
OchIAch, No właśnie ,,pomoc" a nie wiem jak to zrobić.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 18:05


Wilq







Wiek: 17
Na forum: 1914 dni
Posty: 964

Piwa: 185

Respekt: 465,8
Respekt: 465,8


Sprawdź ten kod:



local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
local selectedLanguage false 

local startTicking getTickCount()
local blurStrength 20

local sx,sy=guiGetScreenSize()

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")

function handleKeys(keypress)
    if key == "mouse1" then 
        if press then 
            if selectedLanguage then 
                if isCursorOnElement(504*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryLogin"localPlayerguiGetText(login), guiGetText(pass))
                elseif isCursorOnElement(701*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryRegister"localPlayerguiGetText(login), guiGetText(pass))
                end
            end
        end
    end
end 

function isCursorOnElement(x,y,w,h)
    local mx,my getCursorPosition ()
    local fullx,fully guiGetScreenSize()
    cursorx,cursory mx*fullx,my*fully
    if cursorx and cursorx and cursory and cursory h then
        return true
    else
        return false
    end
end


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

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

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

dxfont0_gz dxCreateFont("gz.ttf",30)
dxfont1_gz dxCreateFont("gz.ttf",20)
dxfont2_gz dxCreateFont("gz.ttf"14)

x,y=-2006.86,45.18,67.34-- my width
intro_step=math.random(0,850)

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 roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
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
local screenWscreenH guiGetScreenSize()

function renderLoginBox()
    if data.misc then
        local bit getSoundFFTData(data.misc20483)
        for i,v in ipairs(bit) do
            rytm math.round((v*320),0)>100 and 100 or math.round((v*320),0)
            dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"light.png"000tocolor(0114255rytm), false)
        end
        local localization exports["br_localization"]
        
        if not selectedLanguage then 
            dxDrawRectangle(381*sx268*sy604*sx235*sytocolor(000202), false)
            if isCursorOnElement(405*sx313*sy254*sx143*sythen 
                dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255255), false)
                if getKeyState("mouse1"then 
                    selectedLanguage "english"
                    localization:setPlayerLocalization(localPlayer"english")
                    guiSetVisible(logintrue)
                    guiSetVisible(passtrue)
                    guiSetInputEnabled(true)
                    guiBringToFront(login)
                end
            else 
                dxDrawImage(405*sx313*sy254*sx143*sy"english.png"000tocolor(255255255155), false)
            end 
            
            if isCursorOnElement(705*sx313*sy254*sx143*sythen 
                dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255255), false)
                if getKeyState("mouse1"then 
                    selectedLanguage "polish"
                    localization:setPlayerLocalization(localPlayer"polish")
                    guiSetVisible(logintrue)
                    guiSetVisible(passtrue)
                    guiSetInputEnabled(true)
                    guiBringToFront(login)
                end
            else 
                dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255155), false)
            end
            return
        end
                       dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"graficzka.png"000tocolor(255255255255), false)
        if data.info then dxDrawText(data.info,  screenW 0.1875screenH 0.7025screenW 0.8305screenH 0.7488tocolor(255255255255), 1.00dxfont2_gz"center""center"falsefalsefalsefalsefalseend
        dxDrawText("Login"screenW 0.1945screenH 0.3850screenW 0.4430screenH 0.4725tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Hasło"screenW 0.5750screenH 0.3862screenW 0.8234screenH 0.4738tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
        if not isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255170), false)
        else roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend

        if not isMouseIn(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0144255170), false)
        else roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend
        dxDrawText("Zaloguj na serwer"screenW 0.2055screenH 0.6100screenW 0.4211screenH 0.6837tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
        dxDrawText("Załóż konto"screenW 0.5953screenH 0.6138screenW 0.8109screenH 0.6875tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
        local hype interpolateBetween(000, -151000, ((getTickCount() - startTicking) / 2500), "SineCurve")
        dxDrawImage(screenW 0.2805screenH 0.1412 hypescreenW 0.4688screenH 0.1875"logo.png"000tocolor(255255255255), false)
        local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
        setCameraMatrix(-2006.86,45.18,67.34)
        angler=(angler+0.1)
    end
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700) 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(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700) 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) < or string.len(pass) < 3 then
                data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 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)
        removeEventHandler("onClientKey"roothandleKeys)

    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.190.470.260.06""true)
    data.button[2]=guiCreateEdit(0.570.470.260.06""true) 
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 18:43


boszboszek

HEY






Wiek: 18
Na forum: 991 dni
Posty: 159
Nick w MP: boszboszek

Piwa: 1642

Respekt: 141
Respekt: 141


"Thinks" napisał/a:

OchIAch, No właśnie ,,pomoc" a nie wiem jak to zrobić.

Pomoc nie polega na tym, aby dać Ci wszystko jak na tacy - my możemy Cię tylko naprowadzić. A do sedna problemu musisz wgłębić się sam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 19:16


SataN.







Wiek: 15
Na forum: 1811 dni
Posty: 741
Nick w MP: SataN

Piwa: 3660

Respekt: 44


Ostrzeżeń: 100%
Wilq, Nadal, teraz nie pokazuje gui od logowania ale pokazuje efekty w rytm muzyki i editboxy a wyboru języka nadal nie ma ;-;

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-09, 19:51


Wilq







Wiek: 17
Na forum: 1914 dni
Posty: 964

Piwa: 185

Respekt: 465,8
Respekt: 465,8


Gościu, użyłeś jakiegoś skalowania do flag państwa i reszty przy tym jak się sprawdza selectedLanguage? Odpowiem za Ciebie - NIE.

Pobierasz rozmiar ekranu klienta (sx, sy), założmy, że mamy 1920 i 1080.
Linijka kodu (jedna z kilku) odpowiadających za rysowanie flagi.

dxDrawImage(705*sx313*sy254*sx143*sy"polish.png"000tocolor(255255255155), false)


Widzisz Pan to? 705*1020=1353600. Na pozycji 1353600 oraz 338040 rysuje się flaga.
Brak skalowania, co do wyboru języka i rysowaniu późniejszym reszty, od razu tworzysz editboxy (na samym dole), możliwe, że za moment wyślę Ci gotowy kod.

BTW. Co to za elementy GUI 'pass' i 'login'? Chodzi Ci o te edit boxy?

Zrobiłem skalowanie na FullHD. Mam dzisiaj dobre serce i wyślę Ci działający kod z wyborem języka. Zakomentowałem to co wywalało błędy, sam znajdziesz chyba co. Oczekuję piwka kochanie ; )



local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()


local startTicking getTickCount()
local blurStrength 20

local sx,sy=guiGetScreenSize()

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")

function handleKeys(keypress)
    if key == "mouse1" then 
        if press then 
            if selectedLanguage then 
                if isCursorOnElement(504*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryLogin"localPlayerguiGetText(login), guiGetText(pass))
                elseif isCursorOnElement(701*sx444*sy155*sx37*sythen 
                    triggerEvent("onPlayerTryRegister"localPlayerguiGetText(login), guiGetText(pass))
                end
            end
        end
    end
end 

function isCursorOnElement(x,y,w,h)
    local mx,my getCursorPosition ()
    local fullx,fully guiGetScreenSize()
    cursorx,cursory mx*fullx,my*fully
    if cursorx and cursorx and cursory and cursory h then
        return true
    else
        return false
    end
end


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

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

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

dxfont0_gz dxCreateFont("gz.ttf",30)
dxfont1_gz dxCreateFont("gz.ttf",20)
dxfont2_gz dxCreateFont("gz.ttf"14)

x,y=-2006.86,45.18,67.34-- my width
intro_step=math.random(0,850)

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 roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
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
local screenWscreenH guiGetScreenSize()

local selectedLanguage false 

function renderLoginBox()
if data.misc then
    local bit getSoundFFTData(data.misc20483)
    for i,v in ipairs(bit) do
        rytm math.round((v*320),0)>100 and 100 or math.round((v*320),0)
        dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"light.png"000tocolor(0114255rytm), false)
    end
    local localization exports["br_localization"]
    
    if not selectedLanguage then 
        dxDrawRectangle(381/1920*sx268/1080*sy604/1920*sx235/1080*sytocolor(000202), false)
        if isCursorOnElement(405/1920*sx313/1080*sy254/1920*sx143/1080*sythen 
            dxDrawImage(405/1920*sx313/1080*sy254/1920*sx143/1080*sy"english.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "english"
                localization:setPlayerLocalization(localPlayer"english")
                --guiSetVisible(logintrue)
                --guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                --guiBringToFront(login)
                guiSetVisible(data.button[1], true)
                guiSetVisible(data.button[2], true)                    
            end
        else 
            dxDrawImage(405/1920*sx313/1080*sy254/1920*sx143/1080*sy"english.png"000tocolor(255255255155), false)
        end 
        
        if isCursorOnElement(705/1920*sx313/1080*sy254/1920*sx143/1080*sythen 
            dxDrawImage(705/1920*sx313/1080*sy254/1920*sx143/1080*sy"polish.png"000tocolor(255255255255), false)
            if getKeyState("mouse1"then 
                selectedLanguage "polish"
                localization:setPlayerLocalization(localPlayer"polish")
                --guiSetVisible(logintrue)
                --guiSetVisible(passtrue)
                guiSetInputEnabled(true)
                --guiBringToFront(login)
                guiSetVisible(data.button[1], true)
                guiSetVisible(data.button[2], true)                
            end
        else 
            dxDrawImage(705/1920*sx313/1080*sy254/1920*sx143/1080*sy"polish.png"000tocolor(255255255155), false)
        end
        return
    end
    dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000"graficzka.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.info,  screenW 0.1875screenH 0.7025screenW 0.8305screenH 0.7488tocolor(255255255255), 1.00dxfont2_gz"center""center"falsefalsefalsefalsefalseend
    dxDrawText("Login"screenW 0.1945screenH 0.3850screenW 0.4430screenH 0.4725tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Hasło"screenW 0.5750screenH 0.3862screenW 0.8234screenH 0.4738tocolor(255255255255), 1.00dxfont0_gz"center""center"falsefalsefalsefalsefalse)
    if not isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255170), false)
    else roundedRectangle(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend

    if not isMouseIn(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700then roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0144255170), false)
    else roundedRectangle(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700tocolor(0114255255), falseend
    dxDrawText("Zaloguj na serwer"screenW 0.2055screenH 0.6100screenW 0.4211screenH 0.6837tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
    dxDrawText("Załóż konto"screenW 0.5953screenH 0.6138screenW 0.8109screenH 0.6875tocolor(255255255255), 1.00dxfont1_gz"center""center"falsetruefalsefalsefalse)
    local hype interpolateBetween(000, -151000, ((getTickCount() - startTicking) / 2500), "SineCurve")
    dxDrawImage(screenW 0.2805screenH 0.1412 hypescreenW 0.4688screenH 0.1875"logo.png"000tocolor(255255255255), false)
    local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
    setCameraMatrix(-2006.86,45.18,67.34)
    angler=(angler+0.1)
end
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.2055screenH 0.6138screenW 0.2156screenH 0.0700) 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(screenW 0.5953screenH 0.6138screenW 0.2156screenH 0.0700) 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) < or string.len(pass) < 3 then
                data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 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)
        removeEventHandler("onClientKey"roothandleKeys)

    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.190.470.260.06""true)
    guiSetVisible(data.button[1], false)
    data.button[2]=guiCreateEdit(0.570.470.260.06""true) 
    guiSetVisible(data.button[2], false)    
    guiEditSetMasked(data.button[2],true)
end)


Ostatnio zmieniony przez Wilq 2018-09-09, 20:00, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
SataN.
Wysłany: 2018-09-09, 20:00


SataN.







Wiek: 15
Na forum: 1811 dni
Posty: 741
Nick w MP: SataN

Piwa: 3660

Respekt: 44


Ostrzeżeń: 100%
Wilq, Wiesz, wybór języka dodawalem z innego panelu i nie zauważyłem tego.
tak login, pass od edit'a.

[ Dodano: 2018-09-09, 20:07 ]
Wilq, Wielkie dzięki mordeczko <3 Można zamknąć!

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działa :: logowanko
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:








Wyświetl posty z ostatnich:   

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

Skocz do: