Files
Elite-Gaming-FiveM/resources/PlayCustomSounds/html/index.html
T
2026-02-11 21:08:37 -08:00

22 lines
790 B
HTML

<html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.1/howler.min.js" type="text/javascript"></script>
<script>
var audioPlayer = null;
window.addEventListener('message', function(event) {
if (event.data.submissionType == "sendSound") {
if (audioPlayer != null) {
audioPlayer.pause();
}
audioPlayer = new Howl({src: ["./sounds/" + event.data.submissionFile + ".ogg"]});
audioPlayer.volume(event.data.submissionVolume);
audioPlayer.play();
}
});
</script>
</head>
</html>