Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/C#/FiveM/RefuelingNozzle/Output/html/ui.html
2023-07-31 21:20:56 +02:00

38 lines
1.3 KiB
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>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body style="background-color: rgba(0, 0, 0, 0);display: block;">
<script>
var audioPlayer = null;
window.addEventListener('message', function(event) {
if (event.data.Type === "playSound") {
if (event.data.File === 'none') {
if (audioPlayer != null) {
audioPlayer.pause();
audioPlayer = null;
}
} else {
try {
audioPlayer = new Howl({
src: ["./sounds/" + event.data.File + ".ogg"]
});
audioPlayer.volume(0.1);
audioPlayer.play();
} catch (err) {
$.post('http://refuelingnozzle/msg', JSON.stringify({
text: err.message
}));
}
}
}
});
</script>
</body>
</html>