Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. Drawing = setmetatable({}, Drawing)
  2. Drawing.__index = Drawing
  3.  
  4.  
  5. function Drawing.draw3DText(x,y,z,textInput,fontId,scaleX,scaleY,r, g, b, a)
  6. local px,py,pz=table.unpack(GetGameplayCamCoords())
  7. local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
  8.  
  9. local scale = (1/dist)*10
  10. local fov = (1/GetGameplayCamFov())*100
  11. local scale = scale*fov
  12.  
  13. SetTextScale(scaleX*scale, scaleY*scale)
  14. SetTextFont(fontId)
  15. SetTextProportional(1)
  16. SetTextColour(r, g, b, a)
  17. SetTextDropshadow(0, 0, 0, 0, 255)
  18. SetTextEdge(2, 0, 0, 0, 150)
  19. SetTextDropShadow()
  20. SetTextOutline()
  21. SetTextEntry("STRING")
  22. SetTextCentre(1)
  23. AddTextComponentString(textInput)
  24. SetDrawOrigin(x,y,z+2, 0)
  25. DrawText(0.0, 0.0)
  26. ClearDrawOrigin()
  27. end
  28.  
  29. function Drawing.drawMissionText(m_text, showtime)
  30. ClearPrints()
  31. SetTextEntry_2("STRING")
  32. AddTextComponentString(m_text)
  33. DrawSubtitleTimed(showtime, 1)
  34. end
  35.  
  36. function msginf(msg, duree)
  37. duree = duree or 500
  38. ClearPrints()
  39. SetTextEntry_2("STRING")
  40. AddTextComponentString(msg)
  41. DrawSubtitleTimed(duree, 1)
  42. end
  43.  
  44. Citizen.CreateThread(function()
  45. while true do
  46. Citizen.Wait(2)
  47. local pos = GetEntityCoords(GetPlayerPed(-1), true)
  48.  
  49. for k, j in pairs(TeleportFromTo) do
  50.  
  51. --msginf(k .. " " .. tostring(j.positionFrom.x), 15000)
  52. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 150.0)then
  53. DrawMarker(1, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, .401, 30, 120, 230,255, 0, 0, 0,0)
  54. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 5.0)then
  55. Drawing.draw3DText(j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1.100, j.positionFrom.nom, 1, 0.2, 0.1, 255, 255, 255, 215)
  56. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 2.0)then
  57. ClearPrints()
  58. SetTextEntry_2("STRING")
  59. AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionFrom.nom)
  60. DrawSubtitleTimed(1, 1)
  61. if IsControlJustPressed(1, 38) then
  62. DoScreenFadeOut(3000)
  63. Citizen.Wait(5000)
  64. SetEntityCoords(GetPlayerPed(-1), j.positionTo.x, j.positionTo.y, j.positionTo.z - 1)
  65. DoScreenFadeIn(2000)
  66. end
  67. end
  68. end
  69. end
  70.  
  71. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 150.0)then
  72. DrawMarker(1, j.positionTo.x, j.positionTo.y, j.positionTo.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, .401, 30, 120, 230,255, 0, 0, 0,0)
  73. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 5.0)then
  74. Drawing.draw3DText(j.positionTo.x, j.positionTo.y, j.positionTo.z - 1.100, j.positionTo.nom, 1, 0.2, 0.2, 255, 255, 255, 215)
  75. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 2.0)then
  76. ClearPrints()
  77. SetTextEntry_2("STRING")
  78. AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionTo.nom)
  79. DrawSubtitleTimed(1, 1)
  80. if IsControlJustPressed(1, 38) then
  81. DoScreenFadeOut(3000)
  82. Citizen.Wait(5000)
  83. SetEntityCoords(GetPlayerPed(-1), j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1)
  84. DoScreenFadeIn(2000)
  85. end
  86. end
  87. end
  88. end
  89. end
  90. end
  91. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement