Are you sure about the positions of text?
For me, it works perfectly
yea i am sure and it still not working idk why..
sx,sy = guiGetScreenSize()
textsToDraw = {}
maxrange = 20
function NPCnametag()
end
addEventHandler("onClientRender",root,
function()
for a,b in pairs(textsToDraw) do
x,y,z = b[1],b[2],b[3]
scx,scy = getScreenFromWorldPosition (x,y,z)
camX,camY,camZ = getCameraMatrix()
if scx and scy and getDistanceBetweenPoints3D(camX,camY,camZ,x,y,z+5) <= maxrange then
dxDrawFramedText(b[4],scx-0.5*dxGetTextWidth(b[4],0.30,"pricedown"),scy+30-0.5*dxGetFontHeight(0.30,"pricedown"),sx, sy+5,tocolor ( b[5], b[6], b[7], 255 ), 0.80,"pricedown")
end
end
end
)
function add3DText(x,y,z,text,r,g,b)
table.insert(textsToDraw,{x,y,z,text,r,g,b})
end
function dxDrawFramedText ( message , left , top , width , height , color , scale , font , alignX , alignY , clip , wordBreak , postGUI , frameColor )
color = color or tocolor ( 255 , 255 , 255 , 255 )
frameColor = frameColor or tocolor ( 0 , 0 , 0 , 255 )
scale = scale or 1
alignX = alignX or "left"
alignY = alignY or "top"
clip = clip or false
wordBreak = wordBreak or false
postGUI = postGUI or false
dxDrawText ( message , left + 1 , top + 1 , width + 1 , height + 1 , frameColor , scale , 5 , alignX , alignY , clip , wordBreak , postGUI )
dxDrawText ( message , left + 1 , top - 1 , width + 1 , height - 1 , frameColor , scale , 5 , alignX , alignY , clip , wordBreak , postGUI )
dxDrawText ( message , left - 1 , top + 1 , width - 1 , height + 1 , frameColor , scale , 5 , alignX , alignY , clip , wordBreak , postGUI )
dxDrawText ( message , left - 1 , top - 1 , width - 1 , height - 1 , frameColor , scale , 5 , alignX , alignY , clip , wordBreak , postGUI )
dxDrawText ( message , left , top , width , height , color , scale , font , alignX , alignY , clip , wordBreak , postGUI )
end
add3DText( -1624.6945800781,666.45471191406,8.1875, "Police", 6, 183, 248 )
Whats wrong on this?