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

Wysłany: 2019-07-16, 20:02


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Witam posiadam skrypt na stereo lecz jest on do wszysktich pojazd?w :/
Chcia?bym zrobi? stereo tylko i wy??cznie do pony :D

Skrypt stereo
local stereo = {}
local screenWscreenH guiGetScreenSize()

function gui()
        dxDrawRectangle(screenW 0.2778screenH 0.8111screenW 0.4410screenH 0.0844tocolor(25525525560), false)
        dxDrawLine(screenW 0.2764screenH 0.8111screenW 0.7181screenH 0.8111tocolor(10900255), 2true)
        dxDrawLine(screenW 0.7181screenH 0.8100screenW 0.7181screenH 0.8956tocolor(10900255), 2true)
        dxDrawLine(screenW 0.2764screenH 0.8111screenW 0.2764screenH 0.8956tocolor(10900255), 2true)
        dxDrawLine(screenW 0.2764screenH 0.8956screenW 0.7181screenH 0.8956tocolor(10900255), 2true)
        dxDrawText("System Stereo"screenW 0.4181screenH 0.8156screenW 0.5854screenH 0.8289tocolor(255255255255), 1.00"default-bold""center""bottom"falsefalsefalsefalsefalse)
        dxDrawRectangle(screenW 0.2813screenH 0.8733screenW 0.4306screenH 0.0167tocolor(10900168), false)
        dxDrawText("Powyzej wklej URL muzyki i kliknij tutaj "screenW 0.2840screenH 0.8733screenW 0.7111screenH 0.8900tocolor(255255255255), 1.00"default""center""top"falsefalsefalse,  falsefalse)
    end



function x(plr)
if plr == localPlayer then
    local veh getPedOccupiedVehicle(localPlayer)
    if getVehicleController(veh) ~= localPlayer then return end
    addEventHandler("onClientRender"rootgui)
   okno guiCreateWindow(0.300.860.400.10"System STEREO (Kliknij F3 aby pokaza? kursor)"true)
    guiWindowSetMovable(oknofalse)
    guiWindowSetSizable(oknofalse)
        guiSetAlpha(okno0)
        button guiCreateButton(0.280.870.430.02""true)
        guiSetAlpha(button0.00)
        link guiCreateEdit(0.290.840.420.03""true)     
    guiSetVisible(oknotrue)
    end
end

function ustaw()
if source ~= button then return end
local veh getPedOccupiedVehicle(localPlayer)
if not veh then outputChatBox("* Nie jeste? w poje?dzie!") return end-- nie powinno sizdarzy?
if getElementData(veh,"stereo:use") ~= true then
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("* Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:link",guiGetText(link))
setElementData(veh,"stereo:use"true)
guiSetText(button,"WY??CZ RADIO")
else
if dziecijp[getPlayerSerial(localPlayer)] then outputChatBox("* Posiadasz zablokowan? mo?liwos? korzystania z STEREO.",255,255,255) return end
setElementData(veh,"stereo:use"false)
guiSetText(button,"W??CZ RADIO (PODAJ LINK DO MP3/PLS/M3U)")
end
end
addEventHandler "onClientGUIClick"resourceRootustaw )

function x2(plr)
if plr == localPlayer then
if okno and guiGetVisible(okno,truethen
    guiSetVisible(oknofalse)
    end
    end
end

addEventHandler("onClientPlayerVehicleEnter"getRootElement(),
function(theVehicleseat)
if source ~= localPlayer then return end
if seat ~= 0 then return end
if getVehicleUpgradeOnSlot(theVehicle10) == 1086 then
x(source)
end
end)
function wyjebpanel()
local veh getPedOccupiedVehicle(localPlayer)
    if not veh then
        if okno and ( guiGetVisible okno ) == true then
        guiSetVisible(oknofalse)
                guiSetVisible(linkfalse)
            removeEventHandler("onClientRender"rootgui)
        end
    end
end
addEventHandler("onClientRender"rootwyjebpanel)

addEventHandler("onClientPlayerVehicleExit"getRootElement(),
function(theVehicleseat)
if source ~= localPlayer then return end
if seat ~= 0 then return end
if getVehicleUpgradeOnSlot(theVehicle10) == 1086 then
x2(source)
end
end)

addEventHandler("onClientElementDataChange",root,function(data,_)
    if getElementType(source) ~= "vehicle" then return end
if data ~= "stereo:use" then return end
local data_tog getElementData(source,data)
if data_tog == true then
        local url getElementData(source,"stereo:link")
        stereo[source]=playSound3D(url000true)
        setSoundVolume(stereo[source], 0.6)
        setSoundEffectEnabled(stereo[source],"compressor",true)
        setSoundMaxDistance(stereo[source], 20)
        setElementDimension(stereo[source],getElementDimension(source))
        setElementInterior(stereo[source],getElementInterior(source))
        attachElements(stereo[source], source)
else
        if not stereo[sourcethen return end
        stopSound(stereo[source])
end
end)


addEventHandler("onClientElementStreamIn",root,function()
    if getElementType(source) ~= "vehicle" then return end
    if not stereo[sourcethen
        local data_tog getElementData(source,"stereo:use")
        if data_tog == true then
            local url getElementData(source,"stereo:link")
            stereo[source]=playSound3D(url000)
            setSoundVolume(stereo[source], 0.6)
            setSoundEffectEnabled(stereo[source],"compressor",true)
            setSoundMaxDistance(stereo[source], 20)
            setElementDimension(stereo[source],getElementDimension(source))
            setElementInterior(stereo[source],getElementInterior(source))
            attachElements(stereo[source], source)
        end
    end
end)


addEventHandler("onClientElementDestroy",root,function()
    if getElementType(source) ~= "vehicle" then return end
        local data_tog getElementData(source,"stereo:use")
        if data_tog == true then
            if not stereo[sourcethen return end
            stopSound(stereo[source])
                guiSetVisible(oknofalse)
                        guiSetVisible(linkfalse)
                    removeEventHandler("onClientRender"rootgui)
        end
end)
fileDelete("c.lua")


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 4 piw(a):
RAPsy, MietekRozprowac, tiger18, Krycha66
Wysłany: 2019-07-17, 08:43


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

getElementModel

Sprawdzasz za pomoc? powy?szej funkcji, czy jest to r?wne ID pojazdu Pony

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-19, 10:56


matiyt4







Wiek: 24
Na forum: 2394 dni
Posty: 1



Respekt: 50

Mo?esz da? link do pobrania STEREO Bo szukam i nie moge znale?? postawie :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-19, 14:17


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

matiyt4, stereo jest w wielu paczkach np Play Your Stories, tak?e w tej paczce kt?r? ja wstawi?em CrazyRPG lub wpisz po prostu stereo gtao i tyle.

Postaw piwo autorowi tego posta
 

 
Tagi: stereo
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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