Qb-dispatch & mdt

Hi,

I was wondering if you anyone could help me with qb-dispatch on qb-core. I am adding this client event to the fleeca.lua robbery as follows. However the alert will not trigger. Got shots fired and fired from vehicle to work but the banks elude me. Any help would be greatly received

local function FleecaBankRobbery(camId)
local currentPos = GetEntityCoords(PlayerPedId())
local locationInfo = getStreetandZone(currentPos)
local gender = GetPedGender()
TriggerServerEvent(“dispatch:server:notify”,{
dispatchcodename = “bankrobbery”, – has to match the codes in sv_dispatchcodes.lua so that it generates the right blip
dispatchCode = “10-90”,
firstStreet = locationInfo,
gender = gender,
camId = camId,
model = nil,
plate = nil,
priority = 2, – priority
firstColor = nil,
automaticGunfire = false,
origin = {
x = currentPos.x,
y = currentPos.y,
z = currentPos.z
},
dispatchMessage = “Fleeca Bank Robbery”, – message
job = {“police”} – jobs that will get the alerts
})
end exports(‘FleecaBankRobbery’, FleecaBankRobbery)

Go into fleeca.lua, find where the script calls the cops for the robbery, remove the current trigger for it, and then replace it with the export at the very bottom of your post. Then dispatch should take it from there and pull the information from the events file or whatever it is and then display the alert with the information.

Im pretty sure thats how it works. You dont need the full triggerevent snippet in the fleeca file, just that export should do it if its put in the correct place.

Hello,
You have to trigger the export in the file/script that you want. Assuming you are using qb-banckrobbery, open client/fleeca.lua and scroll down to:
RegisterNetEvent('qb-bankrobbery:client:robberyCall', function(type, key, streetLabel, coords)
you have two options here:

  1. Comment the whole event and replace them with your exports
  2. Alter the code to match (can be tricky if you are not well accomodated with LUA yet)

So, going with option 1 you will have something similar to:

RegisterNetEvent('qb-bankrobbery:client:ResetFleecaLockers', function(BankId)
    Config.SmallBanks[BankId]["isOpened"] = false
    for k in pairs(Config.SmallBanks[BankId]["lockers"]) do
        Config.SmallBanks[BankId]["lockers"][k]["isOpened"] = false
        Config.SmallBanks[BankId]["lockers"][k]["isBusy"] = false
    end
end)

exports['qb-dispatch']:FleecaBankRobbery(camId)

--[[
RegisterNetEvent('qb-bankrobbery:client:robberyCall', function(type, key, streetLabel, coords)
    if not isLoggedIn then return end
    local PlayerJob = QBCore.Functions.GetPlayerData().job
    if PlayerJob.name == "police" and PlayerJob.onduty then
        local cameraId
        local bank
        if type == "small" then
            cameraId = Config.SmallBanks[key]["camId"]
            bank = "Fleeca"
            PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
            TriggerEvent('qb-policealerts:client:AddPoliceAlert', {
                timeOut = 10000,
                alertTitle = Lang:t('alerts.polFleca'),
                coords = {
                    x = coords.x,
                    y = coords.y,
                    z = coords.z,
                },
                details = {
                    [1] = {
                        icon = '<i class="fas fa-university"></i>',
                        detail = bank,
                    },
                    [2] = {
                        icon = '<i class="fas fa-video"></i>',
                        detail = cameraId,
                    },
                    [3] = {
                        icon = '<i class="fas fa-globe-europe"></i>',
                        detail = streetLabel,
                    },
                },
                callSign = QBCore.Functions.GetPlayerData().metadata["callsign"],
            })
        elseif type == "paleto" then
            cameraId = Config.BigBanks["paleto"]["camId"]
            bank = "Blaine County Savings"
            PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
            Wait(100)
            PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 )
            Wait(100)
            PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
            Wait(100)
            PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 )
            TriggerEvent('qb-policealerts:client:AddPoliceAlert', {
                timeOut = 10000,
                alertTitle = Lang:t('alerts.polBCounty'),
                coords = {
                    x = coords.x,
                    y = coords.y,
                    z = coords.z,
                },
                details = {
                    [1] = {
                        icon = '<i class="fas fa-university"></i>',
                        detail = bank,
                    },
                    [2] = {
                        icon = '<i class="fas fa-video"></i>',
                        detail = cameraId,
                    },
                },
                callSign = QBCore.Functions.GetPlayerData().metadata["callsign"],
            })
        elseif type == "pacific" then
            bank = "Pacific Standard Bank"
            PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
            Wait(100)
            PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 )
            Wait(100)
            PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
            Wait(100)
            PlaySoundFrontend( -1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1 )
            TriggerEvent('qb-policealerts:client:AddPoliceAlert', {
                timeOut = 10000,
                alertTitle = Lang:t('alerts.polPStandard'),
                coords = {
                    x = coords.x,
                    y = coords.y,
                    z = coords.z,
                },
                details = {
                    [1] = {
                        icon = '<i class="fas fa-university"></i>',
                        detail = bank,
                    },
                    [2] = {
                        icon = '<i class="fas fa-video"></i>',
                        detail = "1 | 2 | 3",
                    },
                    [3] = {
                        icon = '<i class="fas fa-globe-europe"></i>',
                        detail = "Alta St",
                    },
                },
                callSign = QBCore.Functions.GetPlayerData().metadata["callsign"],
            })
        end
        local transG = 250
        local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
        SetBlipSprite(blip, 487)
        SetBlipColour(blip, 4)
        SetBlipDisplay(blip, 4)
        SetBlipAlpha(blip, transG)
        SetBlipScale(blip, 1.2)
        SetBlipFlashes(blip, true)
        BeginTextCommandSetBlipName('STRING')
        AddTextComponentString(Lang:t('mblips.code'))
        EndTextCommandSetBlipName(blip)
        while transG ~= 0 do
            Wait(180 * 4)
            transG = transG - 1
            SetBlipAlpha(blip, transG)
            if transG == 0 then
                SetBlipSprite(blip, 2)
                RemoveBlip(blip)
                return
            end
        end
    end
end)
]]--

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.