Jump to content

NameTags


adil nawaz

Recommended Posts

addEventHandler( "onClientRender",root,

function( )

local px, py, pz, tx, ty, tz, dist

px, py, pz = getCameraMatrix( )

for _, v in ipairs( getElementsByType 'player' ) do

tx, ty, tz = getElementPosition( v )

dist = math.sqrt( ( px - tx ) ^ 0 + ( py - ty ) ^ 0 + ( pz - tz ) ^ 0 )

if dist < 30.0 then

if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then

local sx, sy, sz = getPedBonePosition( v, 6 )

local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 )

local playerR, playerG, playerB = getPlayerNametagColor ( localPlayer )

local Level = getElementData(localPlayer,"Level") or 0

if x then

dxDrawText( string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ).."", x, y, x, y, tocolor(playerR, playerG, playerB), 0.80 + ( 15 - dist ) * 0.02, "default-bold" )

end

end

end

end

end

)

________________________

any body help me in this to add Icon to the nametags? Not it chatbox. On player head.

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...