Test Busfahrer
This commit is contained in:
@@ -76,6 +76,7 @@ export default function checkpointHandle(globalData: IGlobalData) {
|
||||
textTime = setInterval(ClearText, delay)
|
||||
}
|
||||
mp.game.audio.playSoundFrontend(1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", true);
|
||||
mp.events.callRemote("playerWaitsInCheckpoint");
|
||||
}
|
||||
inCheckpoint = true;
|
||||
|
||||
|
||||
33
ReallifeGamemode.Client/util/sound.ts
Normal file
33
ReallifeGamemode.Client/util/sound.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
var soundBrowser;
|
||||
|
||||
export default function weapondamageUtil() {
|
||||
mp.events.add('CLIENT:PlaySound', (sound, typ, volume) => {
|
||||
//mp.gui.chat.push("Debugstart1");
|
||||
mp.events.call('sound:cancel');
|
||||
mp.events.call('sound:play', sound, typ, volume/100);
|
||||
//mp.gui.chat.push("Debugstart2");
|
||||
});
|
||||
mp.events.add('CLIENT:StopSound', () => {
|
||||
//mp.gui.chat.push("Debugstop1");
|
||||
mp.events.call('sound:cancel');
|
||||
//mp.gui.chat.push("Debugstop2");
|
||||
});
|
||||
mp.events.add({
|
||||
'sound:play': (name, typ, volume) => {
|
||||
if (soundBrowser == null) {
|
||||
soundBrowser = mp.browsers.new("package://assets/html/sound/index.html");
|
||||
//mp.gui.chat.push("Debugstart3");
|
||||
soundBrowser.execute(`playSound("${name}", "${typ}", "${volume}")`);
|
||||
//mp.gui.chat.push("Debugstart4");
|
||||
}
|
||||
},
|
||||
'sound:cancel': () => {
|
||||
if (soundBrowser != null) {
|
||||
//mp.gui.chat.push("Debugstop3");
|
||||
soundBrowser.destroy();
|
||||
//mp.gui.chat.push("Debugstop4");
|
||||
soundBrowser = null;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user