Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. addEventHandler("onClientHUDRender", getRootElement(), function()
  2.     for k,v in ipairs (getElementsByType("player")) do
  3.         if v ~= localPlayer then
  4.             local lx,ly,lz = getPedBonePosition(localPlayer,8)
  5.             local x,y,z = getPedBonePosition(v,8)
  6.                     if getDistanceBetweenPoints3D(lx,ly,lz,x,y,z) < 30 then
  7.                         if isLineOfSightClear(x,y,z+1,lx, ly, lz+1) == true then
  8.                                 local x1,y1 = getScreenFromWorldPosition(x,y,z+0.5)
  9.                                 local x2,y2 = getScreenFromWorldPosition(x,y,z+0.4)
  10.                                 local x3,y3 = getScreenFromWorldPosition(x,y,z+0.6)
  11.                                 if x1 and y1 and x2 and y2 and x3 and y3 then
  12.                                             dxDrawText (getPlayerName(v),x1,y1,x1,y1,tocolor(255,255,255,255),2,"default-bold","center")   
  13.                                             dxDrawRectangle(x2-100,y2,200,25, tocolor(0,0,0,150))
  14.                                             dxDrawRectangle(x2-98,y2+2,196/100*getElementHealth(v),21, tocolor(200,20,20,150))
  15.                                             dxDrawText ("Owner/Leader",x3,y3,x3,y3,tocolor(255,60,0,255),2,"default-bold","center")
  16.                                 end
  17.                         end
  18.                     end
  19.         end    
  20.     end    
  21.  
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement