From 9a4cbb48cd9b868fffe1b6941474e7cd5a45cb78 Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Mon, 5 Apr 2021 01:31:47 +0200 Subject: [PATCH] Kreiselficker --- ReallifeGamemode.Client/Gui/blips.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index 1827cb07..9d217b75 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -1,4 +1,6 @@ -const Natives = { +import { read } from "fs"; + +const Natives = { SET_BLIP_CATEGORY: RageEnums.Natives.Ui.SET_BLIP_CATEGORY, SHOW_HEADING_INDICATOR_ON_BLIP: RageEnums.Natives.Ui.SHOW_HEADING_INDICATOR_ON_BLIP, SET_BLIP_AS_SHORT_RANGE: RageEnums.Natives.Ui.SET_BLIP_AS_SHORT_RANGE, @@ -9,8 +11,10 @@ export default function playerBlips() { var playerBlipMap: Map; + var ready = false; - mp.events.add("render", () => { + setInterval(() => { + if (!ready) return; if (!playerBlipMap) playerBlipMap = new Map(); mp.players.forEachInStreamRange( @@ -31,6 +35,10 @@ export default function playerBlips() { pBlip.setPosition(player.position.x, player.position.y, player.position.z); pBlip.setRotation(player.heading); }); + }, 100); + + mp.events.add("playerReady", () => { + ready = true; }); mp.events.add("entityStreamOut", (entity) => {