# Integration

{% hint style="warning" %}
WARNING: ONLY MESS WITH THESE IF YOU KNOW WHAT

YOU ARE DOING!!!!
{% endhint %}

***

## Minigames

{% hint style="info" %}
By default we use ox\_lib for the minigame however in the DHS-PettyCrime/client/editable\_functions\_cl.lua you can edit this to match whatever you want
{% endhint %}

```lua
function RemoveRadioMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function RemoveSeatBeltMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function RemoveAirBagMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function RemoveBatteryMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function RemoveCatalyticConverterMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function ACUnitStealingMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function LockpickRegisterMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function HackAlarmSystemMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function LockpickDoorMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end

function AlternatePickpocketMinigame()
    local success = lib.skillCheck({'easy',"easy",'easy'},{"w","a","s","d"})
    return success
end
```

***

## Dispatch Functions

{% hint style="info" %}
By default we use the qbcore built in system however we have support for all systems if you want to integrate it! in the DHS-PettyCrime/client/functions.lua
{% endhint %}

```lua
function CallPolice(isSign, isMeter, isVehicle, isVendingMachine, isPickpocket, isHoldup, isVehicleTampering, isPackageStolen, isMailbox, isTipJar, isLaundryStealing, isTrespassing, isACUnitStealing, isArson, isStoreRobbery)
    local coords = GetEntityCoords(PlayerPedId())
    local street = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
    local streetName = GetStreetNameFromHashKey(street)
    local message = ""
    if isSign then
        message = "Sign Stolen"
    elseif isMeter then
        message = "Parking Meter Tampered With"
    elseif isVehicle then
        message = "Vehicle Being Stolen From"
    elseif isVendingMachine then
        message = "Vending Machine Being Robbed"
    elseif isPickpocket then
        message = "Pickpocketing Attempt"
    elseif isHoldup then
        message = "Mugging Attempt"
    elseif isVehicleTampering then
        message = "Vehicle Tampering Attempt"
    elseif isPackageStolen then
        message = "Stolen Package Tracker Ping"
    elseif isMailbox then
        message = "Mailbox Being Stolen From"
    elseif isTipJar then
        message = "Tip Jar Being Stolen From"
    elseif isLaundryStealing then
        message = "Laundry Theft"
    elseif isTrespassing then
        message = "Trespassing"
    elseif isACUnitStealing then
        message = "AC Unit Being Stolen From"
    elseif isArson then
        message = "Arson Attempt"
    elseif isStoreRobbery then
        message = "Store Robbery"
    end
    if Config.Dispatch == 'ps-dispatch' then
        exports["ps-dispatch"]:CustomAlert({
            coords = coords,
            message = message,
            dispatchCode = "10-33",
            description = message .. " at " .. streetName,
            radius = 0,
            sprite = 500,
            color = 2,
            scale = 1.0,
            length = 3,
        })
    else
        print("Dispatch resource not found")
    end
end
```

***

## Fuel System

{% hint style="info" %}
We support a wide variety of fuel scripts out the box however if you dont find yours you may add it.
{% endhint %}

```lua
local fuelEvent = nil

function SiphonFuel(vehicle, amount)
    if GetResourceState('ox_fuel') ~= 'started' then
        exports[fuelEvent]:SetFuel(vehicle, amount)
        return
      elseif GetResourceState('ox_fuel') == 'started' then
        Entity(vehicle).state.fuel = amount
        return
      end
      print('ERROR: No Fuel Resource Detected')
      fuelEvent = nil
end

CreateThread(function()
    if GetResourceState('LegacyFuel') == 'started' then
       fuelEvent = 'LegacyFuel'
       return
    end
    if GetResourceState('cdn-fuel') == 'started' then
      fuelEvent = 'cdn-fuel'
      return
    end
    if GetResourceState('BigDaddy-Fuel') == 'started' then
      fuelEvent = 'BigDaddy-Fuel'
      return
    end
    if GetResourceState('ps-fuel') == 'started' then
      fuelEvent = 'ps-fuel'
      return
    end
    if GetResourceState('okokGasStation') == 'started' then
      fuelEvent = 'okokGasStation'
      return
    end
    if GetResourceState('qs-fuelstations') == 'started' then
        fuelEvent = 'qs-fuelstations'
        return
    end
    if GetResourceState('lc_fuel') == 'started' then
        fuelEvent = 'lc_fuel'
        return
    end
end)
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dragon-heart-studios.gitbook.io/dragonheartstudios/scripts/dhs-pettycrime/integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
