Installation

Installation

  1. Download and extract to your resources folder
  2. Add ensure pf_smash_and_grab to your server.cfg
  3. Configure script/shared/config.lua
  4. Set up your dispatch integration in script/server/custom/dispatch.lua
  5. Restart your server

Important: The resource must be named pf_smash_and_grab.

Dispatch Integration

The resource ships with an empty dispatch hook at script/server/custom/dispatch.lua. Add your dispatch resource's call inside Dispatch.Alert(data):

function Dispatch.Alert(data)
  -- data.source   = player server id
  -- data.coords   = vehicle position (vector3)
  -- data.netId    = vehicle network id
  -- data.item     = item name stolen
  -- data.count    = item count stolen
 
  -- Example: lb-tablet
  exports["lb-tablet"]:AddDispatch({
    priority = "medium",
    code = "10-62",
    title = "Vehicle Break-In",
    description = "A vehicle break-in has been reported.",
    job = "police",
    time = 5,
    location = {
      label = "Vehicle Break-In",
      coords = vec2(data.coords.x, data.coords.y),
    },
    blip = {
      sprite = 326,
      color = 1,
      size = 1.2,
      label = "10-62 - Vehicle Break-In",
    },
  })
end