Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. local showPlayerBlips = false
  2. local ignorePlayerNameDistance = false
  3. local playerNamesDist = 15
  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. Citizen.Wait(0)
  39. if IsControlPressed(1, 48) then
  40. for i=0,99 do
  41. N_0x31698aa80e0223f8(i)
  42. end
  43.  
  44. local text = 'Is looking into your soul'
  45. TriggerServerEvent('3dme:shareDisplay', text)
  46.  
  47. for id = 0, 31 do
  48. if ((NetworkIsPlayerActive( id )) and GetPlayerPed( id ) ~= GetPlayerPed( -1 )) then
  49. ped = GetPlayerPed( id )
  50. blip = GetBlipFromEntity( ped )
  51.  
  52. x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
  53. x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
  54. distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true))
  55.  
  56. if(ignorePlayerNameDistance) then
  57. if NetworkIsPlayerTalking(id) then
  58. red = 0
  59. green = 0
  60. blue = 255
  61. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  62. else
  63. red = 255
  64. green = 255
  65. blue = 255
  66. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  67. end
  68. end
  69.  
  70. if ((distance < playerNamesDist)) then
  71. if not (ignorePlayerNameDistance) then
  72. if NetworkIsPlayerTalking(id) then
  73. red = 0
  74. green = 0
  75. blue = 255
  76. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  77. else
  78. red = 255
  79. green = 255
  80. blue = 255
  81. DrawText3D(x2, y2, z2 + displayIDHeight, GetPlayerServerId(id))
  82. end
  83. end
  84. end
  85. end
  86. end
  87. elseif not IsControlPressed(1, 48) then
  88. DrawText3D(0, 0, 0, "")
  89. end
  90. end
  91. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement