Infinity Compatible TP

This commit is contained in:
LoveFistRP
2021-04-23 15:08:50 -07:00
parent e5be45c140
commit c80bd0331b
2 changed files with 12 additions and 15 deletions
+3 -8
View File
@@ -1,13 +1,8 @@
-- QBCore Command Events
RegisterNetEvent('QBCore:Command:TeleportToPlayer')
AddEventHandler('QBCore:Command:TeleportToPlayer', function(othersource)
local coords = QBCore.Functions.GetCoords(GetPlayerPed(GetPlayerFromServerId(othersource)))
local entity = PlayerPedId()
if IsPedInAnyVehicle(entity, false) then
entity = GetVehiclePedIsUsing(entity)
end
SetEntityCoords(entity, coords.x, coords.y, coords.z)
SetEntityHeading(entity, coords.a)
AddEventHandler('QBCore:Command:TeleportToPlayer', function(coords)
local ped = PlayerPedId()
SetPedCoordsKeepVehicle(ped, coords.x, coords.y, coords.z)
end)
RegisterNetEvent('QBCore:Command:TeleportToCoords')