Advertisement
Guest User

Untitled

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