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

Wysłany: 2019-01-12, 11:13


Fl!k







Wiek: 26
Na forum: 3593 dni
Posty: 162

Piwa: 18

Respekt: 50

Witam posiadam panel z serwera NiceLife 5.0 przerobi?em go lecz nie wiem jak zmieni? miejsce tego co sie klika aby wej?? np. do logowania lub rejestrowania na inne miejsce

Podaje wam c_logging
if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local blur exports['blur']
local czcionka dxCreateFont("font/1.ttf"25)
local czcionka2 dxCreateFont("font/1.ttf"16)
local czcionka3 dxCreateFont("font/1.ttf"12)
local czcionka4 dxCreateFont("font/1.ttf"10)
local resourceRoot getResourceRootElement(getThisResource())
local screenWscreenH guiGetScreenSize()
local screenWidthscreenHeight guiGetScreenSize()

local blurStrength 2


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


sx,sy guiGetScreenSize()
xedityedit =  (sx/1366), (sy/768)
messages = {}
editBox = {}
editBox.__index editBox
editBox.instances = {}


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 (blurShader) and blur then
        destroyElement(blurShader)
        blurShader nil
    end
end)

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=niltick=getTickCount() }

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 400
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

mojeW,mojeH 1366768
sW,sH guiGetScreenSize()
w= (sW/mojeW), (sH/mojeH)

aktualnie "glowny"

function renderLoginBox()
    setTime(6,0)
    blur false
    if aktualnie == "glowny" then
        if isMouseIn(screenW 2.3014screenH 0.4633screenW 0.1278screenH 0.0744then
            window(screenW 2.3014screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        else
            roundedRectangle(screenW 22.3014screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        end
        if isMouseIn(screenW 2.4361screenH 0.4633screenW 0.1278screenH 0.0744then
            window(screenW 2.4361screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        else
            roundedRectangle(screenW 22.4361screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        end
        if isMouseIn(screenW 2.5708screenH 0.4633screenW 0.1278screenH 0.0744then
            window(screenW 2.5708screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        else
            roundedRectangle(screenW 22.5708screenH 0.4633screenW 0.1278screenH 0.0744tocolor(000170), false)
        end
        dxDrawImage(0*w0*h1380*w820*h"img/tlo.png"000tocolor(255255255255), false)
        dxDrawImage(0*w0*h1280*w720*h"img/glowna.png"000tocolor(255255255255), false)
    elseif aktualnie == "logowanie" then
        dxDrawImage(0*w0*h1380*w820*h"img/tlo.png"000tocolor(255255255255), false)
        dxDrawImage(0*w0*h1280*w720*h"img/log.png"000tocolor(255255255255), false)
        dxDrawText("Login"screenW 0.3022screenH 0.4789screenW 0.4451screenH 0.3889tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Has?o"screenW 0.3022screenH 0.5256screenW 0.4451screenH 0.4756tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
        --dxDrawText("has?ox2"screenW 0.2922screenH 0.5833screenW 0.4451screenH 0.5633tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
    elseif aktualnie == "rejestracja" then
        dxDrawImage(0*w0*h1380*w820*h"img/tlo.png"000tocolor(255255255255), false)
        dxDrawImage(0*w0*h1280*w720*h"img/rej.png"000tocolor(255255255255), false)
        dxDrawText("Login"screenW 0.3022screenH 0.4789screenW 0.4451screenH 0.3889tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Has?o"screenW 0.3022screenH 0.5256screenW 0.4451screenH 0.4756tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
        dxDrawText("has?ox2"screenW 0.2922screenH 0.5833screenW 0.4451screenH 0.5633tocolor(255255255255), 1.00czcionka3"center""center"falsefalsefalsefalsefalse)
    elseif aktualnie == "regulamin" then
        dxDrawImage(0*w0*h1380*w820*h"img/tlo.png"000tocolor(255255255255), false)
        dxDrawImage(0*w0*h1280*w720*h"img/reg.png"000tocolor(255255255255), false)
        dxDrawText("tu cos dac"screenW 0.3688screenH 0.3222screenW 0.6299screenH 0.6344tocolor(255255255255), 1.00czcionka3"left""top"falsefalsefalsefalsefalse)
    end
    if getTickCount()<data.tick then
        dxDrawText(data.infoscreenW 0.3626screenH 0.5734screenW 0.6376screenH 0.6368tocolor(000255), 1.00czcionka4"center""center"falsefalsefalsefalsefalse)
        dxDrawText(data.infoscreenW 0.3625screenH 0.5733screenW 0.6375screenH 0.6367tocolor(25500255), 1.00czcionka4"center""center"falsefalsefalsefalsefalse)
    end
    local x,y=getPointFromDistanceRotation(-1351.51514.52distangler)
    setCameraMatrix(x,y,80+0.9,1207.76, -1249.4980+0.9)
    angler=(angler+0.1)

    for k,self in pairs(editBox.instances) do
        if self.visible then
            local px,py,pw,ph self:getPosition()
            local text self.masked and string.gsub(self.text,".","&#8226;") or self.text
            local alignX dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right"
            roundedRectangle(pxpypwphtocolor(unpack(self.color)),tocolor(255040255))
            dxDrawText(text,px+xedit*5py,px-xedit*5+pwpy+ph,tocolor(unpack(self.textColor)),self.scaleczcionka3alignX,"center",true)        
            if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then
                local lx dxGetTextWidth(text,self.scale,czcionka3)+px+xedit*8
                local lx dxGetTextWidth(text,self.scale,czcionka3)+px+xedit*8
                dxDrawLine(lxpy+yedit*10lxpy+ph-yedit*10tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2)
            end
        end
    end

    if getKeyState("backspace"then
        for k,self in pairs(editBox.instances) do
            if self.visible and self.input then
                if not keyState then
                    keyState getTickCount() + 400
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                elseif keyState and keyState getTickCount() then
                    keyState getTickCount()+100
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                end
                return
            end
        end
        keyState nil
    end
end


addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.3092screenH 0.6244screenW 0.1125screenH 0.0578) and data.showed then
            if aktualnie=="logowanie" then
                local login g.user.text
                local pass g.pass.text
                if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                    data.info "Login/haslo musza miec od 3 do 22 znakow."
                    data.tick getTickCount()+3500
                    return
                end
                triggerServerEvent("logging:checkAccount"resourceRootloginpass)
            end
            if aktualnie=="rejestracja" then
                local login g.user.text
                local pass g.pass.text
                local pass2 g.pass2.text
                if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                    data.info "Login/haslo musza miec od 3 do 22 znakow."
                    data.tick getTickCount()+3500
                    return
                end
                if pass ~= pass2 then
                    data.info "Podane has?a nie zgadzaj? si?!"
                    data.tick getTickCount()+3500
                    return
                end
                triggerServerEvent("logging:newAccount"resourceRootloginpass)
            end
        elseif isMouseIn(screenW 0.5304screenH 0.6244screenW 0.1125screenH 0.0578) and data.showed and aktualnie ~= "glowny" then 
            aktualnie "glowny"
            g.user.visible false
            g.pass.visible false
            g.pass2.visible false
        elseif isMouseIn(screenW 0.3514screenH 0.0500screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "logowanie"
            g.user.visible true
            g.pass.visible true
            --g.pass2.visible true
        elseif isMouseIn(screenW 0.4861screenH 0.0500screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "rejestracja"
            g.user.visible true
            g.pass.visible true
            g.pass2.visible true
        elseif isMouseIn(screenW 0.4108screenH 0.1000screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "regulamin"
        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
        local time getRealTime()
        setTime(time.hour,time.minute)
        g.user.visible false
        g.pass.visible false
        g.pass2.visible false
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=info
        data.tick=getTickCount()+5000
    end
end)


addEventHandler("onClientResourceStart"resourceRoot, function()
    = {}
    g.user editBox.new()
    g.user:setPosition(screenW 0.3951screenH 0.4089screenW 0.1535screenH 0.0500)
    g.user.color = {255,255,255,220}
    --g.user.font czcionka3
    g.user.onInput = function()
        g.user.color = {255,0,40240}
    end
    g.user.onOutput = function()
        g.user.color = {255,255,255,220}
    end
    g.pass editBox.new()
    g.pass:setPosition(screenW 0.3951screenH 0.4756screenW 0.1535screenH 0.0500)
    g.pass.color = {255,255,255,220}
    --g.pass.font czcionka3
    g.pass.masked true
    g.pass.onInput = function()
        g.pass.color = {255,0,40240}
    end
    g.pass.onOutput = function()
        g.pass.color = {255,255,255,220}
    end
    g.pass2 editBox.new()
    g.pass2:setPosition(screenW 0.3951screenH 0.5433screenW 0.1535screenH 0.0500)
    g.pass2.color = {255,255,255,220}
    --g.pass2.font czcionka3
    g.pass2.masked true
    g.pass2.onInput = function()
        g.pass2.color = {255,0,40240}
    end
    g.pass2.onOutput = function()
        g.pass2.color = {255,255,255,220}
    end
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc0.5)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si&#234;")
    --setElementData(localPlayer,"player:logged",false)
    --data.button[1]=guiCreateEdit(552*w350*h157*w27*h""false)
    --data.button[2]=guiCreateEdit(752*w350*h157*w27*h""false)
    --guiEditSetMasked(data.button[2], true)
    addEventHandler("onClientRender"rootrenderLoginBox)
end)


-- custom editboxy

function onClientClick(button,state,cX,cY)
    if not isCursorShowing() then
        return
    end
    if button == "left" and state == "up" then
        for k,self in pairs(editBox.instances) do
            if self.visible then
                if self.input then
                    self.input nil
                    self.onOutput()
                end
                local x,y,w,self:getPosition()
                if isMouseIn(x,y,w,hthen
                    self.input true
                    self.onInput()
                end
            end
end
    end
end
addEventHandler("onClientClick"rootonClientClick)

function onClientCharacter(character)
    if not isCursorShowing() then
        return
    end
    for k,self in pairs(editBox.instances) do
        if self.visible and self.input then
            if (string.len(self.text)) < self.maxLength then
                self.text self.text..character
            end
        end
    end
end
addEventHandler("onClientCharacter"rootonClientCharacter)

function editBox.new()
    local self setmetatable({}, editBox)
    self.text ""
    self.maxLength 20
    self.scale yedit*0.8
    self.state "normal"
    self.font "sans"
    self.color = {255,255,255,220}
    self.textColor = {255,255,255,220}
    table.insert(editBox.instancesself)
    return self
end

function editBox:getPosition()
    return self.xself.yself.wself.h
end

function editBox:setPosition(x,y,w,h)
    self.xself.yself.wself.x,y,w,h
    return true
end

-- koniec editboxow

function roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
end

function window(xywhcolor)
      local color2 tocolor(25500)
      roundedRectangle(x-2y-2w+4h+4color2false)
      roundedRectangle(xywhcolorfalse)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-12, 11:21


Query

SyndicateMTA






Wiek: 24
Na forum: 3072 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

ten warunek odpowiada za to co si? pojawia po kliknieciu w logowanie
  elseif aktualnie == "logowanie" then


ten warunek odpowiada za to co si? pojawia po kliknieciu w rejestrowanie
  elseif aktualnie == "rejestracja" then


to odpowiada za przęłączanie si? miedzy dzia?ami
elseif isMouseIn(screenW 0.5304screenH 0.6244screenW 0.1125screenH 0.0578) and data.showed and aktualnie ~= "glowny" then 
            aktualnie "glowny"
            g.user.visible false
            g.pass.visible false
            g.pass2.visible false
        elseif isMouseIn(screenW 0.3514screenH 0.0500screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "logowanie"
            g.user.visible true
            g.pass.visible true
            --g.pass2.visible true
        elseif isMouseIn(screenW 0.4861screenH 0.0500screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "rejestracja"
            g.user.visible true
            g.pass.visible true
            g.pass2.visible true
        elseif isMouseIn(screenW 0.4108screenH 0.1000screenW 0.1178screenH 0.1644) and aktualnie == "glowny" then
            aktualnie "regulamin"
        end

    end
end)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-12, 12:02


Fl!k







Wiek: 26
Na forum: 3593 dni
Posty: 162

Piwa: 18

Respekt: 50

Dzieki ale teraz nie dzia?a zaloguj , rejestruj

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-12, 12:08


Query

SyndicateMTA






Wiek: 24
Na forum: 3072 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

addEventHandler("onClientResourceStart"resourceRoot, function()
    = {}
    g.user editBox.new()
    g.user:setPosition(screenW 0.3951screenH 0.4089screenW 0.1535screenH 0.0500)
    g.user.color = {255,255,255,220}
    --g.user.font czcionka3
    g.user.onInput = function()
        g.user.color = {255,0,40240}
    end
    g.user.onOutput = function()
        g.user.color = {255,255,255,220}
    end
    g.pass editBox.new()
    g.pass:setPosition(screenW 0.3951screenH 0.4756screenW 0.1535screenH 0.0500)
    g.pass.color = {255,255,255,220}
    --g.pass.font czcionka3
    g.pass.masked true
    g.pass.onInput = function()
        g.pass.color = {255,0,40240}
    end
    g.pass.onOutput = function()
        g.pass.color = {255,255,255,220}
    end
    g.pass2 editBox.new()
    g.pass2:setPosition(screenW 0.3951screenH 0.5433screenW 0.1535screenH 0.0500)
    g.pass2.color = {255,255,255,220}
    --g.pass2.font czcionka3
    g.pass2.masked true
    g.pass2.onInput = function()
        g.pass2.color = {255,0,40240}
    end
    g.pass2.onOutput = function()
        g.pass2.color = {255,255,255,220}
    end
za to odpowiadaja editboxy

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: panel :: logowania
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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