Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,13 @@ local function isGiveTargetValid(ped, coords)

local entity = Utils.Raycast(1|2|4|8|16, coords + vec3(0, 0, 0.5), 0.2)

if GetVehiclePedIsIn(ped, false) and not cache.vehicle then
local currCoords=GetWorldPositionOfEntityBone(ped, 0)
if #(pedCoords.xy - currCoords.xy) <= 2.0 then
return true
end
end

return entity == ped and IsEntityVisible(ped)
end

Expand All @@ -1698,7 +1705,13 @@ RegisterNUICallback('giveItem', function(data, cb)
if usingItem then return end

if client.giveplayerlist then
local nearbyPlayers = lib.getNearbyPlayers(GetEntityCoords(playerPed), 3.0)
local coords=GetEntityCoords(playerPed)

if cache.vehicle then
coords=GetWorldPositionOfEntityBone(playerPed, 0)
end

local nearbyPlayers = lib.getNearbyPlayers(coords, 3.0)
local nearbyCount = #nearbyPlayers

if nearbyCount == 0 then return end
Expand Down