Skip to content

Commit

Permalink
fix: secure client events
Browse files Browse the repository at this point in the history
  • Loading branch information
KostaZx committed Feb 13, 2025
1 parent 92021e2 commit 48b547b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit 48b547b

Please sign in to comment.