Dispatch

Police alert and dispatch customization located in custom/client/dispatch.lua.

DrugSellDispatch

Triggered automatically on the client when a police alert chance succeeds during NPC drug sales.

Supported Dispatch Systems

  • qs-dispatch: via DrugSale export.
  • ps-dispatch: via DrugSale export.
  • cd_dispatch: via AddNotification server event.
  • core_dispatch: via addCall export.
  • rcore_dispatch: via sendAlert server event.
  • op-dispatch: via CustomAlert export.
  • aty_dispatch: via SendDispatch export.
  • origen_police: via SendAlert export.
  • tgiann-mdw: via addDispatch export.
  • tk_dispatch: via addCall export.
  • wf-alerts: via svNotify server event.
  • lb-phone: via sendJobNotification server event.
  • Fallback: via default ak47_drugmanagerv3:policeAlert server event.

Example Customization

DrugSellDispatch = function()
    local ped = PlayerPedId()
    local playerCoords = GetEntityCoords(ped)
    local streetHash, _ = GetStreetNameAtCoord(playerCoords.x, playerCoords.y, playerCoords.z)
    local street = GetStreetNameFromHashKey(streetHash)

    if GetResourceState('ps-dispatch') == 'started' then
        exports['ps-dispatch']:DrugSale()
    else
        TriggerServerEvent('ak47_drugmanagerv3:policeAlert', playerCoords, street)
    end
end