πŸ”₯All scripts on our website are 50% off!πŸ”₯
Logo

Target System

Configuration

The target system is configured in the target() function in the shared configuration file.

function target(store, vector, length, width, section)
    local targetName = store .. tostring(vector.x)
    exports['qb-target']:AddBoxZone(targetName, vector, length, width, {
        name = targetName,
        heading = 0,
        debugPoly = false,
        minZ = vector.z - 10.0,
        maxZ = vector.z + 10.0
    }, {
        options = {{
            num = 1,
            icon = 'fas fa-example',
            label = 'Open',
            drawDistance = 10.0,
            drawColor = {255, 255, 255, 255},
            successDrawColor = {30, 144, 255, 255},
            action = function(entity)
                if IsPedAPlayer(entity) then
                    return false
                end
                TriggerEvent('bit-stores:openSection', store, section)
            end,
            canInteract = function(entity, distance, data)
                if IsPedAPlayer(entity) then
                    return false
                end
                return true
            end
        }},
        distance = 2.5
    })
end

QB-Target Configuration

By default, the script uses QB-Target. The function creates box zones for each store section.

Parameters

  • store: Store name (e.g., "LTD", "24/7", "Liquor")
  • vector: Coordinates for the zone
  • length: Zone length
  • width: Zone width
  • section: Section name (e.g., "drinks", "alcohol")

Options

  • icon: Font Awesome icon to display
  • label: Text displayed on the target
  • drawDistance: Distance at which the target becomes visible
  • distance: Interaction distance

OX-Target Configuration

To use OX-Target instead, replace the function with:

function target(store, vector, length, width, section)
    local targetName = store .. tostring(vector.x)
    exports.ox_target:addBoxZone({
        coords = vector,
        size = vec3(length, width, 2.0),
        rotation = 0,
        debug = false,
        options = {
            {
                name = targetName,
                icon = 'fa-solid fa-basket-shopping',
                label = 'Open Store',
                onSelect = function()
                    TriggerEvent('bit-stores:openSection', store, section)
                end,
                distance = 2.5
            }
        }
    })
end

Draw Text Alternative

If you prefer not to use a target system, enable draw text mode:

Config.useTarget = false
Config.useDrawText = true
Config.alertTextFont = 4

This will display on-screen text prompts when near store sections instead of using the target system.

Custom Target Systems

To use a different target system:

  1. Locate the target() function in the shared config
  2. Replace the export with your target system's export
  3. Maintain the same parameters and trigger event structure

Example structure:

function target(store, vector, length, width, section)
    -- Your custom target system export here
    exports['your-target']:AddZone(...)
    
    -- Must trigger this event when interacted with:
    TriggerEvent('bit-stores:openSection', store, section)
end

[!NOTE] The trigger event bit-stores:openSection must be called with the store and section parameters to open the store interface.