Skip to content

feat: mdt-citizen-vehicle-weapon-improvements#548

Closed
LeSiiN wants to merge 48 commits into
Project-Sloth:mainfrom
LeSiiN:feat/mdt-citizen-vehicle-weapon-improvements
Closed

feat: mdt-citizen-vehicle-weapon-improvements#548
LeSiiN wants to merge 48 commits into
Project-Sloth:mainfrom
LeSiiN:feat/mdt-citizen-vehicle-weapon-improvements

Conversation

@LeSiiN
Copy link
Copy Markdown
Contributor

@LeSiiN LeSiiN commented Apr 25, 2026

Overview

This PR introduces three major improvements to the MDT system: enhanced citizen license management, extended search capabilities with fingerprint/DNA/plate normalization, and a full weapon registry module with CRUD support and ownership history.


Citizen license modal

  • Added description field to IssuableLicense interface
  • Description shown on row hover with smooth animation, hidden when absent
  • Fixed description overflow via proper flex containment
  • Reordered layout: name first, type badge second

Citizen & vehicle search

Fingerprint & DNA

  • Added fingerprint and dna fields to the Citizen interface
  • Both fields included in client-side filter and searchCitizens SQL query via JSON_EXTRACT from players.metadata
  • Extended SQL WHERE clause (8 params instead of 6) with explicit Lua loop mapping

Plate normalization

  • Whitespace stripped and uppercased on frontend and DB side (REPLACE/UPPER)
  • Split plateTerm and nameTerm in searchVehiclesForReport for correct case handling
  • Added minimum query length guard (< 2 chars) to vehicle search input

Weapon registry

Frontend

  • Weapon modal with model select, serial number, owner search via PersonSearchModal, and notes
  • Serial number existence check with graceful update fallback (no duplicate entries)
  • Ownership history panel: full name, CID, model, class, info, reason, and logging officer
  • Pagination, search filtering (serial / owner / class / type / tint), and refresh support
  • Permission-gated Add Weapon button via authService
  • Weapon models loaded dynamically via NUI callback; config sourced from Config.Weapons

Backend

  • FK fix: EnsureProfileExists called before insert/update in saveWeaponInfo
  • Server callbacks: saveWeaponInfo and getWeaponOwnershipHistory with mdt_profiles join
  • History entries written on create (manual_entry) and update (ownership_transfer)

LeSiiN added 16 commits April 24, 2026 13:44
- Config.Weapons is new. ( Which Weapons should be allowed to be registered manually )
- Added fingerprint and dna fields to the Citizen interface
- Both fields included in client-side filter and searchCitizens SQL query via JSON_EXTRACT from players.metadata
- Extended SQL WHERE clause (8 params instead of 6), with explicit Lua loop mapping for fingerprint/DNA
- Normalized vehicle plate search: whitespace stripped and uppercased on frontend and DB side (REPLACE/UPPER)
- Split plateTerm and nameTerm in searchVehiclesForReport for correct case handling
- Added minimum query length guard (< 2 chars) to vehicle search input
added "weapons_add" as a new permission
changed search function to allow spaces/big/small letters
added "weapons_add" into permissions
added fingerprint and dna into getCitizens callback
added 'weapons_add' as a new permission
added 'weapons_add' as a new permission and added new events
added 'weapons_add' as a new permission
added new permission, changed ownership history
…s (now in config)

removed unwanted console.logs, changed notes and removed weaponOptions (now in config)
added   `flags` JSON DEFAULT NULL,
changes to Weapons.svelte
added RegisterNUICallback
added ps-mdt:server:saveWeaponFlags
Added `SAVE_WEAPON_FLAGS` to `NUI_EVENTS.WEAPON`
@LeSiiN LeSiiN changed the title feat/mdt-citizen-vehicle-weapon-improvements feeat: mdt-citizen-vehicle-weapon-improvements Apr 28, 2026
@LeSiiN LeSiiN changed the title feeat: mdt-citizen-vehicle-weapon-improvements feat: mdt-citizen-vehicle-weapon-improvements Apr 28, 2026
LeSiiN added 12 commits May 2, 2026 00:25
changes from files to link, added hover for picture to make it bigger
changes stuff in cases.lua (sry)
added title and images to mdt_reports_evidence database

ALTER TABLE mdt_reports_evidence
  ADD COLUMN title VARCHAR(255) NOT NULL DEFAULT '' AFTER reportid,
  ADD COLUMN images LONGTEXT NULL DEFAULT NULL AFTER stored;
added title and images to mdt_reports_evidence
added profile images as link not file and gallery, removed mugshot
profile images as links not files
gallery to add picture manually usage of mdt_citizen_gallery
remove mugshot button ( broken rn )
added new callbacks
removed log entry for profile pic
- fivemanage doesnt support links, only base64, so removed check for fivemanageupload
added title and images, fixed evidence in reports
added title and images, fixed evidence
added title and images, fixed evidence
added little icon in vehicles overview and added edit/zoom button
added this to UpdateVehicle:
 
   if payload.image ~= nil then
        updates[#updates + 1] = 'mdt_vehicle_image = ?'
        values[#values + 1] = payload.image
    end
LeSiiN added 20 commits May 4, 2026 02:16
changed picture to 108x108pxa and also added little icons per gun
added callbacks and streetname grabber
added callbacks and changed some sql stuff to match qbx housing
added entire new property modul to showcase info
added new events
removed german debug
fixed not allowing callsign changes
changed from property_name to property_id
changed from property_name to property_id
changed from property_name to property_id
changed SELECT citizenid to owner
changed picture to 108x108pxa and also added little icons per gun
@LeSiiN LeSiiN closed this May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant