M MY Multiplayer: Wiki
Side
Kind

playSFX3D

Client

Plays a sound from GTA San Andreas's audio banks at a position in the world.

sound|false playSFX3D(string container, int bank, int audio, float x, y, z [, bool looped = false])

Parameters

NameTypeDescription
containerstringSA's audio container: feet, genrl, pain_a, script, spc_ea, spc_fa, spc_ga, spc_na or spc_pa.
bankintThe bank number inside the container.
audiointThe sound number inside the bank.
x, y, zfloatThe sound's position in the world, as three numbers or one vec3.
loopedboolPlay the sound again from the start when it reaches the end.default false

Returns

The created sound element, or false if the bank or the sound does not exist.

Example

local pos = getElementPosition(localPlayer)
playSFX3D("genrl", 75, 0, pos)
Coming from MTAThe radio container is not accepted: the function warns and returns false.

See also