This commit is contained in:
michael.reiswich
2021-03-26 19:29:19 +01:00
parent 200c340e8e
commit 7234fe9837

View File

@@ -1,4 +1,6 @@
const Natives = { 
const Natives = {
SET_BLIP_CATEGORY: "0x234CDD44D996FD9A", SET_BLIP_CATEGORY: "0x234CDD44D996FD9A",
SHOW_HEADING_INDICATOR_ON_BLIP: "0x5FBCA48327B914DF", SHOW_HEADING_INDICATOR_ON_BLIP: "0x5FBCA48327B914DF",
SET_BLIP_AS_SHORT_RANGE: "0xBE8BE4FE60E27B72", SET_BLIP_AS_SHORT_RANGE: "0xBE8BE4FE60E27B72",
@@ -8,10 +10,11 @@
export default function playerBlips() { export default function playerBlips() {
mp.events.add("entityStreamIn", (entity) => { mp.events.add("entityStreamIn", (entity) => {
if (entity.type === "player") { if (entity.type === "player") {
mp.gui.chat.push("Player recieved: Yes"); mp.gui.chat.push("Player recieved: Yes");
let color = parseInt(entity.getVariable("blipColor")); let color = parseInt(entity.getVariable("blipColor"));
mp.gui.chat.push("Color : " + color); mp.gui.chat.push("Color : " + color);
if (entity.blip == 0) entity.createBlip(1); entity.createBlip(1);
mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created"); mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created");
entity.setBlipColor(isNaN(color) ? 0 : color); entity.setBlipColor(isNaN(color) ? 0 : color);
@@ -19,9 +22,12 @@ export default function playerBlips() {
mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true); mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true);
mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true); mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true);
mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8); mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8);
} }
}); });
mp.events.addDataHandler("blipColor", (entity, value) => { mp.events.addDataHandler("blipColor", (entity, value) => {
if (entity.type === "player") { if (entity.type === "player") {
mp.gui.chat.push("Setting Blip color..."); mp.gui.chat.push("Setting Blip color...");