Integration

This is an entire page on what you can integrate with


Minigames

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

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

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

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

We support a wide variety of fuel scripts out the box however if you dont find yours you may add it.

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)

Last updated