HU/playSFX3D: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 54: Line 54:


==Example==
==Example==
The following example plays a fire alarm sound near you (looped).
A következő példa lejátsza a tűzoltó hangot (ismétlődő).
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local x, y, z = getElementPosition(localPlayer)
local x, y, z = getElementPosition(localPlayer)

Revision as of 21:31, 19 July 2018

Ez a funkció lejátszik egy hangot a GTA világban a nagy GTA hangkonténerből..


[[{{{image}}}|link=|]] Note: Itt egy eszköz, amely lehetővé teszi, hogy könnyedén találj meg bank, és hangazonosítókat: [sfxBrowser:Download].
Dialog-warning.png Warning: Sok játékos használja a GTA:SA-t (különösen a kalóz) verzióit, amelyeknek nulla hangfájljai vannak, így ők jobban tudják tömöríteni ezeket az \AUDIO\SFX\ mappájukban. (Hiányoznak adatok)

Ezek érvénytelen audió fájlok esetén ez a funkció hamis értéked ad vissza.

Akkor is hamis értéked ad vissza, ha egy töröld dalt próbál meg lejátszani a legújabb GTA:SA Steam verziójában (és ha a kliens egy GTA: SA Steam másolatát használja.

Syntax

element playSFX3D ( string containerName, int bankId, int soundId, float x, float y, float z [, bool looped = false ] )

Required Arguments

  • 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"
  • bankId: The audio bank id
  • soundId: The sound id within the audio bank
  • x: A floating point number representing the X coordinate on the map.
  • y: A floating point number representing the Y coordinate on the map.
  • z: A floating point number representing the Z coordinate on the map.

Optional Arguments

  • looped: A boolean representing whether the sound will be looped

Returns

Returns a sound element if the sound was successfully created, false otherwise.


ADDED/UPDATED IN VERSION 1.4 r6443:

Syntax 2

element playSFX3D( string "radio", string radioStation, int trackId, float x, float y, float z [, bool looped = false ] )

Required Arguments

  • radio: The string "radio" (used to differentiate to the first syntax)
  • 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".
  • trackId : The radio track id within the radio station audio file
  • x: A floating point number representing the X coordinate on the map.
  • y: A floating point number representing the Y coordinate on the map.
  • z: A floating point number representing the Z coordinate on the map.

Optional Arguments

  • looped: A boolean representing whether the sound will be looped

Returns

Returns a sound element if the sound was successfully created, false otherwise.


Example

A következő példa lejátsza a tűzoltó hangot (ismétlődő).

local x, y, z = getElementPosition(localPlayer)
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")
end

See Also