This commit is contained in:
2021-04-28 00:39:55 +02:00
parent c26d477557
commit 4403f0c238
5 changed files with 52 additions and 19 deletions

View File

@@ -59,6 +59,8 @@ export default function playerBlips() {
}
return;
}
}
});
if (!escapeTimer && !afkStatus && getWantedCount() > 0) {
mp.events.call("SERVER:SetWantedFlash", true);
@@ -70,10 +72,8 @@ export default function playerBlips() {
}
mp.events.callRemote("CLIENT:EscapeWanted");
}, 300000); //120000 -> 2 min , 300000 -> 5min
}, 5000); //120000 -> 2 min , 300000 -> 5min
}
}
});
}, 50);
mp.events.add("playerReady", () => {

View File

@@ -0,0 +1,31 @@
export default function notification() {
const _SET_NOTIFICATION_COLOR_NEXT = "0x39BBF623FC803EAC";
const _SET_NOTIFICATION_BACKGROUND_COLOR = "0x92F0DA1E27DB96DC";
mp.events.add("BN_Show", (message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => {
if (textColor > -1) mp.game.invoke(_SET_NOTIFICATION_COLOR_NEXT, textColor);
if (bgColor > -1) mp.game.invoke(_SET_NOTIFICATION_BACKGROUND_COLOR, bgColor);
if (flashing) mp.game.ui.setNotificationFlashColor(flashColor[0], flashColor[1], flashColor[2], flashColor[3]);
mp.game.gxt.set("BNOTIF_LONG_TEXT_ENTRY", `~a~${message}`);
mp.game.ui.setNotificationTextEntry("BNOTIF_LONG_TEXT_ENTRY");
mp.game.ui.addTextComponentSubstringPlayerName(""); // needed for text color to work
mp.game.ui.drawNotification(flashing, true);
});
mp.events.add("BN_ShowWithPicture", (title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => {
if (textColor > -1) mp.game.invoke(_SET_NOTIFICATION_COLOR_NEXT, textColor);
if (bgColor > -1) mp.game.invoke(_SET_NOTIFICATION_BACKGROUND_COLOR, bgColor);
if (flashing) mp.game.ui.setNotificationFlashColor(flashColor[0], flashColor[1], flashColor[2], flashColor[3]);
mp.game.gxt.set("BNOTIF_LONG_TEXT_ENTRY_IMG", `~a~${message}`);
mp.game.ui.setNotificationTextEntry("BNOTIF_LONG_TEXT_ENTRY_IMG");
mp.game.ui.addTextComponentSubstringPlayerName(""); // needed for text color to work
mp.game.ui.setNotificationMessage(notifPic, notifPic, flashing, icon, title, sender);
});
const notifications = {
show: (message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => mp.events.call("BN_Show", message, flashing, textColor, bgColor, flashColor),
showWithPicture: (title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200]) => mp.events.call("BN_ShowWithPicture", title, sender, message, notifPic, icon, flashing, textColor, bgColor, flashColor)
};
}

View File

@@ -277,6 +277,9 @@ spawnschutz();
import bigmap from './Gui/bigmap';
bigmap();
import notification from './Gui/notification';
notification();
require('./Gui/policedepartment');
require('./Gui/helptext');
require('./admin/spectate');

View File

@@ -224,8 +224,7 @@ namespace ReallifeGamemode.Server.Extensions
dbUser.SetBlipAndNametagColor();
dbContext.SaveChanges();
}
ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : ""));
ChatService.SendMessage(user.Player, " !{#FFFF00}Fahndungslevel:~s~ " + newWanteds);
user.Player.TriggerEvent("BN_ShowWithPicture", "Straftat", cop != null ? "Officer " + cop.Name + "" : "LSPD", "Du hast ein Verbrechen begangen: " + reason + ".'\n' Fahndungslevel: " + newWanteds, "DIA_POLICE", 1, true, 15);
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
{

View File

@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Wanted
if (user.Wanteds <= 0)
return;
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
player.TriggerEvent("BN_ShowWithPicture", "Abgetaucht", "Lester", "Du hast erfolgreich ein Wanted ~y~abgetaucht", "CHAR_LESTER", 1, true);
user.Wanteds -= 1;
if (user.Wanteds == 0)
{