Client

This section covers the client-side functions located in integration/client/. These functions unify interactions with third-party resources like Target systems, Inventory (client actions), Fuel, Keys, and UI elements.

Target System

The lib standardizes all target interactions using the qb-target data structure. If ox_target is used, the lib automatically converts the syntax (mapping action to onSelect, job to groups, etc.).

Lib47.AddBoxZone

Creates a box zone for targeting.

--- @param name string Unique name for the zone
--- @param center vector3 Central coordinates
--- @param length number Length of the box
--- @param width number Width of the box
--- @param options table Zone options (minZ, maxZ, debugPoly, heading, useZ)
--- @param targetoptions table List of options using qb-target structure
Lib47.AddBoxZone("my_zone", vector3(100.0, 200.0, 30.0), 2.0, 2.0, {
    minZ = 29.0,
    maxZ = 31.0,
    debugPoly = false,
    heading = 90.0
}, {
    options = {
        {
            type = "client", -- or "server", "command"
            event = "myscript:client:action",
            icon = "fas fa-user",
            label = "Interact",
            job = "police", -- qb-target standard
            gang = "ballas", -- qb-target standard
            item = "handcuffs", -- qb-target standard
            action = function() -- Optional function support if not using event
                print("Clicked")
            end
        }
    },
    distance = 2.5
})

Lib47.AddPolyZone

Creates a complex polygon zone.

Lib47.AddCircleZone

Creates a spherical/circular zone.

Lib47.AddTargetEntity

Adds target options to specific entities (NetID or Local).

Lib47.AddTargetModel

Adds target options to specific models.

Lib47.RemoveZone

Removes a registered zone by name.


UI & Progress

The lib standardizes progress bars using the ox_lib data structure.

Lib47.ShowProgress

Displays a progress bar (Circle in Ox, standard bar in QB/ESX).

Lib47.Notify

Sends a notification to the player.


Inventory (Client)

Lib47.OpenStash

Opens a stash inventory for the player.

Lib47.OpenSearchInventory

Opens another player's inventory (e.g., searching/robbing).

Lib47.CloseInventory

Forces the inventory to close.

Lib47.SetInventoryBusy

Sets the player's inventory state to busy (prevents opening).


Vehicles & Keys

Lib47.GiveVehicleKey

Gives keys for a specific vehicle to the player.

Lib47.RemoveVehicleKey

Removes keys from the player.

Lib47.SetVehicleFuel

Sets the fuel level of a vehicle.

Lib47.StoreVehicleHousing

Stores a vehicle in a housing garage (Supporting CD, OkOk, JG, Loaf, Ak47).

Lib47.OpenGarageHousing

Opens the garage menu for a specific housing property.


Status

Lib47.IsDead

Checks if a player (or self) is dead. Supports Metadata checks and Animation checks.

Lib47.IsLastStand

Checks if a player is in the "last stand" / downed state.

Lib47.IsIncapacitated

Checks if the player is either dead OR in last stand.

Last updated