Code Monkey home page Code Monkey logo

qb-dispatch's Introduction

qb-dispatch

WIP for cleaner and more easier to setup Dispatch compatible with QB-mdt

Installation

  • Download ZIP
  • Drag and drop resource into your server files
  • Start resource through server.cfg
  • Drag and drop sounds folder into interact-sound\client\html\sounds
  • Restart your server.

Steps to Create New Alert

  1. Create a client event that will be triggered from whatever script you want
RegisterNetEvent("qb-dispatch:client:storerobbery", function(camId)
    local currentPos = GetEntityCoords(PlayerPedId())
    local locationInfo = getStreetandZone(currentPos)
    local gender = GetPedGender()
    local heading = getCardinalDirectionFromHeading()
    PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
    TriggerServerEvent("dispatch:server:notify",{
        dispatchcodename = "storerobbery", -- has to match the codes in sv_dispatchcodes.lua so that it generates the right blip
        dispatchCode = "10-90",
        firstStreet = locationInfo,
        camId = camId,
        model = nil,
        plate = nil,
        priority = 2, -- priority
        firstColor = nil,
        automaticGunfire = false,
        origin = {
            x = currentPos.x,
            y = currentPos.y,
            z = currentPos.z
        },
        dispatchMessage = "Store Robbery", -- message
        job = {"police"} -- jobs that will get the alerts
    })
end)
  1. Add Dispatch Code in sv_dispatchcodes.lua for the particular robbery to display the blip

["storerobbery"] is the dispatchcodename you passed with the TriggerServerEvent in step 1

    ["storerobbery"] =  {displayCode = '10-90', description = "Store Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 52, blipColour = 1, blipScale = 1.5, blipLength = 2 },

Information about each parameter is in the file.

Work to be done

  1. 911, 311 calls (Done)
  2. Locales for alerts
  3. Create basic alerts for qbcore (store, bank, house) (Done)
  4. Edit the blips sprite and color in sv_dispatchcodes.lua (Done)
  5. Add ability to disable notifications (Done)
  6. Add onduty check for alerts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.