Nametagcolors

This commit is contained in:
VegaZ
2021-04-04 02:45:25 +02:00
parent 5e078b7276
commit b7f9c97dc4
3 changed files with 18 additions and 5 deletions

View File

@@ -4,11 +4,18 @@ const height = 0.0065;
const border = 0.001;
const color = [73, 137, 0, 255];
var faction;
var playerColors = [];
export default function customNametags() {
mp.nametags.enabled = false;
mp.events.addDataHandler("nameTagColor", (entity, value) => {
if (entity.type === "player") {
entity.setVariable('nametagColor', value)
}
});
mp.events.add('render', (nametags) => {
const graphics = mp.game.graphics;
const screenRes = graphics.getScreenResolution(0, 0);
@@ -26,11 +33,10 @@ export default function customNametags() {
var armour = player.getArmour() / 100;
y -= scale * (0.005 * (screenRes.y / 1080));
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
{
font: 4,
color: [255, 255, 255, 255], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255
color: player.data.nametagColor, //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255
scale: [0.4, 0.4],
outline: true,
centre: false