For the complete documentation index, see llms.txt. This page is also available as Markdown.

Script Integrations

How to connect your own inventory, target, notify, progressbar, and other scripts

If you want to use your own scripts, the important files are easy to find:

  • Inventory: modules/inventory/server.lua

  • Target: modules/target/client.lua

  • Notify, progressbar, skillbar, HUD, dispatch, fuel, and vehicle keys: modules/utils/client.lua

  • Server-side helper functions: modules/utils/server.lua

  • Job start/stop hooks: modules/exports/client.lua and modules/exports/server.lua

Inventory Integration

File: modules/inventory/server.lua

This file contains 4 main functions:

  • giveItem

  • removeItem

  • hasItem

  • getItemCountByName

If you use a custom inventory, replace the logic inside these functions with your own export or event calls.

Basic example:

function Inventory.giveItem(source, itemName, count)
    return exports['my_inventory']:AddItem(source, itemName, count)
end

Target Integration

File: modules/target/client.lua

The script already includes support for ox_target and qb-target. If you use another target system, replace the fallback else sections with your own target exports.

Main functions:

  • addBoxZone

  • removeZone

  • addLocalEntity

  • removeLocalEntity

  • addBone

  • removeBone

Notify, Progressbar, Skillbar, HUD, Dispatch, Keys, Fuel

File: modules/utils/client.lua

This is the main file for custom client-side integrations. The functions most servers edit are:

  • Utils.notify

  • Utils.toggleHud

  • Utils.triggerPoliceAlert

  • Utils.giveVehicleKey

  • Utils.setFuel

  • Utils.progressBar

  • Utils.skillCheck

Notify example:

Progressbar example:

Dispatch example:

Server-Side Helper Functions

File: modules/utils/server.lua

Important functions in this file:

  • Utils.getPoliceCount

  • Utils.server_notify

  • Utils.spawnVehicle

If your server handles police checks or notifications differently, this is where you should adapt the logic.

Job Hooks and Custom Logic

Files:

  • modules/exports/client.lua

  • modules/exports/server.lua

These hooks let you add extra logic without changing the whole job flow:

  • beforeJobStart

  • onJobStarted

  • onJobStopped

Common use cases:

  • Extra checks before a job starts

  • Sending logs to Discord

  • Triggering your own dispatch or analytics

  • Giving extra rewards after a job ends

Example:

Safest Way To Integrate

Use this order:

  1. Read the existing function and keep the same input/output logic.

  2. Replace only the integration part with your own export or event.

  3. Do not change boolean return values unless you know why.

  4. Test one job at a time in-game.

Last updated