mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
Infinity Compatible TP
This commit is contained in:
+3
-8
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user