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

Wysłany: 2021-01-29, 15:48


NoNamik







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

Piwa: 374

Respekt: 60

Witam robie panel logowania i niestety lecz nie dziala mi guiGetText wyskakuje taki blad tutaj kod
 if getElementData(localPlayer"player:sid"then return end

local sxsy guiGetScreenSize()
local font dxCreateFont("font.ttf"10)
local actual false
local root getRootElement()
local tick getTickCount()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()

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(00sxsy"img/login.png"000tocolor(255,255,255,255), false)
        dxDrawText("Kliknij aby przejsc do rejestracji"7837851138823tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
    
dxDrawText("ZALOGUJ"8815801039630tocolor(255255255255), 1.50"default-bold""center""center"falsefalsetruefalsefalse)
    end
    if actual == 'register' then
        dxDrawImage(00sxsy"img/register.png"000tocolor(255,255,255,255), false)
        dxDrawText("Kliknij aby przejsc do logowania"7837851138823tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)

        
        dxDrawText("ZAREJESTRUJ"8815801039630tocolor(255255255255), 1.50"default-bold""center""center"falsefalsetruefalsefalse)
        dxDrawText(guiGetText(login), 80235032268tocolor(255255255255), 1.0"default""left""center"false)
    end
    if isMouseIn(85357921453then
        dxDrawImage(85357921453":psrpg-logging/img/click2.png"000tocolor(255255255255), false)
    else
        dxDrawImage(85357921453":psrpg-logging/img/click.png"000tocolor(255255255255), false)
    end
    if data.info then
        
        dxDrawText(""..data.info73082611931047tocolor(2552550255), 1.3"default-bold""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

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(85357921453) and data.showed and actual == 'login' then
            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)
        elseif isMouseIn(85357921453) and data.showed and actual == 'register' then
            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)
        elseif isMouseIn(86478419534) and data.showed and actual == 'login' then
            actual 'register'
        elseif isMouseIn(86478419534) 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)


addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    local tick getTickCount()
    muzyka=playSound("misc/intro.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(80235032268""false)
    zarejestruj=guiCreateEdit(80245832268""false)  
    guiEditSetMasked(zarejestruj,true)
    guiEditSetMaxLength(zaloguj22)
    guiEditSetMaxLength(zarejestruj22)
    guiSetAlpha(zaloguj,0.0)
    guiSetAlpha(zarejestruj,0.0)
    guiSetVisible(zaloguj,true)
    guiSetVisible(zarejestruj,true)
end)


tutaj jest blad

dxDrawText(guiGetText(login), 80235032268tocolor(255255255255), 1.0"default""left""center"false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-29, 15:57


MrVip615

witam






Wiek: 22
Na forum: 4307 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3


dxDrawText(guiGetText(zaloguj), 80235032268tocolor(255255255255), 1.0"default""left""center"false)


Nie powinno to wygladac tak, lub tak?:


dxDrawText(login80235032268tocolor(255255255255), 1.0"default""left""center"false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-29, 15:58


NoNamik







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

Piwa: 374

Respekt: 60

MrVip615, dziala lecz jest jeden problem bo jak wpisuje haslo to powinny byc *** a widac wszystko

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-29, 16:37


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

dxDrawText(string.rep("*"string.len(login)), ...


Postaw piwo autorowi tego posta
 

 
Tagi: guigettext
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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