Nametagcolors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user