53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
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,
|
|
SET_BLIP_DISPLAY: RageEnums.Natives.Ui.SET_BLIP_DISPLAY
|
|
};
|
|
|
|
export default function playerBlips() {
|
|
|
|
/* mp.events.add("entityStreamIn", (entity) => {
|
|
if (entity.type === "player") {
|
|
|
|
var entityMp = <EntityMp>entity;
|
|
|
|
mp.gui.chat.push("Player recieved: Yes");
|
|
|
|
let color = parseInt(entity.getVariable("blipColor"));
|
|
|
|
mp.gui.chat.push("Color : " + color);
|
|
|
|
entity.createBlip(1);
|
|
|
|
mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created");
|
|
|
|
mp.gui.chat.push("entity.blip is actually " + entity.blip);
|
|
var blip = mp.blips.at(entity.blip);
|
|
|
|
blip.dimension = entityMp.dimension;
|
|
|
|
mp.gui.chat.push("1 -" + blip.getAlpha() + " 2- " + blip.doesExist() + " 3-" + blip.dimension + " 4-" + entityMp.dimension);
|
|
|
|
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);
|
|
mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true);
|
|
//mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8);
|
|
|
|
}
|
|
});
|
|
*/
|
|
|
|
|
|
|
|
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.");
|
|
}
|
|
});
|
|
} |