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
```
Last updated