PlaySFX3D: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix typo)
mNo edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{BR/Funcao cliente}}
{{New feature/item|3.0134|1.3.4|5731|
{{New feature/item|3.0134|1.3.4|5731|
This function plays a sound in the GTA world from GTA's big sound containers.
Essa função reproduz no mundo um áudio padrão do GTA.
}}
}}


{{Note|There is a tool available which allows you to find bank and sound IDs easily: [[https://community.mtasa.com/index.php?p=resources&s=details&id=7549 sfxBrowser:Download]]. }}
{{Note|Existe uma ferramenta que te permite encontrar as categorias e os IDs dos áudios facilmente: [[https://community.mtasa.com/index.php?p=resources&s=details&id=7549 sfxBrowser:Download]].}}
{{Warning|Many players use versions of GTA:SA (especially pirated versions) that have audio files full of zeros so that they can compresses better in their ''AUDIO\SFX\'' folder. (They lack any data)  
{{Aviso|Muitos jogadores usam versões do GTA:SA (especialmente versões pirateadas) ao qual possuem arquivos de áudio preenchidos com zeros para melhorar a compressão da pasta ''AUDIO\SFX\'' (eles estão corrompidos). No caso desses arquivos de áudio inválidos, essa função retorna ''false''. A função também retorna ''false'' ao tentar reproduzir um áudio removido de versões recentes do GTA:SA baixado na Steam.|true}}
In case of these invalid audio files, this function returns ''false''.


It also returns ''false'' when trying to play a track deleted in the recent GTA: SA Steam patches (and if the client is using a Steam GTA: SA copy).|true}}
==Sintaxe==
 
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element playSFX3D ( string containerName, int bankId, int soundId, float x, float y, float z [, bool looped = false ] )
element playSFX3D ( string categoria, int idGrupo, int idAudio, float x, float y, float z [, bool repetir = false ] )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===
===Argumentos necessários===
*'''containerName:''' The name of the audio container. Possible values are: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa"
*'''categoria:''' O nome de uma categoria de efeitos sonoros. Valores possíveis são: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa".
*'''bankId:''' The audio bank id
*'''idGrupo:''' O ID de um grupo de áudio.
*'''soundId:''' The sound id within the audio bank
*'''idAudio:''' O ID de um áudio dentro do grupo de áudios.
*'''x:''' A floating point number representing the X coordinate on the map.
*'''x:''' Um [[float]] representando a coordenada X no mapa.
*'''y:''' A floating point number representing the Y coordinate on the map.
*'''y:''' Um [[float]] representando a coordenada Y no mapa.
*'''z:''' A floating point number representing the Z coordinate on the map.
*'''z:''' Um [[float]] representando a coordenada Z no mapa.


===Optional Arguments===
===Argumentos opicionais===
*'''looped:''' A [[boolean]] representing whether the sound will be looped
{{BR/ArgOpcional}}
 
*'''repetir:''' Um [[boolean]] representando se o áudio deverá se repetir.
==Returns==
Returns a [[sound]] element if the sound was successfully created, ''false'' otherwise.


==Retorno==
Retorna um elemento de [[sound|áudio]] se bem sucedido, do contrário retorna ''false''.


{{New feature/item|3.0140|1.4|6443|
{{New feature/item|3.0140|1.4|6443|
==Syntax 2==
==Sintaxe 2==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element playSFX3D( string "radio", string radioStation, int trackId, float x, float y, float z [, bool looped = false ] )
element playSFX3D( string "radio", string estacao, int idMusica, float x, float y, float z [, bool repetir = false ] )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''radio:''' The string "radio" (used to differentiate to the first syntax)  
*'''radio:''' A string "radio" (usada para diferenciar da primeira sintaxe).
*'''radioStation:''' The radio station. Possible values are "Adverts", "Ambience", "Police", "Playback FM", "K-Rose", "K-DST", "Cutscene", "Beats", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-Jah West", "Master Sounds 98.3", "WCTR".
*'''estacao:''' A estação de rádio. Valores possíveis são: "Adverts", "Ambience", "Police", "Playback FM", "K-Rose", "K-DST", "Cutscene", "Beats", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-Jah West", "Master Sounds 98.3", "WCTR".
*'''trackId :''' The radio track id within the radio station audio file
*'''idMusica:''' O ID da música pertencente à estação de rádio.
*'''x:''' A floating point number representing the X coordinate on the map.
*'''x:''' Um [[float]] representando a coordenada X no mapa.
*'''y:''' A floating point number representing the Y coordinate on the map.
*'''y:''' Um [[float]] representando a coordenada Y no mapa.
*'''z:''' A floating point number representing the Z coordinate on the map.
*'''z:''' Um [[float]] representando a coordenada Z no mapa.


===Optional Arguments===
===Argumentos opicionais===
*'''looped:''' A [[boolean]] representing whether the sound will be looped
{{BR/ArgOpcional}}
==Returns==
*'''repetir:''' Um [[boolean]] representando se o áudio deverá se repetir.
Returns a [[sound]] element if the sound was successfully created, ''false'' otherwise.
 
==Retorno==
Retorna um elemento de [[sound|áudio]] se bem sucedido, do contrário retorna ''false''.
}}
}}


==Exemplo==


 
Este exemplo reproduz repetidamente próximo à você um áudio de alarme de incêndio.
==Example==
The following example plays a fire alarm sound near you (looped).
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local x, y, z = getElementPosition(localPlayer)
local x, y, z = getElementPosition(localPlayer)
if not playSFX3D("script", 7, 1, x + 10, y, z, true) then
if not playSFX3D("script", 7, 1, x + 10, y, z, true) then
     outputChatBox("You have to install some missing audio files to hear the sound")
     outputChatBox("Você precisa instalar alguns arquivos de áudio ausentes")
end
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==Veja também==
{{Client_audio_functions}}
{{PT-BR/Funcoes_audio_client}}


[[en:playSFX3D]]
[[hu:playSFX3D]]
[[hu:playSFX3D]]

Revision as of 01:31, 18 August 2021

Template:BR/Funcao cliente Essa função reproduz no mundo um áudio padrão do GTA.


[[{{{image}}}|link=|]] Note: Existe uma ferramenta que te permite encontrar as categorias e os IDs dos áudios facilmente: [sfxBrowser:Download].
Dialog-warning.png Aviso: Muitos jogadores usam versões do GTA:SA (especialmente versões pirateadas) ao qual possuem arquivos de áudio preenchidos com zeros para melhorar a compressão da pasta AUDIO\SFX\ (eles estão corrompidos). No caso desses arquivos de áudio inválidos, essa função retorna false. A função também retorna false ao tentar reproduzir um áudio removido de versões recentes do GTA:SA baixado na Steam.

Sintaxe

element playSFX3D ( string categoria, int idGrupo, int idAudio, float x, float y, float z [, bool repetir = false ] )

Argumentos necessários

  • categoria: O nome de uma categoria de efeitos sonoros. Valores possíveis são: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa".
  • idGrupo: O ID de um grupo de áudio.
  • idAudio: O ID de um áudio dentro do grupo de áudios.
  • x: Um float representando a coordenada X no mapa.
  • y: Um float representando a coordenada Y no mapa.
  • z: Um float representando a coordenada Z no mapa.

Argumentos opicionais

NOTA: Ao usar argumentos opcionais, pode ser necessário fornecer todos os argumentos anteriores ao que você deseja usar. Para obter mais informações sobre argumentos opcionais, consulte Argumentos Opcionais.

  • repetir: Um boolean representando se o áudio deverá se repetir.

Retorno

Retorna um elemento de áudio se bem sucedido, do contrário retorna false.

Sintaxe 2

element playSFX3D( string "radio", string estacao, int idMusica, float x, float y, float z [, bool repetir = false ] )

Required Arguments

  • radio: A string "radio" (usada para diferenciar da primeira sintaxe).
  • estacao: A estação de rádio. Valores possíveis são: "Adverts", "Ambience", "Police", "Playback FM", "K-Rose", "K-DST", "Cutscene", "Beats", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-Jah West", "Master Sounds 98.3", "WCTR".
  • idMusica: O ID da música pertencente à estação de rádio.
  • x: Um float representando a coordenada X no mapa.
  • y: Um float representando a coordenada Y no mapa.
  • z: Um float representando a coordenada Z no mapa.

Argumentos opicionais

NOTA: Ao usar argumentos opcionais, pode ser necessário fornecer todos os argumentos anteriores ao que você deseja usar. Para obter mais informações sobre argumentos opcionais, consulte Argumentos Opcionais.

  • repetir: Um boolean representando se o áudio deverá se repetir.

Retorno

Retorna um elemento de áudio se bem sucedido, do contrário retorna false.

Exemplo

Este exemplo reproduz repetidamente próximo à você um áudio de alarme de incêndio.

local x, y, z = getElementPosition(localPlayer)
if not playSFX3D("script", 7, 1, x + 10, y, z, true) then
    outputChatBox("Você precisa instalar alguns arquivos de áudio ausentes")
end

Veja também