SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje klienta
  3. getSoundHeardVolume

Funkcja

getSoundHeardVolume

KlientDźwięk (klient)Tylko Trilogy Hub

Zwraca głośność, którą gracz naprawdę słyszy: po odległości od kamery i po suwaku głośności w ustawieniach.

Składnia

float getSoundHeardVolume(sound theSound)

Argumenty

theSoundsound
Dźwięk.

Zwraca

Głośność 0-1 albo false.

Przykład

addEventHandler("onClientRender", root, function()
    if isElement(radio) then
        dxDrawText(("Radio: %d%%"):format(getSoundHeardVolume(radio) * 100), 20, 300)
    end
end)