Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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" or playerRank == "owner" 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
- exports['mythic_notify']:DoHudText('success', 'Teleported')
- -- ESX.ShowNotification("Teleported.")
- else
- exports['mythic_notify']:DoHudText('inform', 'Please place your waypoint.')
- -- ESX.ShowNotification("Please place your waypoint.")
- end
- else
- exports['mythic_notify']:DoLongHudText('error', 'You do not have rights to do this.')
- --ESX.ShowNotification("You do not have rights to do this.")
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement