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

Zdarzenie

onClientSoundStream

KlientDźwięk (klient)Identyczne z MTA:SA

Wynik połączenia dźwięku z adresem http(s):// (playSound/playSound3D). true po pierwszych zdekodowanych próbkach; false po błędzie i jednej cichej próbie ponownego połączenia.

Obsługa

addEventHandler("onClientSoundStream", root, function(success, length, streamName, error) ... end)

Parametry

successbool
Czy strumień gra.
lengthfloat
Długość w sekundach, 0 dla radia lub nieznanej.
streamNamestring
Nazwa stacji (ICY) albo pusty tekst.
errorstring
Powód błędu albo pusty tekst.

Źródło

source to dźwięk.

Przykład

local radio = playSound3D("https://s2.radioparty.pl/energy2000stream", x, y, z)
addEventHandler("onClientSoundStream", radio, function(success, length, streamName, err)
    outputChatBox(success and ("Radio: " .. streamName) or ("Błąd radia: " .. err))
end)

Zobacz też