push
This commit is contained in:
@@ -16,7 +16,7 @@ export default function playerBlips() {
|
||||
mp.players.forEachInStreamRange(
|
||||
(player) => {
|
||||
if (mp.players.local == player)
|
||||
return;
|
||||
return;
|
||||
|
||||
if (!playerBlipMap.has(player)) {
|
||||
let pBlip = mp.blips.new(1, player.position, {
|
||||
@@ -59,21 +59,21 @@ export default function playerBlips() {
|
||||
}
|
||||
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);
|
||||
|
||||
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';
|
||||
bigmap();
|
||||
|
||||
import notification from './Gui/notification';
|
||||
notification();
|
||||
|
||||
require('./Gui/policedepartment');
|
||||
require('./Gui/helptext');
|
||||
require('./admin/spectate');
|
||||
|
||||
Reference in New Issue
Block a user