diff --git a/client.lua b/client.lua index 413f4a9ea7..c88a9a1ccf 100644 --- a/client.lua +++ b/client.lua @@ -1687,7 +1687,7 @@ local function isGiveTargetValid(ped, coords) return true end - local entity = Utils.Raycast(1|2|4|8|16, coords + vec3(0, 0, 0.5), 0.2) + local entity = Utils.Raycast(1|4|8|16, coords + vec3(0, 0, 0.5), 0.2) return entity == ped and IsEntityVisible(ped) end @@ -1698,7 +1698,9 @@ RegisterNUICallback('giveItem', function(data, cb) if usingItem then return end if client.giveplayerlist then - local nearbyPlayers = lib.getNearbyPlayers(GetEntityCoords(playerPed), 3.0) + local coords = cache.vehicle and GetWorldPositionOfEntityBone(playerPed, 0) or GetEntityCoords(playerPed) + + local nearbyPlayers = lib.getNearbyPlayers(coords, 3.0) local nearbyCount = #nearbyPlayers if nearbyCount == 0 then return end