afk text über kopf wenn afk

This commit is contained in:
hydrant
2021-04-15 13:26:21 +02:00
parent 3a37e4683c
commit ab7f5465db

View File

@@ -29,7 +29,7 @@ const colors = [
export default function customNametags() { export default function customNametags() {
mp.nametags.enabled = false; mp.nametags.enabled = false;
mp.events.add('render', (nametags) => { mp.events.add(RageEnums.EventKey.RENDER, (nametags) => {
const graphics = mp.game.graphics; const graphics = mp.game.graphics;
const screenRes = graphics.getScreenResolution(0, 0); const screenRes = graphics.getScreenResolution(0, 0);
@@ -51,7 +51,13 @@ export default function customNametags() {
let color = colors.find(c => c.id === colorId).color; let color = colors.find(c => c.id === colorId).color;
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], let nametagText = player.name + " (" + player.remoteId + ")";
if (player.getVariable("isAfk")) {
nametagText += " ~r~AFK";
}
mp.game.graphics.drawText(nametagText, [x, y],
{ {
font: 4, font: 4,
color: [color[0], color[1], color[2], color[3]], color: [color[0], color[1], color[2], color[3]],