Utilities

A dependency for all TebIT resources.

Info

This is an ongoing project. Code schema may change over time.

Legacy support not guaranteed, use at your own risk.

This resource exists primarily as middleware for developers hoping to support any combination of:

    qb-core AND qb-inventory
es_extended AND mf-inventory
es_extended AND qs-inventory
es_extended AND ox_inventory

Each module should give you access to functions provided by any combination of these resources, and reformat data returns into a consistent set across all variations of the function call.

Setup

Config

There are no config vars for this resource.

Convars

All convars must be set before this resource is started. More (general) information regarding convars can be found here: https://docs.fivem.net/docs/scripting-reference/convars/

# "esx" (for es_extended) or "qb" (for qb-core)
setr tebit_lib "esx"

Usage

To use any given module from ti_utils, you must include the init.lua file in your resource manifest, and ensure you have the lua54 flag enabled (set as "yes"). It's also good practice to ensure ti_utils has already started by adding it as a dependency.

lua54 'yes'

shared_scripts {
  '@ti_utils/init.lua',
}

dependencies {
  'ti_utils',
}

You will also need to include a reference to the modules you want to use. Add these to your resource manifest, under the util_module(s) metadata tag.

util_modules {
  'notifications',
  'players'
}

-- alternatively, use a wildcard to load everything
-- probably don't do this in production
util_module '*'

Dependencies

One of the following is required:

1. es_extended (legacy) 
    WITH:
    - esx_context (found in latest ESX main repo)
    - ox_inventory OR mf-inventory

2. qb-core
    WITH:
    - qb-inventory  

Last updated