diff --git a/client/events.lua b/client/events.lua index b100e75d0..8259c98bb 100644 --- a/client/events.lua +++ b/client/events.lua @@ -44,6 +44,8 @@ end) ---@param coords vector3 RegisterNetEvent('QBCore:Command:TeleportToPlayer', function(coords) + if GetInvokingResource() then return end + SetPedCoordsKeepVehicle(cache.ped, coords.x, coords.y, coords.z) end) @@ -52,6 +54,8 @@ end) ---@param z number ---@param h number RegisterNetEvent('QBCore:Command:TeleportToCoords', function(x, y, z, h) + if GetInvokingResource() then return end + SetPedCoordsKeepVehicle(cache.ped, x, y, z) SetEntityHeading(cache.ped, h or GetEntityHeading(cache.ped)) end)