- 57
- 5
- Версия SA-MP
-
- Любая
Почему звук никак не меняется, а всё равно очень громкий
Lua:
local settings = ini.load({
othersettings = {
volume = 10
},
}, 'config.ini')
local volume = imgui.new.int(settings.othersettings.volume)
imgui.Text('Громкость')
if imgui.SliderInt("##volume", volume, 0, 100) then
if music ~= nil then setAudioStreamVolume(music, volume.v / 100) end
settings.othersettings.volume = volume[0]
ini.save(settings, 'config.ini')
end
function playRandomSound()
if #sound_streams > 0 then
local random_index = math.random(1, #sound_streams)
local stream = sound_streams[random_index]
setAudioStreamState(stream, as_action.PLAY)
setAudioStreamVolume(stream, 70)
else
sampAddChatMessage(u8:decode'Нет доступных звуков для воспроизведения.', -1)
end
end