Documentation
  • 🎉WELCOME
  • 🎒CORE INVENTORY
    • 📜CONFIGURATION FILE
    • 🛠️INSTALLATION
      • ESX
      • QBCore
    • ⚠️SHORTCUT / COMMON ISSUES
    • 🖥️API / Integration
      • 🖥️Client
      • 📂Server
  • 👕CORE CLOTHING
    • 📜CONFIGURATION FILE
    • 🛠️INSTALLATION
    • ⚠️COMMON ISSUES
  • 💀CORE GANGS
    • 📜CONFIGURATION FILE
    • 🛠️INSTALATION
    • ⚠️COMMON ISSUES
    • 🖥️API / Integration
      • 🖥️Client
      • 📁Server
      • ⌨️Command
  • 🚨CORE DISPATCH
    • 📜CONFIG
      • ESX
      • QBCore
    • 🛠️INSTALLATION
    • 🧬API
    • ⚠️COMMON ISSUES
  • 💳CORE CREDITS
    • 📜CONFIGURATION FILE
    • 🛠️INSTALLATION
    • ⚠️COMMON ISSUES
Powered by GitBook
On this page
  • 🤙 CALLS
  • ✉️ MESSAGES
  1. CORE DISPATCH

API

Integrate the Dispatch script with more of your scripts

PreviousINSTALLATIONNextCOMMON ISSUES

Last updated 1 year ago

Calls are used in case of an incident (like robbery). Messages are used for citizens to contact authorities

CALLS

Use these Exports or Triggers to integrate Calls into your server

In client file:

every export can take coords as parameters (vector3), if not pass it will use the player position by default

exports['core_dispatch']:sendShootingAlert() -- Alert for shooting
exports['core_dispatch']:sendCarjackAlert() -- Alert for carjacking
exports['core_dispatch']:sendCarTheftAlert() -- Alert for car theft
exports['core_dispatch']:sendStoreRobbery() -- Alert for store robbery
exports['core_dispatch']:sendBankRobbery() -- Alert for bank robbery
exports['core_dispatch']:sendHouseRobbery() -- Alert for House robbery
exports['core_dispatch']:sendDrugSellAlert() -- Alert for Drug sell
exports['core_dispatch']:sendInjuredPersonAlert() -- Alert for injured person
exports['core_dispatch']:sendOfficerDown() -- Alert for officer down (priority alert)

In server file:

coords is the position where you want to trigger the alert

gender is the gender of a player you want to include in the notification (unknow if not set)

exports['core_dispatch']:sendShootingAlert(coords, gender) -- Alert for shooting
exports['core_dispatch']:sendStoreRobbery(coords, gender) -- Alert for store robbery
exports['core_dispatch']:sendBankRobbery(coords, gender) -- Alert for bank robbery
exports['core_dispatch']:sendHouseRobbery(coords, gender) -- Alert for House robbery
exports['core_dispatch']:sendDrugSellAlert(coords, gender) -- Alert for Drug sell
exports['core_dispatch']:sendInjuredPersonAlert(coords, gender) -- Alert for injured person
exports['core_dispatch']:sendOfficerDown(coords, gender) -- Alert for officer down (priority alert)

With export :

exports['core_dispatch']:addCall(
    code, --- @code string code of the call (like 10-19)
    message, --- @message string message in the notification
    { info }, --- @info table of type {icon= string, info= string }
    { coords }, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    time, --- @time number time duration of the notification in ms
    blipSprite, --- @blipSprite number Sprite that will be use on the minimap to 
    blipColor, --- @blipColor number color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

exports['core_dispatch']:addCall(
    "20-12", 
    "Vehicle is being stolen",
    {
        {icon="fa-ruler", info="4.5 MILES"},
        {icon="fa-car", info="RED LAMBORGHINI"}
    },
    {
        31.10 ,6360.71 ,30.8 
    },
    "police", 
    3000, 
    11, 
    5,
    false
)

With event:

TriggerServerEvent("core_dispatch:addCall", 
    code, --- @code string code of the call (like 10-19)
    message, --- @message string message in the notification
    info, --- @info table of type {icon= string, info= string }
    coords, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    cooldown, --- @time number time duration of the notification in ms
    sprite, --- @spritenumber Sprite that will be use on the minimap to 
    color, --- @colornumber color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

local playerPos = GetEntityCoords(PlayerPedId())
local gender = IsPedMale(ped) and 'male' or 'female'

TriggerServerEvent("core_dispatch:addCall", 
  "10-71", 
  "Shots in area", 
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { playerPos.x, playerPos.y, playerPos.z },
  'police',
  5000,
  156, 
  1,
  false
)

With export :

exports['core_dispatch']:addCall(
    code, --- @code string code of the call (like 10-19)
    message, --- @message string message in the notification
    { info }, --- @info table of type {icon= string, info= string }
    { coords }, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    time, --- @time number time duration of the notification in ms
    blipSprite, --- @blipSprite number Sprite that will be use on the minimap to 
    blipColor, --- @blipColor number color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

exports['core_dispatch']:addCall(
    "20-12", 
    "Vehicle is being stolen",
    {
        {icon="fa-ruler", info="4.5 MILES"},
        {icon="fa-car", info="RED LAMBORGHINI"}
    },
    {
        31.10 ,6360.71 ,30.8 
    },
    "police", 
    3000, 
    11, 
    5,
    false
)

With event:

TriggerEvent("core_dispatch:addCall", 
    code, --- @code string code of the call (like 10-19)
    message, --- @message string message in the notification
    info, --- @info table of type {icon= string, info= string }
    coords, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    cooldown, --- @time number time duration of the notification in ms
    sprite, --- @spritenumber Sprite that will be use on the minimap to 
    color, --- @colornumber color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

TriggerEvent("core_dispatch:addCall", 
  "10-71", 
  "Shots in area", 
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { coords.x, coords.y, coords.z },
  'police',
  5000,
  156, 
  1,
  false
)

Use these Exports or Triggers to integrate Messages into your server

With export :

exports['core_dispatch']:addMessage(
    message, --- @message string message in the notification    
    { coords }, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    time, --- @time number time duration of the notification in ms
    blipSprite, --- @blipSprite number Sprite that will be use on the minimap to 
    blipColor, --- @blipColor number color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

local playerPos = GetEntityCoords(PlayerPedId())
local gender = IsPedMale(ped) and 'male' or 'female'

exports['core_dispatch']:addMessage(
    "I need help please",
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { playerPos.x, playerPos.y, playerPos.z },
  "police", 
  3000, 
  11, 
  5,
  false
)

With event:

TriggerServerEvent("core_dispatch:addMessage", 
    message, --- @message string message in the notification
    info, --- @info table of type {icon= string, info= string }
    coords, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    cooldown, --- @time number time duration of the notification in ms
    sprite, --- @spritenumber Sprite that will be use on the minimap to 
    color, --- @colornumber color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

local playerPos = GetEntityCoords(PlayerPedId())
local gender = IsPedMale(ped) and 'male' or 'female'

TriggerServerEvent("core_dispatch:addMessage", 
  "I need help please", 
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { playerPos.x, playerPos.y, playerPos.z },
  'police',
  5000,
  156, 
  1,
  false
)

With export :

exports['core_dispatch']:addMessage(
    message, --- @message string message in the notification    
    { coords }, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    time, --- @time number time duration of the notification in ms
    blipSprite, --- @blipSprite number Sprite that will be use on the minimap to 
    blipColor, --- @blipColor number color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

exports['core_dispatch']:addMessage(
    "I need help please",
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { coords.x, coords.y, coords.z },
  "police", 
  3000, 
  11, 
  5,
  false
)

With event:

TriggerEvent("core_dispatch:addMessage", 
    message, --- @message string message in the notification
    info, --- @info table of type {icon= string, info= string }
    coords, --- @coords number,number,number coords where the notification is trigger
    job, --- @job string job who will receive the notification (one at a time)
    cooldown, --- @time number time duration of the notification in ms
    sprite, --- @spritenumber Sprite that will be use on the minimap to 
    color, --- @colornumber color use for the blip
    priority --- @priority boolean define if the call is priority or not
)

Example:

TriggerEvent("core_dispatch:addMessage", 
  "I need help please", 
  {
    {icon = "fa-venus-mars", info = gender}
  },
  { coords.x, coords.y, coords.z },
  'police',
  5000,
  156, 
  1,
  false
)

MESSAGES

🤙
✉️
🚨
🧬
Page cover image