diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index 12a415df..e9f2ad95 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -8,12 +8,11 @@ export default function playerBlips() { mp.events.add("entityStreamIn", (entity) => { - mp.game.wait(500); + mp.game.wait(100); if (entity.type === "player") { - var entityMp = entity; let color = parseInt(entity.getVariable("blipColor")); - entity.createBlip(1); - var blip = entity.blip; + if (entity.blip == 0) entity.createBlip(1); + entity.setBlipColor(isNaN(color) ? 0 : color); mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7); @@ -23,20 +22,12 @@ export default function playerBlips() { } }); - - - mp.events.add("entityStreamOut", (entity) => { - if (entity.type === "player") { - entity.blip = null; - } - }); + mp.events.addDataHandler("blipColor", (entity, value) => { if (entity.type === "player") { - //mp.gui.chat.push("Setting Blip color..."); let color = parseInt(value); entity.setBlipColor(isNaN(color) ? 0 : color); - // mp.gui.chat.push("Player blip color was set."); } }); } \ No newline at end of file