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

Wysłany: 2020-09-29, 17:56


vAnimo

Zielony w luła






Wiek: 19
Na forum: 2312 dni
Posty: 165
Nick w MP: vAnimo

Piwa: 882

Respekt: 70

https://imgur.com/a/5GZAEUV
Po za?adowaniu filmu logowanie si? zamienia w 2 puste editboxy i znika reszta jego tekstur kod: a i pytanie czy da sie odpalic mp4 zamiast tej funkcji playVideo z browserem?
if getElementData(localPlayer"player:sid"then return end

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


local akcja false

local blurStrength 10

mojeW,mojeH 19201080 -- Twoja rozdzielczo?? ekranu u?ywana w MTA:SA
sW,sH guiGetScreenSize()
w= (sW/mojeW), (sH/mojeH)
skalaX = (sW/mojeW)
skalaY = (sH/mojeH)
local dxfont0_font dxCreateFont(":pystories-logowanie/font.ttf"25*w)

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

function dxDrawButton(xywhcolor)
  local color2 tocolor(0,205,255)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(x-0.4660164h-1.6w+1.52color2false)
  dxDrawRectangle(1213colorfalse)
  dxDrawRectangle(w213colorfalse)
end

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

font dxCreateFont("font.ttf",20) or "defaul-bold"

x,y=1738.69,-1678.98-- my width
intro_step=math.random(0,100)

local zoom 1.2 -- size GUI
local baseX 1920 -- width GUI
local minZoom -- minisize GUI

local sx,sy=guiGetScreenSize()
local screenWscreenH guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

if screenW baseX then
    zoom math.min(minZoombaseX/screenW)
end

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 900
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(10 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function renderLoginBox()
    --blur true
        dxDrawImage(310*w189*h1300*w700*h":pystories-logowanie/gitowa.png"000tocolor(255255255255), false)
    --exports["Blur"]:dxDrawBluredRectangle(screenW 0.3637screenH 0.0000screenW 0.2702screenH 1.0000tocolor(150150150255), false)


    if data.info then dxDrawText(data.info,340*w119*h1577*w205*htocolor(000255), 1.30font"center""center"falsedxDrawText(data.info,340*w-1119*h-11577*w-1205*h-1tocolor(255255255255), 1.30font"center""center"falseend

    if not isMouseIn(400*w645*h378*w102*hthen dxDrawImage(386*w635*h400*w110*h"zax.png"000tocolor(255255255255), false)
    else dxDrawImage(386*w635*h400*w110*h"zai.png"000tocolor(255255255255), falseend

    if not isMouseIn(1137*w653*h384*w97*hthen dxDrawImage(1125*w638*h400*w110*h"zrx.png"000tocolor(255255255255), false)
    else dxDrawImage(1125*w638*h400*w110*h"zri.png"000tocolor(255255255255), falseend
end




function playVideo (posXposYwidthheighturldurationcanClosepostGUI)
    if not posX or not posY or not width or not height or not url then
        return false
    end
    local webBrowser false
    closeButton guiCreateButton 0.2859,  0.67690.17340.1250"X"true)
    guiSetAlpha (closeButton0.5)
    guiSetVisible (closeButtonfalse)
    if not isElement (webBrowserthen
        webBrowser createBrowser (widthheightfalsefalse)
        function createVideoPlayer ()
            function webBrowserRender ()
                dxDrawImage (posXposYwidthheightwebBrowser000tocolor(255,255,255,255), postGUI)
            end
            loadBrowserURL (webBrowserurl)
            
            setTimer (function()
                addEventHandler ("onClientRender"getRootElement(), webBrowserRender)
                showChat (false)
                if canClose then
                    guiSetVisible (closeButtontrue)
                    showCursor (true)
                end
            end5001)
            setElementFrozen (localPlayertrue)
            if duration then
                videoTimer setTimer (function()
                    removeEventHandler ("onClientRender"getRootElement(), webBrowserRender)
                    setElementFrozen (localPlayerfalse)
                    guiSetVisible (closeButtonfalse)
                    destroyElement (webBrowser)
                endduration1)
            end
            
            addEventHandler ("onClientGUIClick"closeButton, function (buttonstate)
                if button == "left" then
                    if isTimer (videoTimerthen
                        killTimer (videoTimer)
                        videoTimer nil
                        removeEventHandler ("onClientRender"getRootElement(), webBrowserRender)
                        setElementFrozen (localPlayerfalse)
                        guiSetVisible (closeButtonfalse)
                        destroyElement (webBrowser)
                    end
                end
            endfalse)
        end
        setTimer (createVideoPlayer5001)
    end
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(400*w645*h378*w102*h) and data.showed then
        if akcja then return end
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Wypelnij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        akcja true
        setTimer(function() akcja false end5000,1)
        end
        if isMouseIn(1137*w653*h384*w97*h) and data.showed then
        if akcja then return end
            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/Haslo musza miec\nod 3 do 22 znakow."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        akcja true
        setTimer(function() akcja false end5000,1)
        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)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    playVideo (00screenWscreenH"https://www.youtube.com/embed/K6pTnhOCmBQ?autoplay=1&showinfo=0&rel=0&controls=0&disablekb=1"300000falsefalse)
    addEventHandler("onClientRender"rootfilm)
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    --setElementAlpha(localPlayer,0)
    local los math.random(1,1)
     if los == 1 then
   --data.misc playSound("muzyka/muza1.mp3"true)
  -- tytul "&#9835; My Songs Know What You Did In The Dark &#9835;"
     elseif los == 2 then
   data.misc playSound("muzyka/muza2.mp3"true)
  -- tytul "&#9835; Memories (KSHMR Remix) &#9835;"
     elseif los == 3 then
   data.misc playSound("muzyka/muza3.mp3"true)
 --tytul "&#9835; Aero Chord - Wanchu Back [Monstercat Release] &#9835;"
     elseif los == 4 then
   data.misc playSound("muzyka/muza4.mp3"true)
   --tytul "&#9835; why mona - Wannabe (Spice Girls Cover) &#9835;"
end
    --setSoundVolume(muza4.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje sie")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1]=guiCreateEdit(400*w289*h1115*w101*h""false)
    data.button[2]=guiCreateEdit(400*w467*h1115*w101*h""false)
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Tagi: funkcja :: playvideo :: logowaniu
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