Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. local TeleportFromTo = {
  2.  
  3. ["Paleto Station"] = {
  4. positionFrom = { ['x'] = -1388.68, ['y'] = -586.571, ['z'] = 30.2193, nom = "gå in i ~p~Bahamas NightClub"},
  5. positionTo = { ['x'] = -1387.78, ['y'] = -587.997, ['z'] = 30.3195 , nom = "gå ut ur ~p~Bahamas NightClub"},
  6. },
  7.  
  8. ["Fängelset till visionsrumt"] = {
  9. positionFrom = { ['x'] = 1800.58, ['y'] = 2484.0, ['z'] = -122.703, nom = "Gå till ~o~Visionsrumet"},
  10. positionTo = { ['x'] = 1699.77, ['y'] = 2574.71, ['z'] = -69.4028 , nom = "Gå tillbaks till ~r~Fängelset"},
  11. },
  12.  
  13. ["poslit stationen till visionsrum"] = {
  14. positionFrom = { ['x'] = 464.902, ['y'] = -989.983, ['z'] = 24.9149, nom = "Gå till ~b~Visionsrumet"},
  15. positionTo = { ['x'] = 1706.07, ['y'] = 2580.94, ['z'] = -69.4113, nom = "Gå tillbaks till ~b~polis stationen"},
  16. },
  17.  
  18. ["Mafia huset"] = {
  19. positionFrom = { ['x'] = -1805.07, ['y'] = 437.524, ['z'] = 128.708, nom = "Gå in i huset"},
  20. positionTo = { ['x'] = -859.801, ['y'] = 690.8, ['z'] = 152.861, nom = "Gå ut till utsidan"},
  21. },
  22. ["Arbetslagret"] = {
  23. positionFrom = { ['x'] = 1800.60, ['y'] = 2482.46, ['z'] = -122.689, nom = "Gå till ~p~Arbetslagret"},
  24. positionTo = { ['x'] = 997.169, ['y'] = -3200.709, ['z'] = -36.393, nom = "Gå tillbaks till ~r~Fängelset"},
  25. },
  26. --["Arbetslagret"] = {
  27. --positionFrom = { ['x'] = 1800.60, ['y'] = 2482.46, ['z'] = -122.689, nom = "Gå till ~p~Arbetslagret"},
  28. --positionTo = { ['x'] = 1048.204, ['y'] = -3097.105, ['z'] = -38.999, nom = "Gå tillbaks till ~r~Fängelset"},
  29. --},
  30. ["Arlanda flygplats"] = {
  31. positionFrom = { ['x'] = -1044.98, ['y'] = -2750.04, ['z'] = 21.3634, nom = "För att borda ~o~Planet"},
  32. positionTo = { ['x'] = -1275.74, ['y'] = -2701.59, ['z'] = 20.82, nom = "Gå ut till ~o~utsidan"},
  33. },
  34.  
  35. }
  36.  
  37. Drawing = setmetatable({}, Drawing)
  38. Drawing.__index = Drawing
  39.  
  40.  
  41. function Drawing.draw3DText(x,y,z,textInput,fontId,scaleX,scaleY,r, g, b, a)
  42. local px,py,pz=table.unpack(GetGameplayCamCoords())
  43. local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
  44.  
  45. local scale = (1/dist)*10
  46. local fov = (1/GetGameplayCamFov())*100
  47. local scale = scale*fov
  48.  
  49. SetTextScale(scaleX*scale, scaleY*scale)
  50. SetTextFont(fontId)
  51. SetTextProportional(1)
  52. SetTextColour(r, g, b, a)
  53. SetTextDropshadow(0, 0, 0, 0, 255)
  54. SetTextEdge(2, 0, 0, 0, 150)
  55. SetTextDropShadow()
  56. SetTextOutline()
  57. SetTextEntry("STRING")
  58. SetTextCentre(1)
  59. AddTextComponentString(textInput)
  60. SetDrawOrigin(x,y,z+2, 0)
  61. DrawText(0.0, 0.0)
  62. ClearDrawOrigin()
  63. end
  64.  
  65. function Drawing.drawMissionText(m_text, showtime)
  66. ClearPrints()
  67. SetTextEntry_2("STRING")
  68. AddTextComponentString(m_text)
  69. DrawSubtitleTimed(showtime, 1)
  70. end
  71.  
  72. function msginf(msg, duree)
  73. duree = duree or 500
  74. ClearPrints()
  75. SetTextEntry_2("STRING")
  76. AddTextComponentString(msg)
  77. DrawSubtitleTimed(duree, 1)
  78. end
  79.  
  80. Citizen.CreateThread(function()
  81. while true do
  82. Citizen.Wait(2)
  83. local pos = GetEntityCoords(GetPlayerPed(-1), true)
  84.  
  85. for k, j in pairs(TeleportFromTo) do
  86.  
  87. --msginf(k .. " " .. tostring(j.positionFrom.x), 15000)
  88. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 150.0)then
  89. 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)
  90. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 5.0)then
  91. 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)
  92. if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 2.0)then
  93. ClearPrints()
  94. SetTextEntry_2("STRING")
  95. AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionFrom.nom)
  96. DrawSubtitleTimed(1, 1)
  97. if IsControlJustPressed(1, 38) then
  98. DoScreenFadeOut(3000)
  99. Citizen.Wait(5000)
  100. SetEntityCoords(GetPlayerPed(-1), j.positionTo.x, j.positionTo.y, j.positionTo.z - 1)
  101. DoScreenFadeIn(2000)
  102. end
  103. end
  104. end
  105. end
  106.  
  107. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 150.0)then
  108. 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)
  109. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 5.0)then
  110. 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)
  111. if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 2.0)then
  112. ClearPrints()
  113. SetTextEntry_2("STRING")
  114. AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionTo.nom)
  115. DrawSubtitleTimed(1, 1)
  116. if IsControlJustPressed(1, 38) then
  117. DoScreenFadeOut(3000)
  118. Citizen.Wait(5000)
  119. SetEntityCoords(GetPlayerPed(-1), j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1)
  120. DoScreenFadeIn(2000)
  121. end
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement