audio_play_for_character(audio_name, human_name[, type_name[, for_cutscene[, blocking[, variant[, voice_distance[, cellphone_line[, ignore_fade]]]]]]])

Parameters:
audio_name (string) name of sound
human_name (string) name of character
type_name (string, optional) name of audio source (can be "foley", "voice", "music", or "ambient"; defaults to "foley")
for_cutscene (boolean, optional) no longer used (NIQ 4/2/09: this parameter needs to be removed)
blocking (boolean, optional) set to true if the function should block until the sound has finished playing (defaults to false)
variant (integer, optional) index of the specific variant of the voice line to play (or -1 for a random selection; defaults to -1)
voice_distance (integer, optional) distance that the foley can be heard from; only used for voices (0 = short, 1 = normal, 2 = long, 3 = extreme; defaults to -1, which is normal distance for peds, and extreme distance for passengers in cars)
cellphone_line (boolean, optional) set to true if the audio is for a cellphone line (defaults to false)
ignore_fade (boolean, optional) set to true to ignore the volume throttling that occurs with screen fades (defaults to false)
 
Returns:
(integer) audio instance handle, or -1 on error

Description:
Play a 3D sound (by name) on a character.

Example:

   audio_play_for_character("Woot", "#PLAYER1#", "foley")

Plays the sound "Woot" on the local player.

 

back to indexSR3 Script Action Documentation
Last updated: Tue, 09 Aug 2011 11:32:16