push
This commit is contained in:
@@ -16,7 +16,7 @@ export default function playerBlips() {
|
|||||||
mp.players.forEachInStreamRange(
|
mp.players.forEachInStreamRange(
|
||||||
(player) => {
|
(player) => {
|
||||||
if (mp.players.local == player)
|
if (mp.players.local == player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!playerBlipMap.has(player)) {
|
if (!playerBlipMap.has(player)) {
|
||||||
let pBlip = mp.blips.new(1, player.position, {
|
let pBlip = mp.blips.new(1, player.position, {
|
||||||
@@ -59,21 +59,21 @@ export default function playerBlips() {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!escapeTimer && !afkStatus && getWantedCount() > 0) {
|
|
||||||
mp.events.call("SERVER:SetWantedFlash", true);
|
|
||||||
escapeTimer = setInterval(() => {
|
|
||||||
if (getWantedCount() == 0) {
|
|
||||||
clearInterval(escapeTimer);
|
|
||||||
escapeTimer = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mp.events.callRemote("CLIENT:EscapeWanted");
|
|
||||||
}, 300000); //120000 -> 2 min , 300000 -> 5min
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!escapeTimer && !afkStatus && getWantedCount() > 0) {
|
||||||
|
mp.events.call("SERVER:SetWantedFlash", true);
|
||||||
|
escapeTimer = setInterval(() => {
|
||||||
|
if (getWantedCount() == 0) {
|
||||||
|
clearInterval(escapeTimer);
|
||||||
|
escapeTimer = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mp.events.callRemote("CLIENT:EscapeWanted");
|
||||||
|
}, 5000); //120000 -> 2 min , 300000 -> 5min
|
||||||
|
}
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|
||||||
mp.events.add("playerReady", () => {
|
mp.events.add("playerReady", () => {
|
||||||
|
|||||||
31
ReallifeGamemode.Client/Gui/notification.ts
Normal file
31
ReallifeGamemode.Client/Gui/notification.ts
Normal 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)
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -277,6 +277,9 @@ spawnschutz();
|
|||||||
import bigmap from './Gui/bigmap';
|
import bigmap from './Gui/bigmap';
|
||||||
bigmap();
|
bigmap();
|
||||||
|
|
||||||
|
import notification from './Gui/notification';
|
||||||
|
notification();
|
||||||
|
|
||||||
require('./Gui/policedepartment');
|
require('./Gui/policedepartment');
|
||||||
require('./Gui/helptext');
|
require('./Gui/helptext');
|
||||||
require('./admin/spectate');
|
require('./admin/spectate');
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
|
|
||||||
int factionMoney = user.Wanteds * 6;
|
int factionMoney = user.Wanteds * 6;
|
||||||
var executiveFactions = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1 || f.Id == 3);
|
var executiveFactions = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1 || f.Id == 3);
|
||||||
foreach(var faction in executiveFactions)
|
foreach (var faction in executiveFactions)
|
||||||
{
|
{
|
||||||
faction.BankAccount.Balance += factionMoney;
|
faction.BankAccount.Balance += factionMoney;
|
||||||
}
|
}
|
||||||
@@ -224,8 +224,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
dbUser.SetBlipAndNametagColor();
|
dbUser.SetBlipAndNametagColor();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : ""));
|
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);
|
||||||
ChatService.SendMessage(user.Player, " !{#FFFF00}Fahndungslevel:~s~ " + newWanteds);
|
|
||||||
|
|
||||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
if (user.Wanteds <= 0)
|
if (user.Wanteds <= 0)
|
||||||
return;
|
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;
|
user.Wanteds -= 1;
|
||||||
if (user.Wanteds == 0)
|
if (user.Wanteds == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user