Giter Site home page Giter Site logo

temouchenty / ps-dispatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from project-sloth/ps-dispatch

0.0 0.0 1.0 173 KB

QBCore Dispatch

Home Page: https://discord.gg/projectsloth

License: GNU General Public License v3.0

JavaScript 6.88% Lua 88.74% CSS 3.51% HTML 0.88%

ps-dispatch's Introduction

Beta Released

Integrated with https://github.com/Project-Sloth/qb-mdt

For all support questions, ask in our Discord support chat. Do not create issues if you need help. Issues are for bug reporting and new features only.

https://www.discord.gg/ljlabs

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.

Alert Exports

- exports['qb-dispatch']:VehicleShooting(vehicle)

- exports['qb-dispatch']:Shooting()

- exports['qb-dispatch']:SpeedingVehicle(vehicle)

- exports['qb-dispatch']:Fight()

- exports['qb-dispatch']:InjuriedPerson()

- exports['qb-dispatch']:StoreRobbery(camId)

- exports['qb-dispatch']:FleecaBankRobbery()

- exports['qb-dispatch']:PaletoBankRobbery()

- exports['qb-dispatch']:PacificBankRobbery()

- exports['qb-dispatch']:PrisonBreak()

- exports['qb-dispatch']:VangelicoRobbery()

- exports['qb-dispatch']:HouseRobbery()

- exports['qb-dispatch']:PrisonBreak()

- exports['qb-dispatch']:DrugSale()

- exports['qb-dispatch']:ArtGalleryRobbery()

- exports['qb-dispatch']:HumaneRobery()

- exports['qb-dispatch']:TrainRobbery()

- exports['qb-dispatch']:VanRobbery()

- exports['qb-dispatch']:UndergroundRobbery()

- exports['qb-dispatch']:DrugBoatRobbery()

- exports['qb-dispatch']:UnionRobbery()

- exports['qb-dispatch']:YachtHeist()

- exports['qb-dispatch']:CarBoosting(vehicle)

- exports['qb-dispatch']:CarJacking(vehicle)

- exports['qb-dispatch']:VehicleTheft(vehicle)

Steps to Create New Alert

  1. Create a client event that will be triggered from whatever script you want
local function FleecaBankRobbery()
    local currentPos = GetEntityCoords(PlayerPedId())
    local locationInfo = getStreetandZone(currentPos)
    local gender = GetPedGender()
    TriggerServerEvent("dispatch:server:notify",{
        dispatchcodename = "bankrobbery", -- has to match the codes in sv_dispatchcodes.lua so that it generates the right blip
        dispatchCode = "10-90",
        firstStreet = locationInfo,
        gender = gender,
        model = nil,
        plate = nil,
        priority = 2, -- priority
        firstColor = nil,
        automaticGunfire = false,
        origin = {
            x = currentPos.x,
            y = currentPos.y,
            z = currentPos.z
        },
        dispatchMessage = "Fleeca Bank Robbery", -- message
        job = {"police"} -- jobs that will get the alerts
    })
end exports('FleecaBankRobbery', FleecaBankRobbery)
  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

	["bankrobbery"] =  {displayCode = '10-90', description = "Fleeca Bank Robbery In Progress", radius = 0, recipientList = {'police'}, blipSprite = 500, blipColour = 2, blipScale = 1.5, blipLength = 2, sound = "robberysound"},

Information about each parameter is in the file.

Alerts with Vehicle Information

  1. If you want to display vehicle information with a particular alert, you need to pass the vehicle along with the exports like this
exports["qb-dipatch"]:TestVehicleAlert(vehicle)

and its function in qb-dispatch would look like this

local function TestVehicleAlert(vehicle)
    local vehdata = vehicleData(vehicle)
    local currentPos = GetEntityCoords(PlayerPedId())
    local locationInfo = getStreetandZone(currentPos)
    local heading = getCardinalDirectionFromHeading()
    TriggerServerEvent("dispatch:server:notify",{
        dispatchcodename = "speeding", -- has to match the codes in sv_dispatchcodes.lua so that it generates the right blip
        dispatchCode = "10-11",
        firstStreet = locationInfo,
        model = vehdata.name, -- vehicle name
        plate = vehdata.plate, -- vehicle plate
        priority = 2, 
        firstColor = vehdata.colour, -- vehicle color
        heading = heading, 
        automaticGunfire = false,
        origin = {
            x = currentPos.x,
            y = currentPos.y,
            z = currentPos.z
        },
        dispatchMessage = "Speeding Vehicle",
        job = {"police"}
    })
end 

exports('SpeedingVehicle', SpeedingVehicle)

Rest steps will be similar as mentioned above in Steps to create alerts.

Work to be done

  • Hunting Zones
  • Locales for alerts

ps-dispatch's People

Contributors

pushkart2 avatar monkeywhisper avatar noobysloth avatar lesiin avatar waseem-h avatar donhulieo avatar itshyper avatar joeszymkowiczfivem avatar d40g avatar joeszymkowicz avatar menkzy avatar sol-fitzy avatar joe-rogan-0001 avatar

Forkers

icebergque

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.