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

Wysłany: 2019-02-10, 22:19


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

Tak jak w temacie hud nie znika w logowaniu
if getElementData(localPlayer"player:sid"then return end

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


local blurStrength 20


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


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)

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

local sx,sy=guiGetScreenSize()
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 renderLoginBox()
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    dxDrawRectangle(sx*0/1025sy*200/769sx*1100/1025sy*310/767tocolor(000185), false)
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*-230/1024sy*272/768sx*565/1024sy*290/768tocolor(2552550255), 1.00"default""center""center"falseend
    dxDrawLine(sx*0/1024sy*200/768sx*1022/1024sy*200/768tocolor(105,105,105255), 5false)
    dxDrawLine(sx*0/1024sy*510/768sx*1022/1024sy*510/768tocolor(105,105,105255), 5false)
        dxDrawLine(sx*0/1024sy*250/768sx*1022/1024sy*250/768tocolor(105,105,105255), 5false)
    dxDrawText("Nazwa u?ytkownika"sx*-240/1024sy*210/768sx*565/1024sy*325/768white1.30"default-bold""center""center"false)
          dxDrawText("Rejestracja"sx*1170/1024sy*120/768sx*565/1024sy*325/768tocolor(255,255,255230), 3.30"default-bold""center""center",false)
        dxDrawText("Logowanie"sx*-240/1024sy*120/768sx*565/1024sy*325/768tocolor(255,255,255230), 3.30"default-bold""center""center"false)
    dxDrawText("Has?o"sx*-240/1024sy*400/768sx*565/1024sy*302/768white1.30"default-bold""center""center"false)
    if not isMouseIn(sx*60/1024sy*465/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*465/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*60/1024sy*465/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    if not isMouseIn(sx*770/1024sy*465/768sx*200/1024sy*35/768then dxDrawRectangle(sx*770/1024sy*465/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*770/1024sy*465/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    dxDrawText("Z a l o g u j  s i ?"sx*-240/1024sy*920/768sx*565/1024sy*45/768tocolor(0,0,205,255), 1.10"default-bold""center""center"false)
    dxDrawText("Z a r e j e s t r u j  s i ?"sx*1173/1024sy*920/768sx*565/1024sy*45/768tocolor(0,0,205,255), 1.10"default-bold""center""center"false)
    dxDrawImage(sx 0.10sy 0.113sx 0.7838sy 0.7749"logo.png"000tocolor(255255255255), false)
    dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png"angle0, -120 )
    local x,y=getPointFromDistanceRotation(1413.581082.80distangler)
    setCameraMatrix(x,y,207.72+0.9,2623.691285.660+0.9)
    angler=(angler+0.1)
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*60/1024sy*465/768sx*200/1024sy*35/768) 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="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*770/1024sy*465/768sx*200/1024sy*35/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) < 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"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])
                destroyElement(data.button[3])
                destroyElement(data.button[4])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    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)
    showPlayerHudComponent("radar",false)
    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)
    local nick getPlayerNamelocalPlayer )
    data.button[1]=guiCreateEdit(0.0450.40.220.04""..nick..""true)
    data.button[2]=guiCreateEdit(0.0450.50.220.04""true)   
data.button[3]=guiCreateEdit(0.740.40.220.04""..nick..""true)
    data.button[4]=guiCreateEdit(0.740.50.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-10, 23:41


BlueCry

ŚĆRIPTER LUJA






Wiek: 25
Na forum: 4006 dni
Posty: 78
Nick w MP: BlueCry

Piwa: 2176

Respekt: 110
Respekt: 110

Posiadasz na serwerze podstawowy hud czy wgrany przez siebie?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-11, 00:07


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5


Więcej informacji znajdziesz w Wikipedii MTA:

setPlayerHudComponentVisible


Więcej informacji znajdziesz w Wikipedii MTA:

showPlayerHudComponent


Więcej informacji znajdziesz w Wikipedii MTA:

isPlayerHudComponentVisible


Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-11, 00:27


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

muciu2404, wgrany przez siebie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-11, 02:36


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

U?yj, kt?rej? opcji z g?ry. Robi?c samemu na w?asnych b??dach czego? si? nauczysz. A dostaj?c gotowca to nic nie pojmujesz i tak. Pozdrawiam

Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-11, 10:24


BlueCry

ŚĆRIPTER LUJA






Wiek: 25
Na forum: 4006 dni
Posty: 78
Nick w MP: BlueCry

Piwa: 2176

Respekt: 110
Respekt: 110

"smigi" napisał/a:

muciu2404, wgrany przez siebie

Uwzgl?dni?e? w swoim skrypcie na HUD kt?ry wgra?e? ?e kto? b?dzie mia? wy??czony hud?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-11, 10:34


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W renderowaniu nie uwzgl?dni?e?, ?e kto? si? loguje.
Spr?buj tego:

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


local blurStrength 20


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


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)

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

local sx,sy=guiGetScreenSize()
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 renderLoginBox()
if getElementData(localPlayer"status") == "Loguje si?" then return end
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    dxDrawRectangle(sx*0/1025sy*200/769sx*1100/1025sy*310/767tocolor(000185), false)
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*-230/1024sy*272/768sx*565/1024sy*290/768tocolor(2552550255), 1.00"default""center""center"falseend
    dxDrawLine(sx*0/1024sy*200/768sx*1022/1024sy*200/768tocolor(105,105,105255), 5false)
    dxDrawLine(sx*0/1024sy*510/768sx*1022/1024sy*510/768tocolor(105,105,105255), 5false)
        dxDrawLine(sx*0/1024sy*250/768sx*1022/1024sy*250/768tocolor(105,105,105255), 5false)
    dxDrawText("Nazwa u?ytkownika"sx*-240/1024sy*210/768sx*565/1024sy*325/768white1.30"default-bold""center""center"false)
          dxDrawText("Rejestracja"sx*1170/1024sy*120/768sx*565/1024sy*325/768tocolor(255,255,255230), 3.30"default-bold""center""center",false)
        dxDrawText("Logowanie"sx*-240/1024sy*120/768sx*565/1024sy*325/768tocolor(255,255,255230), 3.30"default-bold""center""center"false)
    dxDrawText("Has?o"sx*-240/1024sy*400/768sx*565/1024sy*302/768white1.30"default-bold""center""center"false)
    if not isMouseIn(sx*60/1024sy*465/768sx*200/1024sy*35/768then dxDrawRectangle(sx*60/1024sy*465/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*60/1024sy*465/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    if not isMouseIn(sx*770/1024sy*465/768sx*200/1024sy*35/768then dxDrawRectangle(sx*770/1024sy*465/768sx*200/1024sy*35/768tocolor(255,255,255170), false)
    else dxDrawRectangle(sx*770/1024sy*465/768sx*208/1024sy*35/768tocolor(255,255,255230), falseend
    dxDrawText("Z a l o g u j  s i ?"sx*-240/1024sy*920/768sx*565/1024sy*45/768tocolor(0,0,205,255), 1.10"default-bold""center""center"false)
    dxDrawText("Z a r e j e s t r u j  s i ?"sx*1173/1024sy*920/768sx*565/1024sy*45/768tocolor(0,0,205,255), 1.10"default-bold""center""center"false)
    dxDrawImage(sx 0.10sy 0.113sx 0.7838sy 0.7749"logo.png"000tocolor(255255255255), false)
    dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png"angle0, -120 )
    local x,y=getPointFromDistanceRotation(1413.581082.80distangler)
    setCameraMatrix(x,y,207.72+0.9,2623.691285.660+0.9)
    angler=(angler+0.1)
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*60/1024sy*465/768sx*200/1024sy*35/768) 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="Nale?y wype?ni? wszystkie pola."
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*770/1024sy*465/768sx*200/1024sy*35/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) < 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"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])
                destroyElement(data.button[3])
                destroyElement(data.button[4])
        removeEventHandler("onClientRender"rootrenderLoginBox)
        setElementData(localPlayer"status""zalogowany")
    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)
    showPlayerHudComponent("radar",false)
    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)
    local nick getPlayerNamelocalPlayer )
    data.button[1]=guiCreateEdit(0.0450.40.220.04""..nick..""true)
    data.button[2]=guiCreateEdit(0.0450.50.220.04""true)   
data.button[3]=guiCreateEdit(0.740.40.220.04""..nick..""true)
    data.button[4]=guiCreateEdit(0.740.50.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Tagi: hud :: nie :: znika
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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