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 ps-ui for the fishing minigame however, in the DHS-Fishing/client/editablefunctions.lua you can edit this to match whatever minigame you want.
functionTriggerFishingMinigame()localfishinglvl=Bridge.Framework.GetPlayerMetaData('fishinglvl') or1localpassed=false -- Check if ps-ui is availableifGetResourceState('ps-ui') =='started' thenexports['ps-ui']:Circle(function(success)ifsuccessthenpassed=trueelsepassed=falseendend, Config.DifficultySettings[fishinglvl].MinigameCircleNum,Config.DifficultySettings[fishinglvl].MinigameCircleMS)else -- Fallback to ox_lib skill check if ps-ui is not availablelocalsuccess=lib.skillCheck({'easy', 'easy', 'medium'}, {'e'})passed=successendreturnpassedend
Dispatch Function
By default we use qbcore built in system however we have support for both:
ps-dispatch
cd-dispatch
however if you know what you are doing you can implement your own as well.
DHS-Fishing/client/editablefunctions.lua
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.
function CallPolice()
local coords = GetEntityCoords(cache.ped)
-- Use Community Bridge Dispatch module if available
if Bridge.Modules and Bridge.Modules.Dispatch then
local alertData = {
coords = coords,
title = Config.Lang.police_alert.illegal_activity or 'Illegal Fishing Activity',
description = 'Suspicious fishing activity reported',
alert_code = '10-15',
sprite = 431,
color = 3,
scale = 1.2,
jobs = {'police'}
}
local success, err = pcall(function()
Bridge.Dispatch.AlertPolice(alertData)
end)
if not success then
DebugLog('Dispatch alert failed: ' .. tostring(err))
end
return
end
-- Fallback to traditional dispatch systems with safe checks
if Config.DispatchSystem == 'qbcore' then
TriggerServerEvent('police:server:policeAlert', Config.Lang.police_alert.illegal_activity)
elseif Config.DispatchSystem == 'ps-dispatch' then
if GetResourceState('ps-dispatch') == 'started' then
local success, err = pcall(function()
exports['ps-dispatch']:SuspiciousActivity()
end)
if not success then
DebugLog('ps-dispatch alert failed: ' .. tostring(err))
end
end
elseif Config.DispatchSystem == 'cd-dispatch' then
if GetResourceState('cd_dispatch') == 'started' then
local success, err = pcall(function()
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police'},
coords = data.coords,
title = '10-15 - Illegal Fishing Activity',
message = 'A ' .. data.sex .. ' using illegal bait at ' .. data.street,
flash = 0,
unique_id = tostring(math.random(0000000, 9999999)),
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Illegal Fishing Activity',
time = (5 * 60 * 1000),
sound = 1,
}
})
end)
if not success then
DebugLog('cd_dispatch alert failed: ' .. tostring(err))
end
end
else
-- No dispatch system configured or available
DebugLog('No dispatch system available for police alert')
end
end
function Notify(text, type, time)
if Config.HandleNotify and Bridge and Bridge.Notify then
Bridge.Notify.SendNotify(text, type, time)
else
-- Fallback to print if Bridge not ready
print('[DHS-Fishing] Notify: ' .. tostring(text))
end
end