Giter Site home page Giter Site logo

solidstaterp / ps-mdt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from project-sloth/ps-mdt

0.0 0.0 0.0 9.39 MB

MDT for QBCore

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

License: GNU General Public License v3.0

JavaScript 34.42% Lua 31.59% CSS 22.18% HTML 11.81%

ps-mdt's Introduction

Project Sloth 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.

Dependencies

Installation

  • Download ZIP
  • Drag and drop resource into your server files, make sure to remove -main in the folder name
  • Run the attached SQL script (mdt.sql)

Weapon Info Export

Adds server export for inserting weaponinfo records, that can be used elsewhere in your server, such as weapon purchase, to add information to the mdt. Below is the syntax for this, all arguments are strings.

exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)

image

Self Register Weapons

  • Your citizens can self-register weapons found on their inventory. Event to trigger is below if you're using qb-target. There's also a command available named registerweapon but you'll need to uncomment if you want to use it.
ps-mdt:client:selfregister
9fda3730fdeb2c254d13696fb104131d.mp4

Automatic Mugshot Pictures

image

Setup for Automatic Mugshot

  • Set Config.UseCQCMugshot to true, It is true by default. (Line 5 in Config.lua)
Config.UseCQCMugshot = true
  • Choose what photos you want by changing this: (Line 8 in Config.lua)
-- Front, Back Side. Use 4 for both sides, we recommend leaving at 1 for default.
Config.MugPhotos = 1
  • Create a Discord Webhook and add it here
-- Images for mug shots will be uploaded here. Add a Discord webhook. 
local MugShotWebhook = ''

Fine & Citation via item

  • Add the item to your shared.lua > items.lua
	['mdtcitation'] 				 = {['name'] = 'mdtcitation', 			  	  	['label'] = 'Citation', 			['weight'] = 1000, 		['type'] = 'item', 		['image'] = 'citation.png', 			['unique'] = true, 		['useable'] = false, ['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Citation from a police officer!'},
  • Add the below code to your inventory > app.js. Should be somewhere around markedbills, see below for reference.
        } else if (itemData.name == "mdtcitation") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        '<p><strong>Citizen ID: </strong><span>' + itemData.info.citizenId + '</span></p>' +
        '<p><strong>Fine: </strong><span>' + itemData.info.fine + '</span></p>' +
        '<p><strong>Citation Date: </strong><span>' + itemData.info.date + '</span></p>' +
        '<p><strong>Incident ID: </strong><span>' + itemData.info.incidentId + '</span></p>' +
        '<p><strong>Involved Officer: </strong><span>' + itemData.info.officer + '</span></p>'
    );
  • Reference for proper placement.

image

Clock In/Out & Leaderboard

  • Triggers when officers Toggle Duty from inside the mdt.
  • Create a Discord Webhook and add it here here
local ClockinWebhook = ''

image image

Jailing & Community Service

  • If you're getting kicked for attempted exploit abuse when jailing. Located the follow event below on qb-policejob > server > main.lua
police:server:JailPlayer
  • Then comment out around line 779 as seen below
-- if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, "Attempted exploit abuse") end

Inventory Edit | Automatic Add Weapons with images

  1. Edit the following event
RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
        elseif QBCore.Shared.SplitStr(shopType, "_")[1] == "Itemshop" then
            if Player.Functions.RemoveMoney("cash", price, "itemshop-bought-item") then
                if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then
                    itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
                    itemData.info.quality = 100
                end
                local serial = itemData.info.serie
                local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name)
                local notes = "Purchased at Ammunation"
                local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
                local weapClass = 1
                local weapModel = QBCore.Shared.Items[itemData.name].label
                AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
                TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount)
                QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
                exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)
                TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
            elseif bankBalance >= price then
                Player.Functions.RemoveMoney("bank", price, "itemshop-bought-item")
                if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then
                    itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
                    itemData.info.quality = 100
                end
                local serial = itemData.info.serie
                local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name)
                local notes = "Purchased at Ammunation"
                local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
                local weapClass = 1
                local weapModel = QBCore.Shared.Items[itemData.name].label
                AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
                TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount)
                QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
				exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)
                TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
            else
                QBCore.Functions.Notify(src, "You don't have enough cash..", "error")
            end

Wolfknight Plate Reader & Radar Compatibility

Support for Wolfknight Radar & Plate Reader https://github.com/WolfKnight98/wk_wars2x

Plate reader automatically locks and alerts Police if:

  • Vehicle owner is Wanted
  • Vehicle owner has no drivers licence
  • Vehicle has a BOLO

IMPORTANT:

  • Ensure you set "CONFIG.use_sonorancad = true" in wk_wars2x/config.lua

This reduces the plate reader events to player's vehicles and doesn't query the database for hundreds of NPC vehicles

Video Demonstration

https://youtu.be/w9PAVc3ER_c

image image image image

Traffic Stop Radialmenu Alert

  • When initiating a traffic stop allows you to notify your fellow officers of your location and provide details about the current location and stopped vehicle through the radial menu.
  1. Add the following code right above function READER:Main() on cl_plate_reader.lua
local Vehicle = nil
local function GetFrontPlate()
	local data = {
		locked = READER.vars.cams["front"].locked,
		plate = READER.vars.cams["front"].plate,
		veh = Vehicle,
	}
	return data
end exports("GetFrontPlate", GetFrontPlate)
  1. Add the following into cl_plate_reader.lua after local veh = UTIL:GetVehicleInDirection( PLY.veh, start, offset ) on the function function READER:Main()
			if i == 1 then
				Vehicle = veh
			end
  • Should look like this after completing the above steps. image
  1. Add ps-mdt:client:trafficStop into the Radialmenu
  • Preview.

image

Roster and SOPs Setup

  • You need a Google Document / Sheet link that is viewable.

Paste the link you got in the config here:

-- Google Docs Link
Config.sopLink = {
    ['police'] = '',
    ['ambulance'] = '',
    ['bcso'] = '',
    ['doj'] = '',
    ['sast'] = '',
    ['sasp'] = '',
    ['doc'] = '',
    ['lssd'] = '',
    ['sapr'] = '',
}

-- Google Docs Link
Config.RosterLink = {
    ['police'] = '',
    ['ambulance'] = '',
    ['bcso'] = '',
    ['doj'] = '',
    ['sast'] = '',
    ['sasp'] = '',
    ['doc'] = '',
    ['lssd'] = '',
    ['sapr'] = '',	
}

Preview

image image image image image image image image

Multi Departments

  • LSPD image
  • BCSO image
  • SASP image
  • SAST image
  • SAPR image
  • LSSD image
  • DOC image

FAQ

  • How do I add charges to a criminal in an Incident? - After finding and adding the criminal citizen to the incident, right-click in the space under the criminal's name and select "Add Charge".

  • My dispatch calls are not being populated? - You have not started the dispatch resource before the mdt or renamed the dispatch resource name and not made the necessary changes in mdt to reflect that.

Reskins

The below repos are direct forks of ps-mdt and have been edited to fit certain countries/look.

  • US Different layout and different colors.
  • UK

Credits

ps-mdt's People

Contributors

monkeywhisper avatar lesiin avatar crayons0814 avatar joeszymkowicz avatar lenzh avatar nggcasey avatar ok1ez avatar backsh00ter avatar trapw0w avatar pushkart2 avatar imxirvin avatar joeszymkowiczfivem avatar complexza avatar jericofx avatar annalouu avatar nadplayz avatar xfutte avatar robunderscore avatar mmagnusss avatar z0nzjn123 avatar ushifty avatar shaagss avatar waseem-h avatar tomasalves8 avatar themani-kh avatar lumiostudio avatar luceeiy avatar lionh34rt avatar itsanobrainer avatar i-kulgu avatar

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.