local ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj)
ESX = obj
end)
Citizen.Wait(0)
end
end)
RegisterCommand("tpm", function(source)
TeleportToWaypoint()
end)
TeleportToWaypoint = function()
ESX.TriggerServerCallback("esx_marker:fetchUserRank", function(playerRank)
if playerRank == "admin" or playerRank == "superadmin" or playerRank == "mod" then
local WaypointHandle = GetFirstBlipInfoId(8)
if DoesBlipExist(WaypointHandle) then
local waypointCoords = GetBlipInfoIdCoord(WaypointHandle)
for height = 1, 1000 do
SetPedCoordsKeepVehicle(PlayerPedId(), waypointCoords["x"], waypointCoords["y"], height + 0.0)
local foundGround, zPos = GetGroundZFor_3dCoord(waypointCoords["x"], waypointCoords["y"], height + 0.0)
if foundGround then
SetPedCoordsKeepVehicle(PlayerPedId(), waypointCoords["x"], waypointCoords["y"], height + 0.0)
break
end
Citizen.Wait(5)
end
ESX.ShowNotification("Işınlandın")
else
ESX.ShowNotification("Lütfen Işınlanma Noktası Seçin")
end
else
ESX.ShowNotification("Bunun için Yetkiniz Yok !")
end
end)
end