From ab7f5465db5e92ccc9cb850167e13b181afb6124 Mon Sep 17 00:00:00 2001 From: hydrant Date: Thu, 15 Apr 2021 13:26:21 +0200 Subject: [PATCH] =?UTF-8?q?afk=20text=20=C3=BCber=20kopf=20wenn=20afk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReallifeGamemode.Client/Gui/nametags.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 7fee2fc4..97fd1cc5 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -29,7 +29,7 @@ const colors = [ export default function customNametags() { mp.nametags.enabled = false; - mp.events.add('render', (nametags) => { + mp.events.add(RageEnums.EventKey.RENDER, (nametags) => { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); @@ -51,7 +51,13 @@ export default function customNametags() { 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, color: [color[0], color[1], color[2], color[3]],