Guest User

Untitled

a guest
Dec 13th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. addEventHandler( "onClientRender",getRootElement(), function()
  2.     for i, element in ipairs ( getElementsByType("object") ) do
  3.         if isElement(element) and getElementData(element, "itemName") then
  4.             local wx,wy,wz = getElementPosition(element)
  5.             local text = getElementData(element, "itemName")
  6.             local x,y,z = getScreenFromWorldPosition ( wx, wy, wz + 2 )
  7.             local width = dxGetTextWidth ( text )
  8.             local px,py,pz = getElementPosition(localPlayer)
  9.             local entf = getDistanceBetweenPoints3D (px,py,pz, wx,wy,wz )
  10.             if entf <= 5 then
  11.                 dxDrawText ( text, x, y, x, y, tocolor ( 0, 255, 0), 2, "arial" )
  12.                 outputDebugString("Drawing")
  13.             end
  14.         end
  15.     end
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment