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

Wysłany: 2016-08-05, 11:25


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

siema, mam kino ale s?ycha? je na ca?ej mapie chcia?bym ?eby s?ycha? j? z jakiej? odleg?o?ci, oto kod:

local cWindow = guiCreateWindow(337, 177, 816, 762, "KINO", false)
local browser = guiCreateBrowser(0, 0, 800, 600, false, false, false, cWindow)

local theBrowser = guiGetBrowser(browser)
addEventHandler("onClientBrowserCreated", theBrowser, 
    function()
        loadBrowserURL(source, "http://www.youtube.com")
        setSoundMaxDistance(source ,350 ) 
    end
)


CINEMA = {
    button = {},
    window = {},
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        guiWindowSetSizable(cWindow, false)
        guiSetProperty(cWindow, "CaptionColour", "FF0309FB")
        guiSetVisible(cWindow,false)



        CINEMA.button[1] = guiCreateButton(9, 608, 388, 35, "PODAJ LINK", false, cWindow)
        guiSetFont(CINEMA.button[1], "default-bold-small")
        guiSetProperty(CINEMA.button[1], "NormalTextColour", "FFFF0000")
        CINEMA.button[2] = guiCreateButton(427, 608, 381, 35, "URUCHOM FILM W KINIE", false, cWindow)
        guiSetFont(CINEMA.button[2], "default-bold-small")
        guiSetProperty(CINEMA.button[2], "NormalTextColour", "FFFF0000")
        CINEMA.button[3] = guiCreateButton(10, 653, 388, 35, "ZAMKNIJ", false, cWindow)
        guiSetFont(CINEMA.button[3], "default-bold-small")
        guiSetProperty(CINEMA.button[3], "NormalTextColour", "FFFF0000")
        CINEMA.button[4] = guiCreateButton(425, 654, 383, 34, "ZOBACZ FILM NA FULL EKRANIE", false, cWindow)
        guiSetFont(CINEMA.button[4], "default-bold-small")
        guiSetProperty(CINEMA.button[4], "NormalTextColour", "FFFF0000")
        CINEMA.edit[1] = guiCreateEdit(11, 700, 796, 52, "", false, cWindow)
        guiEditSetReadOnly(CINEMA.edit[1], true)    
    end
)


function geturl()
if source == CINEMA.button[1] then
guiSetText(CINEMA.edit[1],getBrowserURL(theBrowser))
end
end
addEventHandler("onClientGUIClick",root,geturl)


function dxDrawImage3D(x,y,z,w,h,m,c,r,...)
        local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z
    return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c , ...)
end
 
 
local screenWidth, screenHeight = guiGetScreenSize()
 
local webBrowser = createBrowser(screenWidth, screenHeight, false, false)

function webBrowserRender()
local x, y = 110.7, 1024.15
dxDrawMaterialLine3D(x, y, 23.25, x, y, 14.75, webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19)
end

function fullscreen()
local URLs = string.sub(guiGetText(CINEMA.edit[1]),"33")
if source == CINEMA.button[4] then
loadBrowserURL(webBrowser, "https://www.youtube.com/embed/"..URLs.."?autoplay=1&iv_load_policy=3&enablejsapi=1&fs=0&theme=light") 
end
end
addEventHandler("onClientGUIClick",root,fullscreen)

function brow()
    if source == CINEMA.button[2] then
        loadBrowserURL(webBrowser, guiGetText(CINEMA.edit[1]))
        addEventHandler("onClientPreRender", root, webBrowserRender)
    end
end
addEventHandler("onClientBrowserCreated", webBrowser, brow)
addEventHandler("onClientGUIClick",root,brow)

function url()
guiSetVisible(cWindow,true)
showCursor( true )
guiSetInputEnabled( true )
end
addCommandHandler("kino",url)

function closeman()
if source == CINEMA.button[3] then
guiSetVisible(cWindow,false)
showCursor( false )
guiSetInputEnabled( false )
end 
end
addEventHandler("onClientGUIClick",root,closeman)

za poprawe kodu stawiam piwo i respekt

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 12:00


NeroNix







Wiek: 27
Na forum: 3756 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Kalizman, Zamie?:
        setSoundMaxDistance(source ,350 ) 

na:
        setSoundMaxDistance(theBrowser ,350 ) 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-05, 14:31


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

nadal nic s?ycha? na ca??j mapie

[ Dodano: 2016-08-05, 14:37 ]
w??czenie kina (filmu czy filmiku) z YT slyszy i widzi ta osoba ktora to wlaczy co zrobic zeby wszyscy slyszeli i widzieli?

Postaw piwo autorowi tego posta
 

 
Tagi: odległość
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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