Samuel's Development, Official Documentation
  • 🎉Welcome
  • 📑Overview
    • Resources
      • Bobcat Weapon Heist
        • Installation Guide
        • Configuration
      • Traphouse Robbery
        • Installation Guide
        • Configuration
      • Pacific Bank Heist
        • Installation Guide
        • Configuration
      • Oxy Run
        • Installation Guide
        • Configuration
      • Dumpster Diving
        • Installation Guide
        • Configuration
        • Log Configuration
      • Warehouse Heist
        • Installation Guide
        • Configuration
      • Oil Rig
        • Installation Guide
        • Configuration
      • Beekeeping
        • Installation Guide
        • Configuration
        • Log Configuration
      • Yacht Robbery
        • Installation Guide
        • Configuration
      • Notify
        • Installation
        • Configuration
      • Cocaine Mission
        • Installation Guide
        • Configuration
      • Advanced Drug Sales
        • Installation Guide
        • Configuration
    • Library
      • Installation & Integration
      • Modules
        • Client
          • Callback
          • StartProgress
          • LoadAnim
          • LoadModel
          • LoadPtfxAsset
          • ShowNotification
          • SendEmail
          • PoliceDispatch
          • StartHack
        • Server
          • Callback
          • Name
          • Money
          • Logger
          • Inventory
          • HasGroup
          • GetPlayer
          • GetPlayers
          • GetPlayerByIdentifier
          • GetIdentifier
          • GetPlayerGender
          • CheckVersion
        • Shared
          • Array
          • Table
          • String
          • Math
          • Locale
            • JSON Example
          • AwaitLoad
          • Framework
  • 📚F.A.Q
    • How do I change Locales?!
    • How to add Police Alerts?!
    • What types of dirty money are supported?
Powered by GitBook
On this page
  1. F.A.Q

How to add Police Alerts?!

sd_lib provides a comprehensive solution for integrating with the most renowned dispatch resources available. Your dispatch will automatically be detected and selected. If your preferred system isn't listed, just add your own system yourself in modules/PoliceDispatch/client.lua. The policeAlert() function in every script is your gateway to tailor the dispatch details - from the dispatch code to blips. Tailor it to your needs, and you're set! Here's the example from my oilrig script:

-- Police Alert for Oilrig Heist (Used Dispatch System can be changed in sd_lib/sh_config.lua)
function policeAlert()
  SD.PoliceDispatch({
      displayCode = "10-31H",                    -- Dispatch Code
      title = 'Oilrig Heist',                   -- Title is only used in cd_dispatch
      description = "Oilrig Heist in progress",-- Description of the heist
      message = "Suspects reported on the oilrig", -- Additional message or information
      -- Blip information is used for ALL dispatches besides ps_dispatch, please reference dispatchcodename below.
      sprite = 310,                            -- The blip sprite for oilrig or related icon
      scale = 1.0,                             -- The size of the blip on the map
      colour = 1,                              -- The color of the blip on the map (red, for example)
      blipText = "Oilrig Heist",               -- Text that appears on the Blip
      -- ps-dispatch
      dispatchcodename = "oilrig_heist"        -- This is the name for ps-dispatch users for the sv_dispatchcodes.lua entry.
  })
end 

Users of ps-dispatch must continue to add the blip entry into ps-dispatch/server/sv_dispatchcodes.lua or shared/config.lua (Under Config.Blips), based on the resource version. It's crucial that this entry matches the dispatchcodename in the PoliceDispatch/policeAlert function.

PreviousHow do I change Locales?!NextWhat types of dirty money are supported?

Last updated 1 year ago

📚