Files
2021-12-03 01:05:09 +00:00

25 lines
798 B
HTML

<html>
<head>
<!-- Need to include jQuery! -->
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script>
var audioPlayer = null;
// Listen for NUI Messages.
window.addEventListener('message', function(event) {
// Check for playSound transaction
if (event.data.transactionType == "playSound") {
if (audioPlayer != null) {
audioPlayer.pause();
}
audioPlayer = new Audio("./sounds/" + event.data.transactionFile + ".ogg");
audioPlayer.volume = event.data.transactionVolume;
audioPlayer.play();
}
});
</script>
</head>
</html>