Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------
- -- Prison Teleporter
- ------------------------
- local TeleportFromTo = {
- ["Sandy Station"] = {
- positionFrom = { ['x'] = 1851.12, ['y'] = 3683.30, ['z'] = 34.32, nom = "enter the holding cells"},
- positionTo = { ['x'] = 1849.465, ['y'] = 3682.871, ['z'] = -118.76, nom = "exit the holding cells"},
- },
- ["Paleto Station"] = {
- positionFrom = { ['x'] = -442.352, ['y'] = 6012.365, ['z'] = 31.76, nom = "enter the holding cells"},
- positionTo = { ['x'] = -441.880, ['y'] = 6010.498, ['z'] = -118.761 , nom = "exit the holding cells"},
- },
- }
- 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)*20
- 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, .801, 255, 187, 51,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()
- --AddTextComponentString("Press ~r~E~w~ to ".. j.positionFrom.nom)
- DisplayNotification("Press ~INPUT_PICKUP~ to " .. j.positionFrom.nom)
- DrawSubtitleTimed(2000, 1)
- if IsControlJustPressed(1, 38) then
- for i=1,#leoSkins do
- if GetEntityModel(PlayerPedId()) == GetHashKey(leoSkins[i]) then
- DoScreenFadeOut(1000)
- Citizen.Wait(2000)
- SetEntityCoords(GetPlayerPed(-1), j.positionTo.x, j.positionTo.y, j.positionTo.z - 1)
- DoScreenFadeIn(1000)
- else
- drawNotification("~r~Authorised personnel only!")
- end
- end
- 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, .801, 255, 187, 51,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.1, 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()
- DisplayNotification("Press ~INPUT_PICKUP~ to " .. j.positionTo.nom)
- DrawSubtitleTimed(2000, 1)
- if IsControlJustPressed(1, 38) then
- DoScreenFadeOut(1000)
- Citizen.Wait(2000)
- SetEntityCoords(GetPlayerPed(-1), j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1)
- DoScreenFadeIn(1000)
- end
- end
- end
- end
- end
- end
- end)
- ------------------------
- -- Prison Teleporter
- ------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement