Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. local showPlayerBlips = false
  2. local ignorePlayerNameDistance = false
  3. local playerNamesDist = 15
  4. local displayIDHeight = 1.5
  5. local red = 255
  6. local green = 255
  7. local blue = 255
  8. function DrawText3D(x,y,z, text)
  9. local onScreen,_x,_y=World3dToScreen2d(x,y,z)
  10. local px,py,pz=table.unpack(GetGameplayCamCoords())
  11. local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
  12. local scale = (1/dist)*2
  13. local fov = (1/GetGameplayCamFov())*100
  14. local scale = scale*fov
  15. if onScreen then
  16. SetTextScale(0.0*scale, 1.55*scale)
  17. SetTextFont(0)
  18. SetTextProportional(1)
  19. SetTextColour(red, green, blue, 255)
  20. SetTextDropshadow(0, 0, 0, 0, 255)
  21. SetTextEdge(2, 0, 0, 0, 150)
  22. SetTextDropShadow()
  23. SetTextOutline()
  24. SetTextEntry("STRING")
  25. SetTextCentre(1)
  26. AddTextComponentString(text)
  27. World3dToScreen2d(x,y,z, 0)
  28. DrawText(_x,_y)
  29. end
  30. end
  31. Citizen.CreateThread(function()
  32. while true do
  33. Citizen.Wait(0)
  34. if IsControlJustReleased(0,48) then
  35. showPlayersId = false
  36. Citizen.Wait(2000)
  37. end
  38. if IsControlJustPressed(0,48) then
  39. showPlayersId = true
  40. end
  41.  
  42. end
  43. end)
  44.  
  45. size = 0.5
  46. Citizen.CreateThread(function()
  47. while true do
  48.  
  49. if showPlayersId then
  50.  
  51. for i=0,99 do
  52. N_0x31698aa80e0223f8(i)
  53. end
  54. for id = 0, 255 do
  55. if ((NetworkIsPlayerActive( id )) and GetPlayerPed( id ) ~= GetPlayerPed( -1 )) then
  56. ped = GetPlayerPed( id )
  57. blip = GetBlipFromEntity( ped )
  58. x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) )
  59. x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
  60. distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true))
  61. if GetPlayerName(id)=='Zielu' then
  62. --
  63. else
  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. end
  82. end
  83. Citizen.Wait(0)
  84. end
  85. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement