Audio::playSoundFromEntity: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
m (Fixed bracket error)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
All found occurrences in b617d, sorted alphabetically and identical lines removed: pastebin.com/f2A7vTj0 <br>No changes made in b678d.<br><br>gtaforums.com/topic/795622-audio-for-mods<br>
All found occurrences in b617d, sorted alphabetically and identical lines removed: pastebin.com/f2A7vTj0 <br>No changes made in b678d.<br><br>gtaforums.com/topic/795622-audio-for-mods<br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">audio.playSoundFromEntity(soundId, audioName, entity, audioRef, p4, p5);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.audio.playSoundFromEntity(soundId, audioName, entity, audioRef, p4, p5);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''soundId:''' int
*'''soundId:''' int
Line 13: Line 13:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
function playerEnterVehicleHandler(vehicle) {
    mp.game.audio.playSoundFromEntity(1, "CONFIRM_BEEP", vehicle.handle, "HUD_MINI_GAME_SOUNDSET", true, 0);
}
 
mp.events.add("playerEnterVehicle", playerEnterVehicleHandler);
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Audio_function_c}}
{{Audio_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 12:33, 27 January 2020

All found occurrences in b617d, sorted alphabetically and identical lines removed: pastebin.com/f2A7vTj0
No changes made in b678d.

gtaforums.com/topic/795622-audio-for-mods

Syntax

mp.game.audio.playSoundFromEntity(soundId, audioName, entity, audioRef, p4, p5);

Required Arguments

  • soundId: int
  • audioName: String
  • entity: Entity handle or object
  • audioRef: String
  • p4: Boolean
  • p5: unknown (to be checked)

Return value

  • Undefined

Example

function playerEnterVehicleHandler(vehicle) {
    mp.game.audio.playSoundFromEntity(1, "CONFIRM_BEEP", vehicle.handle, "HUD_MINI_GAME_SOUNDSET", true, 0);
}

mp.events.add("playerEnterVehicle", playerEnterVehicleHandler);

See also