Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: pdmiana
1. Pdmiana dźwieku silnika
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??

[lua]
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_sound, 0, 0, 0, true )
attachElements ( sound, veh )
end
setSoundSpeed ( sound, getVehicleRPM(veh)/10000 )
elseif getElementSpeed ( veh, "kmh" ) < 10 then
if idle_sound == nil then
idle_sound = playSound3D ( idle_soundfile, 0, 0, 0, true )
setSoundVolume ( idle_sound, 0.2 )
attachElements ( idle_sound, veh )
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
...