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

Wysłany: 2018-11-11, 14:15


gufi009







Wiek: 25
Na forum: 4548 dni
Posty: 7
Nick w MP: WezZostan



Respekt: 50

Witam, mam problem ze skryptem na podmian? d?wi?ku silnika. Chodzi o to, ?e gdy w??cz? skrypt, wsi?d? do auta to wszystko jest dobrze - d?wi?k odtwarzany jest prawid?owo, ale jak przesi?d? si? do kolejnego auta to d?wi?k silnika jest s?yszany przy aucie w kt?rym siedzia?em poprzednio a nie tym, w kt?rym jestem aktualnie. R?wnie? jak auto oddam do przecho czy po prostu dam destroy w panelu to d?wi?k auta dalej jest odtwarzany. Wie kto? jak to rozwi?za??


function engine_func()
    local veh getPedOccupiedVehicle getLocalPlayer())
    if veh then
        if getElementModel veh ) == 411 then
            if getVehicleEngineState veh ) == true then
                if getElementSpeed veh"kmh" ) > 10 then
                    if idle_sound then
                        destroyElement idle_sound )
                        idle_sound nil
                    end
                    if sound == nil then
                        sound playSound3D engine_sound000true )
                        attachElements soundveh )
                    end
                    setSoundSpeed soundgetVehicleRPM(veh)/10000 )
                elseif getElementSpeed veh"kmh" ) < 10 then
                    if idle_sound == nil then
                        idle_sound playSound3D idle_soundfile000true )
                        setSoundVolume idle_sound0.2 )
                        attachElements idle_soundveh )
                    end
                elseif getElementSpeed veh"kmh" ) == 0 then
                    if sound then
                        destroyElement sound )
                        sound nil
                    end
                end
            else
                if sound then
                    destroyElement sound )
                    sound nil
                end
                if idle_sound then
                    destroyElement idle_sound )
                    idle_sound nil
                end
            end
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-12, 18:31


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Po prostu u?yj,


Więcej informacji znajdziesz w Wikipedii MTA:

stopSound


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-14, 18:00


CrimeProject







Wiek: 24
Na forum: 2760 dni
Posty: 16
Nick w MP: Crime-Project

Piwa: 16

Respekt: 30

Ostrzeżeń: 100%
Mo?liwe, ?e to przez MTA 1.5.6, r?wnie? mam dziwne problemy z dzwi?kiem.

Postaw piwo autorowi tego posta
 

 
Tagi: pdmiana :: dźwieku :: silnika
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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