local distmax = 30
local width = 50
local hight = 50
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 = getDistanceBetweenPoints3D ( tx, ty, tz, px, py, pz )
if dist < distmax then
if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false ) then
local sx, sy, sz = getPedBonePosition( v, 5 )
local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 )
local w = width
local h = hight
local class = getElementData(v, "reputation.class")
if x and y and w and h then
dxDrawImage ( x, y, h, w, ":reputation/class/classicon_"..class..".png", 0, 0, 0, tocolor(255, 255, 255), false )
end
end
end
end
end
)