---- DISPLAY ID -----
local disPlayerNames = 5
local playerDistances = {}
local showID = true
local function DrawText3D(x,y,z, text, r,g,b)
local onScreen,_x,_y=World3dToScreen2d(x,y,z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
local dist = #(vector3(px,py,pz)-vector3(x,y,z))
local scale = (1/dist)*2
local fov = (1/GetGameplayCamFov())*100
local scale = scale*fov
if onScreen then
if not useCustomScale then
SetTextScale(0.0*scale, 0.55*scale)
else
SetTextScale(0.0*scale, customScale)
end
SetTextFont(0)
SetTextProportional(1)
SetTextColour(r, g, b, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
end
end
Citizen.CreateThread(function()
Wait(500)
while true do
Citizen.Wait(0)
if showID then
for _, id in ipairs(GetActivePlayers()) do
if GetPlayerPed(id) ~= GetPlayerPed(-1) then
if playerDistances[id] then
if (playerDistances[id] < disPlayerNames) then
x2, y2, z2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
if NetworkIsPlayerTalking(id) then
DrawText3D(x2, y2, z2+1, GetPlayerServerId(id), 65,65,65)
else
DrawText3D(x2, y2, z2+1, GetPlayerServerId(id), 255,255,255)
end
elseif (playerDistances[id] < 25) then
x2, y2, z2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
if NetworkIsPlayerTalking(id) then
end
end
end
end
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if showID then
for _, id in ipairs(GetActivePlayers()) do
if GetPlayerPed(id) ~= GetPlayerPed(-1) then
x1, y1, z1 = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
x2, y2, z2 = table.unpack(GetEntityCoords(GetPlayerPed(id), true))
distance = math.floor(#(vector3(x1, y1, z1)-vector3(x2, y2, z2)))
playerDistances[id] = distance
end
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustReleased(0, Keys["F9"]) then ----- WHAT KEY ARE WE GOING TO USE FOR THIS FUNCTION?
showID = not showID
PlaySound(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0, 0, 1)
if showID then
exports['mythic_notify']:SendAlert('inform', 'GOV IDS ON', 2500, { ['background-color'] = '#29a30d', ['color'] = '#ffffff' })
else exports['mythic_notify']:SendAlert('inform', 'GOV IDS OFF', 2500, { ['background-color'] = '#ff0000', ['color'] = '#ffffff' })
end
end
end
end)
add that to any client side script you have, hit F9 should do everything else for you. Does utilize mythic notify. Enjoy!