Dragon Heart Studios
  • Dragon Heart Studios Documentation
  • 🌉DHS-Bridge
  • ⚙️Compatibility
  • 📜Scripts
    • 🎣DHS-Fishing
      • Installation
      • Configuration
      • Integration
    • 🕑DHS-ZWatch
      • Installation
      • Configuration
    • 💰DHS-PettyCrime
      • Installation
      • Configuration
      • Integration
    • 🪓DHS-LumberJack
      • Installation
      • Configuration
      • Integration
    • 🏵️DHS-Peyote
      • Installation
    • 🚗DHS-Boosting
      • Installation
      • Configuration
      • Integration
    • 🦌DHS-Hunting
      • Installation
      • Configuration
      • Integration
    • 👮DHS-PrisonSim
      • Installation
      • Configuration
        • Clothing Config
        • Convoy Config
        • Door Lock Config
        • Entity Sets Config
        • Items Config
        • Jobs Config
        • Locations Config
        • Mugshot Config
        • Object Placer Config
        • Pathfinding Config
        • Peds Config
        • Prison Schedules Config
        • Props Config
        • Solitary Config
      • Integration
      • Exports and Commands
  • 🐝DHS-BrewsAndWines
    • Installation
    • Configuration
      • Beehive Config
      • Clothing Config
      • Delivery Config
      • Mead Config
      • Object Placer Config
      • Peds Config
      • Security Config
      • Wine Config
    • Integration
    • Mead and Wine Brewing
Powered by GitBook
On this page
  • Minigame
  • Dispatch Functions
  • Notify System
  • Stress System
  1. Scripts
  2. DHS-PettyCrime

Integration

This is an entire page on what you can integrate with

WARNING: ONLY MESS WITH THESE IF YOU KNOW WHAT

YOU ARE DOING!!!!


Minigame

By default we use ox_lib for the minigame however in the DHS-PettyCrime/client/functions.lua you can edit this to match whatever you want

```lua
function lockpickMeter()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneMeter(true)
    else
        lockpickDoneMeter(false)
    end
end

function lockpickNews()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneNews(true)
    else
        lockpickDoneNews(false)
    end
end

function lockpickPhone()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDonePhone(true)
    else
        lockpickDonePhone(false)
    end
end

function lockpickFood()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneFood(true)
    else
        lockpickDoneFood(false)
    end
end

function lockpickGumball()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneGumball(true)
    else
        lockpickDoneGumball(false)
    end
end

function lockpickTelescope()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneTelescope(true)
    else
        lockpickDoneTelescope(false)
    end
end

function lockpickOther()
    local success = lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
    if success then
        lockpickDoneOther(true)
    else
        lockpickDoneOther(false)
    end
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

```lua
RegisterNetEvent('dhs-pettycrime:client:callPolice', function() -- Use This Event For Your own Call Police Function
    -- For Codesigns Dispatch
    -- local data = exports['cd_dispatch']:GetPlayerInfo()
    -- TriggerServerEvent('cd_dispatch:AddNotification', {
    --     job_table = {Config.PoliceJob},
    --     coords = data.coords,
    --     title = '10-15 - House Robbery',
    --     message = 'A '..data.sex..' robbing a house at '..data.street,
    --     flash = 0,
    --     unique_id = tostring(math.random(0000000,9999999)),
    --     blip = {
    --         sprite = 431,
    --         scale = 1.2,
    --         colour = 3,
    --         flashes = false,
    --         text = '911 - House Robbery',
    --         time = (5*60*1000),
    --         sound = 1,
    --     }
    -- })

    -- For Base QBCore Police Call
    TriggerServerEvent('police:server:policeAlert', Config.Lang.police_alert.small_robbery)

    -- Other Custom Dispatch or Police Call functions
end)
```

Notify System

By default we use the built in qbcore notify system however we also support ox_lib notify but if you know what you are doing you can integrate this as well.

  • DHS-PettyCrime/client/functions.lua

```lua
function Notify(text, type, time)
    if Config.Notify == "qbcore" then
        local QBCore = exports['qb-core']:GetCoreObject()
        QBCore.Functions.Notify(text, type, time)
    elseif Config.Notify == "ox_lib" then
        lib.notify({
            title = text,
            type = type,
            duration = time
        })
    elseif Config.Notify == "custom" then
        -- Custom Notify System Here
    else
        print("No Notify System Selected")
    end
end
```

Stress System

By default we use the build in qbcore stres system however if you know what you are doing you can definately integrate your own

```lua
function GainStress(amount)
    if Config.StressSystem == "qbcore" then
        local QBCore = exports['qb-core']:GetCoreObject()
        TriggerServerEvent('qb-hud:Server:GainStress', amount)
    elseif Config.StressSystem == "custom" then
        -- Custom Stress System Here
    else
        print("No Stress System Selected")
    end
end
```

PreviousConfigurationNextDHS-LumberJack

Last updated 8 months ago

📜
💰