Hi Guys,
I’m currently trying to write a nametag system for the Aduty. Everything works perfectly.
Now I just tried to display the Job.Label from the player on the nametag. However, it shows the Job.Label from the admin that has the nametag. Can someone tell me what I’m doing wrong?
Citizen.CreateThread(function()
while true do
if Player.showName then
for k, v in ipairs(ESX.Game.GetPlayers()) do
local otherPed = GetPlayerPed(v)
local playerdatara = ESX.GetPlayerData(v)
if otherPed ~= plyPed then
if #(GetEntityCoords(plyPed, false) - GetEntityCoords(otherPed, false)) < 1000.0 then
Player.gamerTags[v] = CreateFakeMpGamerTag(otherPed,("%s [%s] [%s]"):format(playerdatara.job.label ,GetPlayerServerId(v), GetPlayerName(v)), false, false, "", 0)
else
RemoveMpGamerTag(Player.gamerTags[v])
Player.gamerTags[v] = nil
end
end
end
end
Citizen.Wait(100)
end
end)
This is the Code