This commit is contained in:
michael.reiswich
2021-03-26 19:11:17 +01:00
parent 2bf9a1bf7f
commit 200c340e8e

View File

@@ -8,15 +8,12 @@
export default function playerBlips() {
mp.events.add("entityStreamIn", (entity) => {
if (entity.type === "player") {
try {
mp.gui.chat.push("Player recieved: Yes --> ColorID :" + entity.data.blipColor);
} catch (e) {
//E
}
mp.gui.chat.push("Player recieved: Yes");
let color = parseInt(entity.getVariable("blipColor"));
mp.gui.chat.push("Color : " + color);
if (entity.blip == 0) entity.createBlip(1);
mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created");
entity.setBlipColor(isNaN(color) ? 0 : color);
mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7);
mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true);
@@ -27,8 +24,10 @@ export default function playerBlips() {
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.");
}
});
}