ZernaxLeDozo

Untitled

Jun 20th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. local showPlayerBlips = false
  2. local ignorePlayerNameDistance = true
  3. local playerNamesDist = 10
  4. local displayIDHeight = 1.5 --Height of ID above players head(starts at center body mass)
  5. --Set Default Values for Colors
  6. local red = 255
  7. local green = 255
  8. local blue = 255
  9.  
  10. function DrawText3D(x,y,z, text)
  11. local onScreen,_x,_y=World3dToScreen2d(x,y,z)
  12. local px,py,pz=table.unpack(GetGameplayCamCoords())
  13. local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
  14.  
  15. local scale = (1/dist)*2
  16. local fov = (1/GetGameplayCamFov())*100
  17. local scale = scale*fov
  18.  
  19. if onScreen then
  20. SetTextScale(0.0*scale, 0.55*scale)
  21. SetTextFont(0)
  22. SetTextProportional(1)
  23. SetTextColour(red, green, blue, 255)
  24. SetTextDropshadow(0, 0, 0, 0, 255)
  25. SetTextEdge(2, 0, 0, 0, 150)
  26. SetTextDropShadow()
  27. SetTextOutline()
  28. SetTextEntry("STRING")
  29. SetTextCentre(1)
  30. AddTextComponentString(text)
  31. World3dToScreen2d(x,y,z, 0) --Added Here
  32. DrawText(_x,_y)
  33. end
  34. end
  35.  
  36. Citizen.CreateThread(function()
  37. while true do
  38. for i=0,99 do
  39. N_0x31698aa80e0223f8(i)
  40. end
  41. for id = 0, 31 do
  42. if ((NetworkIsPlayerActive( id )) and GetPlayerPed( id ) ~= GetPlayerPed( -1 )) then
  43. ped = GetPlayerPed( id )
  44. blip = GetBlipFromEntity( ped )
  45.  
  46. x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
  47. x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
  48. distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true))
  49.  
  50. if(ignorePlayerNameDistance) then
  51. if NetworkIsPlayerTalking(id) then
  52. red = 0
  53. green = 0
  54. blue = 255
  55. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  56. else
  57. red = 255
  58. green = 255
  59. blue = 255
  60. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  61. end
  62. end
  63.  
  64. if ((distance < playerNamesDist)) then
  65. if not (ignorePlayerNameDistance) then
  66. if NetworkIsPlayerTalking(id) then
  67. red = 0
  68. green = 0
  69. blue = 255
  70. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  71. else
  72. red = 255
  73. green = 255
  74. blue = 255
  75. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  76. end
  77. end
  78. end
  79. end
  80. end
  81. Citizen.Wait(0)
  82. end
  83. end)
Advertisement
Add Comment
Please, Sign In to add comment