2026-04-14 17:41:39 +02:00

194 lines
11 KiB
Lua

positions = {
--{{Teleport Marker-BLip 1 X, Teleport Marker-Blip 1 Y, Teleport Marker-Blip 1 Z, Teleport Marker 1 Heading}, {Teleport 2 X, Teleport 2 Y, Teleport 2 Z, Teleport 2 Heading}, {Red, Green, Blue}, "Text for Teleport", Vehicle can, Marker type, Blip status, {Blip id, Blip scale, Blip colour, Blip show text}, Press Key}
-- Marker Types: https://docs.fivem.net/docs/game-references/markers/
-- Blips types, colour: https://docs.fivem.net/docs/game-references/blips/
-- Press key types: https://docs.fivem.net/docs/game-references/controls/
-- Blip scale optimal is 0.9
-- Vehicle can: true or false
-- Blip status: true or false
--BETWEEN SPAGYM AND ASSMOSPHERE
{{-151.43,-987.57,173.95, 0.0},{-154.96,-982.58,253.45, 0.0} ,{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Assmosphere Restaurant", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-154.96,-982.58,253.45, 0.0},{-151.43,-987.57,173.95, 0.0} ,{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Spa&GYM", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- SPAGYM
{{-150.19,-984.16,28.37, 0}, {-150.04,-984.13,173.95, 0},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Spa&GYM", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.04,-984.13,173.95, 0.0},{-150.19,-984.16,28.3, 0} ,{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- ASSMOSPHERE
{{-151.52,-987.7,28.37, 0}, {-156.23,-985.99,253.45, 0},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Assmosphere Restaurant", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-156.23,-985.99,253.45, 0}, {-151.52,-987.7,28.37, 0},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- POOL FLOOR #1
{{-154.51,-982.62,28.37, 0}, {-151.4412, -987.4249, 52.05, 254.6108},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Pool Floor #1", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-151.4412, -987.4249, 52.05, 254.6108}, {-154.51,-982.62,28.37, 0},{47,186,209}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- POOL FLOOR #2
{{-150.4815, -983.9965, 52.05, 254.3290}, {-125.76,-977.34,114.41, 0},{47,186,209}, "Press ~INPUT_CONTEXT~ to go the Pool Floor #2", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-125.76,-977.34,114.41, 0}, {-150.4815, -983.9965, 52.05, 254.3290},{47,186,209}, "Press ~INPUT_CONTEXT~ to go the Pool Floor #1", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #1
{{-139.1111, -995.6613, 28.37, 68.0750}, {-150.4733, -984.2389, 181.1790, 246.1586},{101,85,71}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #1", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.4733, -984.2389, 180.1790, 246.1586}, {-139.1111, -995.6613, 28.37, 68.0750},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #2
{{-138.3533, -993.6991,28.37, 73.8493}, {-150.4733, -984.2389, 186.4232, 246.1586},{115,81,74}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #2", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.4733, -984.2389, 186.4232, 246.1586}, {-138.3533, -993.6991,28.37, 73.8493},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #3
{{-137.5969, -991.6126, 28.37, 72.5683}, {-150.4733, -984.2389, 192.6710, 246.1586},{82,103,82}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #3", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.4733, -984.2389, 192.6710, 246.1586}, {-137.5969, -991.6126, 28.37, 72.5683},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #4
{{-136.8937, -989.6326, 28.37, 70.6296}, {-150.4733, -984.2389,198.8940, 246.1586},{178,138,107}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #4", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.4733, -984.2389,198.8940, 246.1586}, {-136.8937, -989.6326, 28.37, 70.6296},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #5
{{-136.1411, -987.6219, 28.37, 65.8729}, {-150.3941, -984.3033, 205.1889, 228.6465},{69,62,101}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #5", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.3941, -984.3033, 205.1889, 228.6465}, {-136.1411, -987.6219, 28.37, 65.8729},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
-- HOTEL FLOOR #6
{{-135.4332, -985.7117, 28.37, 62.6124}, {-150.3941, -984.3033, 211.3975, 246.1092},{250,251,247}, "Press ~INPUT_CONTEXT~ to go the Hotel Floor #6", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
{{-150.3941, -984.3033, 211.3975, 246.1092}, {-135.4332, -985.7117, 28.37, 62.6124},{159,125,66}, "Press ~INPUT_CONTEXT~ to go the Lobby", false, 1, false, {12,0.9,0,"Location teleport name"}, 38, {1.501, 1.5001, 0.5001}},
}
vehicle_message = "~r~You can't do it with the vehicle!"
novehcile_message = "~r~You are entering/leaving without a vehicle"
Citizen.CreateThread(function ()
while true do
Citizen.Wait(5)
local player = GetPlayerPed(-1)
local playerLoc = GetEntityCoords(player)
for _,location in ipairs(positions) do
teleport_text = location[4]
pos1 = {
x=location[1][1],
y=location[1][2],
z=location[1][3],
heading=location[1][4]
}
pos2 = {
x=location[2][1],
y=location[2][2],
z=location[2][3],
heading=location[2][4]
}
ColorRed = location[3][1]
ColorGreen = location[3][2]
ColorBlue = location[3][3]
vechicle = location[5]
MarkerType = location[6]
PressKey = location[9]
range = {
p1=location[10][1],
p2=location[10][2],
p3=location[10][3],
}
DrawMarker(MarkerType, pos1.x, pos1.y, pos1.z, 0, 0, 0, 0, 0, 0, range.p1, range.p2, range.p3, ColorRed, ColorGreen, ColorBlue, 200, 0, 0, 0, 1)
if position_verf(playerLoc.x, playerLoc.y, playerLoc.z, pos1.x, pos1.y, pos1.z, 2) then
help_message(teleport_text)
if IsControlJustReleased(1, PressKey) then
if vechicle == true then
if IsPedInAnyVehicle(player, true) then
FreezeEntityPosition(player, true)
DoScreenFadeOut(500)
Citizen.Wait(500)
DoScreenFadeIn(500)
FreezeEntityPosition(player, false)
SetEntityCoords(GetVehiclePedIsUsing(player), pos2.x, pos2.y, pos2.z)
SetEntityHeading(GetVehiclePedIsUsing(player), pos2.heading)
else
FreezeEntityPosition(player, true)
DoScreenFadeOut(500)
Citizen.Wait(500)
DoScreenFadeIn(500)
FreezeEntityPosition(player, false)
SetEntityCoords(player, pos2.x, pos2.y, pos2.z)
SetEntityHeading(player, pos2.heading)
notify_message(novehcile_message)
end
elseif vechicle == false then
if IsPedInAnyVehicle(player, true) then
notify_message(vehicle_message)
else
FreezeEntityPosition(player, true)
DoScreenFadeOut(500)
Citizen.Wait(500)
DoScreenFadeIn(500)
FreezeEntityPosition(player, false)
SetEntityCoords(player, pos2.x, pos2.y, pos2.z)
SetEntityHeading(player, pos2.heading)
if playerLoc.z < 31 or playerLoc.z > 250 then
TriggerEvent("playerSpawnedRnR")
else
TriggerEvent("playerSpawnedToLobby")
end
end
end
end
end
end
end
end)
Citizen.CreateThread(function()
for _,location in ipairs(positions) do
pos1 = {
x=location[1][1],
y=location[1][2],
z=location[1][3],
heading=location[1][4]
}
blip_status = location[7]
blip_id = location[8][1]
blip_scale = location[8][2]
blip_colour = location[8][3]
blip_title = location[8][4]
if blip_status == true then
infoblip = AddBlipForCoord(pos1.x, pos1.y, pos1.z)
SetBlipSprite(infoblip, blip_id)
SetBlipDisplay(infoblip, 4)
SetBlipScale(infoblip, blip_scale)
SetBlipColour(infoblip, blip_colour)
SetBlipAsShortRange(infoblip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(blip_title)
EndTextCommandSetBlipName(infoblip)
end
end
end)
function position_verf(x, y, z, cx, cy, cz, radius)
local t1 = x - cx
local t12 = t1^2
local t2 = y-cy
local t21 = t2^2
local t3 = z - cz
local t31 = t3^2
return (t12 + t21 + t31) <= radius^2
end
function help_message(msg)
SetTextComponentFormat("STRING")
AddTextComponentString(msg)
DisplayHelpTextFromStringLabel(0,0,1,-1)
end
function notify_message(msg)
SetNotificationTextEntry("STRING")
AddTextComponentString(msg)
DrawNotification(true, false)
end