Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TeleportFromTo = {
- ["Paleto Station"] = {
- positionFrom = { ['x'] = -1388.68, ['y'] = -586.571, ['z'] = 30.2193, nom = "gå in i ~p~Bahamas NightClub"},
- positionTo = { ['x'] = -1387.78, ['y'] = -587.997, ['z'] = 30.3195 , nom = "gå ut ur ~p~Bahamas NightClub"},
- },
- ["Fängelset till visionsrumt"] = {
- positionFrom = { ['x'] = 1800.58, ['y'] = 2484.0, ['z'] = -122.703, nom = "Gå till ~o~Visionsrumet"},
- positionTo = { ['x'] = 1699.77, ['y'] = 2574.71, ['z'] = -69.4028 , nom = "Gå tillbaks till ~r~Fängelset"},
- },
- ["poslit stationen till visionsrum"] = {
- positionFrom = { ['x'] = 464.902, ['y'] = -989.983, ['z'] = 24.9149, nom = "Gå till ~b~Visionsrumet"},
- positionTo = { ['x'] = 1706.07, ['y'] = 2580.94, ['z'] = -69.4113, nom = "Gå tillbaks till ~b~polis stationen"},
- },
- ["Mafia huset"] = {
- positionFrom = { ['x'] = -1805.07, ['y'] = 437.524, ['z'] = 128.708, nom = "Gå in i huset"},
- positionTo = { ['x'] = -859.801, ['y'] = 690.8, ['z'] = 152.861, nom = "Gå ut till utsidan"},
- },
- ["Arbetslagret"] = {
- positionFrom = { ['x'] = 1800.60, ['y'] = 2482.46, ['z'] = -122.689, nom = "Gå till ~p~Arbetslagret"},
- positionTo = { ['x'] = 997.169, ['y'] = -3200.709, ['z'] = -36.393, nom = "Gå tillbaks till ~r~Fängelset"},
- },
- --["Arbetslagret"] = {
- --positionFrom = { ['x'] = 1800.60, ['y'] = 2482.46, ['z'] = -122.689, nom = "Gå till ~p~Arbetslagret"},
- --positionTo = { ['x'] = 1048.204, ['y'] = -3097.105, ['z'] = -38.999, nom = "Gå tillbaks till ~r~Fängelset"},
- --},
- ["Arlanda flygplats"] = {
- positionFrom = { ['x'] = -1044.98, ['y'] = -2750.04, ['z'] = 21.3634, nom = "För att borda ~o~Planet"},
- positionTo = { ['x'] = -1275.74, ['y'] = -2701.59, ['z'] = 20.82, nom = "Gå ut till ~o~utsidan"},
- },
- }
- Drawing = setmetatable({}, Drawing)
- Drawing.__index = Drawing
- function Drawing.draw3DText(x,y,z,textInput,fontId,scaleX,scaleY,r, g, b, a)
- local px,py,pz=table.unpack(GetGameplayCamCoords())
- local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
- local scale = (1/dist)*10
- local fov = (1/GetGameplayCamFov())*100
- local scale = scale*fov
- SetTextScale(scaleX*scale, scaleY*scale)
- SetTextFont(fontId)
- SetTextProportional(1)
- SetTextColour(r, g, b, a)
- SetTextDropshadow(0, 0, 0, 0, 255)
- SetTextEdge(2, 0, 0, 0, 150)
- SetTextDropShadow()
- SetTextOutline()
- SetTextEntry("STRING")
- SetTextCentre(1)
- AddTextComponentString(textInput)
- SetDrawOrigin(x,y,z+2, 0)
- DrawText(0.0, 0.0)
- ClearDrawOrigin()
- end
- function Drawing.drawMissionText(m_text, showtime)
- ClearPrints()
- SetTextEntry_2("STRING")
- AddTextComponentString(m_text)
- DrawSubtitleTimed(showtime, 1)
- end
- function msginf(msg, duree)
- duree = duree or 500
- ClearPrints()
- SetTextEntry_2("STRING")
- AddTextComponentString(msg)
- DrawSubtitleTimed(duree, 1)
- end
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(2)
- local pos = GetEntityCoords(GetPlayerPed(-1), true)
- for k, j in pairs(TeleportFromTo) do
- --msginf(k .. " " .. tostring(j.positionFrom.x), 15000)
- if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 150.0)then
- 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)
- if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 5.0)then
- 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)
- if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 2.0)then
- ClearPrints()
- SetTextEntry_2("STRING")
- AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionFrom.nom)
- DrawSubtitleTimed(1, 1)
- if IsControlJustPressed(1, 38) then
- DoScreenFadeOut(3000)
- Citizen.Wait(5000)
- SetEntityCoords(GetPlayerPed(-1), j.positionTo.x, j.positionTo.y, j.positionTo.z - 1)
- DoScreenFadeIn(2000)
- end
- end
- end
- end
- if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 150.0)then
- 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)
- if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 5.0)then
- 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)
- if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 2.0)then
- ClearPrints()
- SetTextEntry_2("STRING")
- AddTextComponentString("Tryck ~r~[E]~w~ för att ".. j.positionTo.nom)
- DrawSubtitleTimed(1, 1)
- if IsControlJustPressed(1, 38) then
- DoScreenFadeOut(3000)
- Citizen.Wait(5000)
- SetEntityCoords(GetPlayerPed(-1), j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1)
- DoScreenFadeIn(2000)
- end
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement