i found a TP stipt and it works fine except the vehicle TP, anyone able to help out with why?
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if not IsEntityDead(PlayerPedId(-1)) then
for k,v in pairs(Config.locations) do
local ix,iy,iz = table.unpack(v["markin"])
local ox,oy,oz = table.unpack(v["markout"])
if GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), ix, iy, iz, true) < 50.5999 then -- Outside Marker
DrawMarker(2, ix,iy,iz, 0.0, 0.0, 0.0, 180.0, 0.0, 0.0, 0.75, 0.75, 0.75, 255, 255, 0, 100, false, true, 2, false, false, false, false)
if GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), ix, iy, iz, true) < 1.0 then
if k == "Doomsday Facility" then
if IsPedInVehicle(PlayerPedId(), GetVehiclePedIsIn(PlayerPedId(), false), false) then
FreezeEntityPosition(GetVehiclePedIsIn(PlayerPedId(), false), true)
TeleportIntoInteriorVehicle(v["locin"], false)
SpawnFacility()
else
FreezeEntityPosition(PlayerPedId(), true)
SpawnFacility()
TeleportIntoInterior(v["locin"], false)
end
elseif k == "Doomsday Finale" then
if IsPedInVehicle(PlayerPedId(), GetVehiclePedIsIn(PlayerPedId(), false), false) then
FreezeEntityPosition(GetVehiclePedIsIn(PlayerPedId(), false), true)
TeleportIntoInteriorVehicle(v["locin"], false)
else
FreezeEntityPosition(PlayerPedId(), true)
TeleportIntoInterior(v["locin"], false)
end
else
FreezeEntityPosition(PlayerPedId(), true)
TeleportIntoInterior(v["locin"], false)
end
end
end
if GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), ox, oy, oz, true) < 50.5999 then -- Inside Marker
DrawMarker(2, ox, oy, oz, 0.0, 0.0, 0.0, 180.0, 0.0, 0.0, 0.75, 0.75, 0.75, 255, 255, 0, 100, false, true, 2, false, false, false, false)
if GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), ox, oy, oz, true) < 1.0 then
if k == "Doomsday Facility" then
if IsPedInVehicle(PlayerPedId(), GetVehiclePedIsIn(PlayerPedId(), false), false) then
FreezeEntityPosition(GetVehiclePedIsIn(PlayerPedId(), false), true)
TeleportIntoInteriorVehicle(v["locout"], false)
DespawnFacility()
else
FreezeEntityPosition(PlayerPedId(), true)
TeleportIntoInterior(v["locout"], false)
DespawnFacility()
end
elseif k == "Doomsday Finale" then
if IsPedInVehicle(PlayerPedId(), GetVehiclePedIsIn(PlayerPedId(), false), false) then
FreezeEntityPosition(GetVehiclePedIsIn(PlayerPedId(), false), true)
TeleportIntoInteriorVehicle(v["locout"], false)
else
FreezeEntityPosition(PlayerPedId(), true)
TeleportIntoInterior(v["locout"], false)
end
else
FreezeEntityPosition(PlayerPedId(), true)
TeleportIntoInterior(v["locout"], false)
end
end
end
end
end
end
end)