Integration

This is an entire page on what you can integrate with

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.

function TriggerFishingMinigame()
    local player = Framework.Player
    local passed = false
    exports['ps-ui']:Circle(function(success)
            if success then
                passed = true
            else
                passed = false
            end
        end, Config.DifficultySettings[player.Metadata.fishinglvl].MinigameCircleNum,
        Config.DifficultySettings[player.Metadata.fishinglvl].MinigameCircleMS) -- NumberOfCircles, MS
    return passed
end

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

```lua
function CallPolice()
    if Config.DispatchSystem == "qbcore" then
        TriggerServerEvent('police:server:policeAlert', Lang:t("police_alert.illegal_activity"))
    elseif Config.DispatchSystem == "ps-dispatch" then
        --exports['ps-dispatch']:SuspiciousActivity()
    elseif Config.DispatchSystem == "cd-dispatch" then
        -- 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,
        --     }
        -- })
    else
        -- YOUR SYSTEM HERE
    end
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-Fishing/client/editablefunctions.lua

```lua
function Notify(text, type, time)
    if Config.HandleNotify then
        Framework.Notify(text, type, time)
    else
        --Your Own Notify System
    end
end
```

Last updated