LGF Placeable Props
Exports
Client

LGF Placeable Props Client Exports

exports.getClosestDrop()

This function retrieves the closest drop (interaction) to the specified player (ped), within the given maximum distance.

exports.LGF_PlaceableProps:getClosestDrop(ped, maxDistance)
  • ped (number)
    The player entity (ped) for whom to find the closest drop. This must be a valid entity in the game world.

  • maxDistance (number)
    The maximum distance to search for the closest drop. This value must be a positive number.


The function returns an array of object containing:

  • id (number) The ID of the closest drop.

  • distance (number) The distance from the player to the closest drop.

exports.getNearbyDrops()

This function retrieves all nearby drops (interactions) within the given maximum distance from the specified player (ped).

exports.LGF_PlaceableProps:getNearbyDrops(ped, maxDistance)
  • ped (number)
    The player entity (ped) for whom to find the closest drop. This must be a valid entity in the game world.

  • maxDistance (number)
    The maximum distance to search for the closest drop. This value must be a positive number.


The function returns an array of objects each containing:

  • id (number) The ID of the nearby drop.

  • distance (number) The distance from the player to the nearby drop.

exports.getDropInfo()

This function retrieves detailed information about a specific drop based on its ID.

exports.LGF_PlaceableProps:getDropInfo(interactionID)
  • interactionID (string)
    The ID of the drop for which to fetch detailed information.

The function returns an object containing the drop data, which includes various details associated with the drop.

How Get Drop Info

CreateThread(function()
  while true do
    Wait(1000)
 
    -- Get the closest drop within 10.0 units
    local nearbyDrops = exports.LGF_PlaceableProps:getClosestDrop(PlayerPedId(), 10.0)
 
    -- Fetch drop data for the closest drop using the id directly
    local dropData = exports.LGF_PlaceableProps:getDropInfo(nearbyDrops.id)
 
    print(json.encode(dropData, { indent = true }))
  end
end)