Test Busfahrer
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
<Folder Include="assets\css\atm\" />
|
<Folder Include="assets\css\atm\" />
|
||||||
<Folder Include="assets\img\atm\" />
|
<Folder Include="assets\img\atm\" />
|
||||||
<Folder Include="assets\img\items\" />
|
<Folder Include="assets\img\items\" />
|
||||||
|
<Folder Include="assets\sound\jobs\busfahrer\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
32
ReallifeGamemode.Client/assets/html/sound/index.html
Normal file
32
ReallifeGamemode.Client/assets/html/sound/index.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Sound</title>
|
||||||
|
<style>
|
||||||
|
html, body, * {
|
||||||
|
background-color: transparent
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.2/howler.core.min.js"
|
||||||
|
integrity="sha256-q2vnVvwrx3RbYXPyAwx7c2npmULQg2VdCXBoJ5+iigs=" crossorigin="anonymous"></script>
|
||||||
|
<script>
|
||||||
|
function playSound(soundname, typ, volume) {
|
||||||
|
var sound = new Howl({
|
||||||
|
src: ['package://assets/sound/' + soundname + '.'+ typ],
|
||||||
|
loop: false,
|
||||||
|
valume: volume
|
||||||
|
})
|
||||||
|
sound.play()
|
||||||
|
sound.volume(volume);
|
||||||
|
sound.on('end', function () {
|
||||||
|
mp.trigger('sound:cancel')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ReallifeGamemode.Client/assets/sound/jobs/busfahrer/StartJob.wav
Normal file
BIN
ReallifeGamemode.Client/assets/sound/jobs/busfahrer/StartJob.wav
Normal file
Binary file not shown.
BIN
ReallifeGamemode.Client/assets/sound/music/mukke.mp3
Normal file
BIN
ReallifeGamemode.Client/assets/sound/music/mukke.mp3
Normal file
Binary file not shown.
@@ -197,6 +197,9 @@ gangwarHandle(globalData);
|
|||||||
import weapondamageUtil from './util/weapondamage';
|
import weapondamageUtil from './util/weapondamage';
|
||||||
weapondamageUtil();
|
weapondamageUtil();
|
||||||
|
|
||||||
|
import soundUtil from './util/sound';
|
||||||
|
soundUtil();
|
||||||
|
|
||||||
import clotheShopList from './Interaction/clothes/ClotheShop';
|
import clotheShopList from './Interaction/clothes/ClotheShop';
|
||||||
clotheShopList(globalData);
|
clotheShopList(globalData);
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ export default function checkpointHandle(globalData: IGlobalData) {
|
|||||||
textTime = setInterval(ClearText, delay)
|
textTime = setInterval(ClearText, delay)
|
||||||
}
|
}
|
||||||
mp.game.audio.playSoundFrontend(1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", true);
|
mp.game.audio.playSoundFrontend(1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", true);
|
||||||
|
mp.events.callRemote("playerWaitsInCheckpoint");
|
||||||
}
|
}
|
||||||
inCheckpoint = true;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -2598,7 +2598,26 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
player.TriggerEvent("manageFactionRanks", json);
|
player.TriggerEvent("manageFactionRanks", json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[Command("aplaysound", "~m~Benutzung: ~s~/aplaysound [Dateiname] [mp3/wav] [volume 0.0 - 1.0]", Alias ="aps")]
|
||||||
|
public void CmdAdminPlaySound(Player player, string sound, string typ, double volume = 100)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.TriggerEvent("CLIENT:PlaySound", sound, typ, volume);
|
||||||
|
}
|
||||||
|
[Command("astopsound", "~m~Benutzung: ~s~/astopsound", Alias="ass")]
|
||||||
|
public void CmdAdminStopSound(Player player)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.TriggerEvent("CLIENT:StopSound");
|
||||||
|
}
|
||||||
[Command("aspeed", "~m~Benutzung: ~s~/aspeed [Modifier]")] //TODO: Überarbeiten ?? SetPlayerVelocity ??
|
[Command("aspeed", "~m~Benutzung: ~s~/aspeed [Modifier]")] //TODO: Überarbeiten ?? SetPlayerVelocity ??
|
||||||
public void CmdAdminAspeed(Player player, int modifier)
|
public void CmdAdminAspeed(Player player, int modifier)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
{
|
{
|
||||||
CheckPointHandle.StartCheckPointRoute(player, RouteVeryLong, 3000, 1, 7, 5, "busDriverJob");
|
CheckPointHandle.StartCheckPointRoute(player, RouteVeryLong, 3000, 1, 7, 5, "busDriverJob");
|
||||||
}
|
}
|
||||||
|
player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("playerWaitsInCheckpoint")]
|
||||||
|
public void PlayerWaitsInCheckpoint(Player user)
|
||||||
|
{
|
||||||
|
if (user.GetUser().JobId == 4)
|
||||||
|
{
|
||||||
|
user.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/AnfahrtHaltestelle", "wav", 50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[RemoteEvent("playerInCheckpoint")]
|
[RemoteEvent("playerInCheckpoint")]
|
||||||
public void PlayerInCheckpoint(Player user)
|
public void PlayerInCheckpoint(Player user)
|
||||||
{
|
{
|
||||||
@@ -66,6 +75,7 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
if (user.GetUser().JobId == 4)
|
if (user.GetUser().JobId == 4)
|
||||||
{
|
{
|
||||||
BusDriverJob.payWage(user, 100);
|
BusDriverJob.payWage(user, 100);
|
||||||
|
user.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/AbfahrtHaltestelle", "mp3", 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user