Skip to content

Conversation

@bitpredator
Copy link
Owner

πŸš€ New Features

  • Full ESX + ox_inventory compatibility Integrated support for both inventory systems, allowing ID cards, driver licenses, and weapon licenses to be usable regardless of inventory backend.

  • Dynamic Document Rendering ID cards, driver licenses, and weapon licenses are now fully populated with real player data:

    • First name, last name, date of birth, sex, height
    • Dynamic license display (car, bike, truck, weapon)
  • Modern NUI Interface

    • Responsive layout compatible with existing style.css
    • Gender-based avatar images (male.png / female.png)
    • Dynamic background images per document type (idcard, license, firearm)

πŸ› οΈ Improvements

  • NUI Focus Management Proper SetNuiFocus handling ensures the player regains control after closing any document, avoiding frozen cursor or input blocking.

  • Robust License Handling

    • Automatic mapping from database license types to human-readable labels
    • Graceful fallback when licenses or player data are missing
  • Event & Callback Optimization

    • Unified bpt_idcard:open and closeNUI events
    • Clean reset of all UI fields upon closing the card
  • Code Refactor & Optimization

    • Client-side JS (init.js) rewritten for full compatibility with updated server data format
    • Server-side Lua optimized to fetch only required fields from database
    • Removed deprecated ESX-only item registration, now supports both ESX and OX Inventory

πŸ› Bug Fixes

  • Fixed issue where players could not see ID cards if using ox_inventory
  • Fixed UI freeze / stuck cursor on document closure
  • Corrected incorrect license display and mapping
  • Fixed gender image mismatch on NUI

βš™οΈ Developer Notes

  • To add new card types, register them in server.lua using registerUsableCard(itemName, clientEvent)
  • NUI communication is standardized via SendNUIMessage({action:"open"/"close", array:data, type:type})
  • Closing the NUI automatically triggers SetNuiFocus(false, false) to restore player control

Fixes #[issue_no]

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Does your submission pass tests?

Please describe the changes this PR makes and why it should be merged:

Discord username (if different from GitHub):

## πŸš€ New Features

- **Full ESX + ox_inventory compatibility**
  Integrated support for both inventory systems, allowing ID cards, driver licenses, and weapon licenses to be usable regardless of inventory backend.

- **Dynamic Document Rendering**
  ID cards, driver licenses, and weapon licenses are now fully populated with real player data:
  - First name, last name, date of birth, sex, height
  - Dynamic license display (`car`, `bike`, `truck`, `weapon`)

- **Community Branding**
  All documents now feature the **Skull Network Italia logo** and custom styling for a consistent in-game identity.

- **Modern NUI Interface**
  - Responsive layout compatible with existing `style.css`
  - Gender-based avatar images (`male.png` / `female.png`)
  - Dynamic background images per document type (`idcard`, `license`, `firearm`)

---

## πŸ› οΈ Improvements

- **NUI Focus Management**
  Proper `SetNuiFocus` handling ensures the player regains control after closing any document, avoiding frozen cursor or input blocking.

- **Robust License Handling**
  - Automatic mapping from database license types to human-readable labels
  - Graceful fallback when licenses or player data are missing

- **Event & Callback Optimization**
  - Unified `bpt_idcard:open` and `closeNUI` events
  - Clean reset of all UI fields upon closing the card

- **Code Refactor & Optimization**
  - Client-side JS (`init.js`) rewritten for full compatibility with updated server data format
  - Server-side Lua optimized to fetch only required fields from database
  - Removed deprecated ESX-only item registration, now supports both ESX and OX Inventory

---

## πŸ› Bug Fixes

- Fixed issue where players could not see ID cards if using `ox_inventory`
- Fixed UI freeze / stuck cursor on document closure
- Corrected incorrect license display and mapping
- Fixed gender image mismatch on NUI

---

## βš™οΈ Developer Notes

- To add new card types, register them in `server.lua` using `registerUsableCard(itemName, clientEvent)`
- NUI communication is standardized via `SendNUIMessage({action:"open"/"close", array:data, type:type})`
- Closing the NUI automatically triggers `SetNuiFocus(false, false)` to restore player control
@bitpredator bitpredator merged commit 41468c7 into main Oct 29, 2025
4 of 5 checks passed
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.

2 participants