Giter Club home page Giter Club logo

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
  • Open the sql folder and run the SQL script which corresponds to your framework

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

Setup for ox_inventory

Set Config.InventoryForWeaponsImages to "ox_inventory" and Config.RegisterCreatedWeapons to true/false as desired.

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
  • Use Fivemerr to upload your mugshot pictures. Do not use Discord, images will expire. Documents for setup are here.
Config.FivemerrMugShot = true
  • 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 while jailing. Locate the following event below in 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.

  • Getting a error about utf8mb4_unicode illegal collation? - QBCore has decided to change their collations on the new txAdmin recipe, change your collation on your players table to utf8mb4_general_ci. Run this query below on your database to automatically change it.

ALTER TABLE players CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci

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

annalouu avatar backsh00ter avatar complexza avatar crayons0814 avatar deerock94 avatar imxirvin avatar itzmuri avatar jaredscar avatar jericofx avatar joeszymkowicz avatar joeszymkowiczfivem avatar lenzh avatar lesiin avatar mafewtm avatar matthww avatar mmagnusss avatar monkeywhisper avatar nadplayz avatar nggcasey avatar ok1ez avatar pushkart2 avatar robunderscore avatar shaagss avatar tomasalves8 avatar trapw0w avatar ushifty avatar waseem-h avatar xfutte avatar xsisyphusx avatar z0nzjn123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps-mdt's Issues

Removing Charges

So i noticed if you add charges to someone you can not remove them after if ou click the wrong charge.

Issues with Photos and the dashboard dispatch

On the Police MDT, I saved a photo of an individual, when I view it on the EMS side, it shows it in the search, but not in the profile when I click it. See examples below.

FiveM_b2372_GTAProcess_KOMVawNw9i
FiveM_b2372_GTAProcess_4jAJW8UQml

The Licenses, vehicles, properties don't also load when you select the individual.

When you are on duty as EMS, and you look at the police officers in your active units, it shows you all the officers that have been on duty and they never go away when they go off duty. It also shows EMS as LSPD, and PD as unknown for EMS.
image

Duplication issue with penal codes & attached criminal

image

This image is a bad example for the penal codes, usually it's a perfect copy of all.
Sometimes when someone adds attached criminals, it will duplicate and all the penal codes as well sometimes, so a police officer adds lets say 3 penal codes and saves it, next day it will have 20x of each.

Incidents Page

Make Officers Involved & Civilians Involved not tags, make them searchable like Criminals involved.
image

Missing reports/broken profiles for individuals with empty license object

Symptoms

There have been a multitude of players who seem to have an issue with their licenses being erased. When this happens, all licenses and data disappear from the MDT for these users, and you can no longer make or edit that users profile. Vehicles, houses, etc., none of these populate.

Research
I have successfully restored these profiles by modifying their metadata via SQL and replacing it with the expected value to be in the database:
"licences":{"business":false,"driver":false,"weapon":true,"pilot":false} (valid profile, no issues in MDT)
"licences":{} (this users profile will be broken, as I assume because at least one license is not in the metadata)

I have also seen multiple references to the English term "licences" but in the MDT, some functions refer to it as "licenses". I feel like this needs to be standardized just to reduce the confusion in the future; I'm assuming to "licences" as a multitude of other resources expect this term to be in the player metadata.

The major concern with this is that when this happens, it breaks gun licenses, city hall, etc., for that person. They can no longer obtain or purchase anything that requires a license. I've instructed LEO to use the /grantlicense command in the meantime.

My gut tells me that something doesn't happen as expected when giving or removing a license from someone via the MDT, and that's when the empty object is created.

Fines and Sentances Show up the same for 2 people.

When I create an incident, once I add both suspects to the charges, it takes the most recent person's time and fines and sets it to both individuals.
First individual (Albert) was added and charges were added. Then second individual (Clee) was added and when fines were selected, Alberts fines and times were changed.
I am using the latest version of ps-mdt
image

Also tried it again with just adding both suspects
image

unable to edit there warrant status etc

once you save the report the first time you are unable to edit there warrant status or if they are guilty or not etc, watch the clip in the LJ Labs discord for more info: https://discord.com/channels/897744257237000222/900180032935325707/962931262392266842

I can give so many reasons why this is incorrect, but the main one is. when placing a player on a active warrant its impossible to remove it. after removing the warrant from the incident and clicking save then reopening the incident the warrant is active again.

messages from discord support chat:
Monkey | Protector of the Lab — 04/11/2022
How is this incorrect?
MarcusPlayz517 — 04/11/2022
after you save it the first time you can't edit it again, e.g you can't remove/add warrants, guilty, processed or associated. you also can't add more chargers or criminals

Info from dispatch goes to all jobs

When getting info from dispatch like "Shoots Fired" and it's only selected for "police" in qb-dispatch, it goes to all jobs (police and ambulance only tested
a0ba845d3dbee7ad0c5bd750b30e9fc2
b5f128b67e47ac0536298daffca8098d
)

Ems/officer on duty

So in the mdt if you are police an onduty it shows fine however ems on duty also shows up as lspd under the active officer

Profile Picture Missing

When you change the profile and do not place any image, the image area is empty. Maybe put a default image so this doesn't happen

image

ps-mdt

just want to know if i clicked on the charge and need to delete how do i go about that? also the roster link what or how do i go about that??? also config for the fuel, i changed everything to ps-fuel, did not know if you where going to do that to have as a added feature!

No issue, just a question, to check possibility

Would it be possible to add an item to only be able to open the mdt ?
Example: Police/Ambulance having an item like tablet in their inventory, to be able to use the mdt

What do I need to do ?
Thanks in advance !

PS- Awesome release, thanks guys !

attempt to index a nil value (field 'job')

RegisterNetEvent('dispatch:clNotify', function(sNotificationData, sNotificationId)
sNotificationData.playerJob = PlayerData.job.name ------------<<<<<<<<<<
SendNUIMessage({ type = "call", data = sNotificationData })
end)

When Some activity happening in city and you are in a character selection menu and not loaded in on that same time some activity on going ........ thats trigger to add call in mdt on that time this error printing on console
sNotificationData.playerJob = PlayerData.job.name this line causing the issue

Known Convictions / incident charges

It'd be cool to have a 2x, 3x etc before the charge to see how many times the person has been convicted with this charge (currently even if you've been arrested 20 times for simple assault it'll only show it once)
Also instead of seeing the charges multiple times use the same time x charge in the incidents reports.

Editing BOLO's

When I try to edit a BOLO, I get a server error:
[ script:qb-mdt] SCRIPT ERROR: @oxmysql/lib/MySQL.lua:84: unable to index MySQL.async.execute, expected .await

EMS mdt does not populate calls for workers to attach to

When an EMT/Medic is on duty and receives a call for service same does not populate in the calls section. The dispatch notifications work properly and gives the signal. Police are able to see the calls for service, attach themselves, gps etc. just not the ambulance job.

Everything else in the mdt is beautiful with zero issues. Thank you so much for the quick help and responses ! Looking forward to hearing back with the results !!

EMS Responses not working

Sending a response to calls like /311 is not working from EMS Mdt. However it does work from the Police Mdt

quick question

where do you select the penal codes for it to say what the time and fine should be for the crime? im making a report but i cant see it anywhere?

Player load

i noticed that if you are loged in you are not shown on active unit board until you type /mdt for 1 time

EMS Profile Errors

Just a fyi, i'm getting this error when trying to look at a profile on the EMS side.
Press profiles, search a name, list pops up, click name,..nothing happens. get the error below in txadmin, no f8 errors.

I have the newest mdt from 15 hours ago.

not sure if its a bug or compatibility issue or whatever, just wanted to let ya know, in case it is a bug. :)

Snipaste_2022-05-05_02-50-25

Profiles Un-Searchable - SQL Error

Currently if i try to serach any profiles i get an error in my server console, I have checked all the provided SQL tables follow. This is the query that has the issues under server event: 'mdt:server:incidentSearchPerson'

local result = MySQL.query.await("SELECT p.citizenid, p.charinfo, md.pfp from players p LEFT JOIN mdt_data md on p.citizenid = md.cid WHERE LOWER(charinfo) LIKE :query OR LOWER(citizenid) LIKE :query AND jobtype = :jobtype LIMIT 30", {
query = string.lower('%'..query..'%'), -- % wildcard, needed to search for all alike results
jobtype = JobType
})

constantly provides error: JSON_VALUE does not exist in server console.

Error: Searching Player MDT

When searching a player in the mdt I get a error for an illegal mix of collations, The solution would of course be to make the database use the same collation all around but I cannot convert the players table because of a index key "UK_playervehicles_plate "

https://cdn.discordapp.com/attachments/950959271678464051/956713184117534780/unknown.png - In game server error
https://cdn.discordapp.com/attachments/950959271678464051/956713190807470130/unknown.png - Database error converting to "utf8mb4_general_ci"

BCSO or players marked under sheriffs office doesn’t show up normally in MDT

So my QB police job is configured to have both Police and Sheriff under one job and I am having problems with getting the Guys who are BCSO to show up on the MDT for where has how many are on duty, I went in to the client and server Lua to add in sheriff and anyone under the Sheriff job only shows up as unknown But I have it now where they are able to access the MDT but when they are on the roster they are unknown

EMS pictures dont load

I saved peoples mugshots on the police side and they stay but when on the ems side it doesnt bring up or show a link to the photos even after one is set in the ems side it doesnt save

Medical MDT getting mixed with PD MDT

When I opening an ICU report it gets sent as a BOLO report

Expected Outcome:
When I open and ICU report it stays with Medical and doesn't go to PD

Allow calls to be deleted

Would be awesome if in the active calls context we had the option to delete/remove a call once it has been actioned.

Add support for CD Dispatch

Please can you add a snippet/support for the cd_dispatch users that dont want to use ps-dispatch? That could be awesome!!

Active Units list showing people out of the server

Have been toying with it for awhile and cannot figure out how to make it so people who disconnect dont show up on active units list. Right now, the list gets riddled with people as the day goes on since it doesnt remove people who have Dc'd, and people who clock off duty just show as 10-7 instead of disappearing as well.

Bulletin

wont delete bulletin's out of sql it deletes them until you restart you restart the server and then they all reappear again

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.