Files
reallife-gamemode/ReallifeGamemode.Client/Gui/bigmap.ts
2021-05-09 20:32:26 +02:00

35 lines
1.2 KiB
TypeScript

import { GlobalData } from "..";
export default function bigmap() {
var bigmap = { enabled: false, timer: null };
mp.game.ui.setRadarZoom(0.0);
mp.game.ui.setRadarBigmapEnabled(false, false);
mp.events.add("render", () => {
mp.game.controls.disableControlAction(0, 48, true);
if (mp.game.controls.isDisabledControlJustPressed(0, 48) && !GlobalData.InChat) {
if (bigmap.timer != null) {
clearTimeout(bigmap.timer);
bigmap.timer = null;
}
if (!bigmap.enabled) {
mp.game.ui.setRadarBigmapEnabled(true, false);
mp.game.ui.setRadarZoom(1.0);
bigmap.enabled = true;
bigmap.timer = setTimeout(() => {
mp.game.ui.setRadarBigmapEnabled(false, false);
mp.game.ui.setRadarZoom(0.0);
bigmap.enabled = false;
bigmap.timer = null;
}, 5000);
} else {
mp.game.ui.setRadarBigmapEnabled(false, false);
mp.game.ui.setRadarZoom(0.0);
bigmap.enabled = false;
}
}
});
}