Skip to content

feat(esx_garage): garage rewrite (backend, migration, exports, NUI)#116

Open
ASTROWwwW wants to merge 90 commits into
esx-framework:1.14.1from
ASTROWwwW:feat/garage-rewrite
Open

feat(esx_garage): garage rewrite (backend, migration, exports, NUI)#116
ASTROWwwW wants to merge 90 commits into
esx-framework:1.14.1from
ASTROWwwW:feat/garage-rewrite

Conversation

@ASTROWwwW

@ASTROWwwW ASTROWwwW commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Finishes the backend for the NUI already on new-garages, built on the es_extended vehicle class (ESX.CreateExtendedVehicle / ESX.GetExtendedVehicleFromPlate) so spawning, despawning and ownership stay server authoritative.

New: server/modules/{registry,vehicle,migration}.lua.

Data model

State lives on owned_vehicles. stored stays boolean: 1 when the vehicle is parked or impounded, 0 when it is out in the world. parking holds the garage id while it is parked and pound the impound lot id while it is impounded, so those two disambiguate stored and nothing depends on the legacy tri state. Legacy stored = 2 rows are converted to stored = 1 plus pound. The remaining columns are per vehicle metadata: custom_name, is_favorite, last_used and mileage.

Migration runs on start and adds each column only if it is missing. esx_garage.sql mirrors it and every statement is guarded, so both are safe to run more than once.

A row saying stored = 0 while no entity is left in the world is out of sync. It is recovered from an impound only, against that lot's fee, and every live entity carrying the plate is deleted before respawning so it cannot duplicate.

Exports

exports.esx_garage:registerGarage({
    id = 'my_garage',
    label = 'My Garage',
    entryPoint = vec3(-285.2, -886.5, 31.0),
    spawns = { vec4(-309.3, -897.0, 31.0, 351.8) },
    blip = { sprite = 357, scale = 0.8, color = 3 },
    logo = 'https://example.com/logo.png',
    color = '#48C9B0',
    access = {
        jobs = { police = 0 },
        authorize = function(source, garage) return true end,
    },
})

Plus registerGarages, unregisterGarage, getGarages, getImpounds and impoundVehicle(plate, lot). Access checks jobs first, then authorize under pcall; no access table means public.

Events

  • esx_garage:giveKeys(source, plate), gated by Config.Settings.vehicleKeys
  • esx_garage:vehicleTransferred(source, targetId, plate, ownerIdentifier, targetIdentifier)

Note

storeVehicle writes the vehicle props itself instead of using the vehicle class setter, and forces model and plate from the server side entity. Please keep it that way.

MrSne7aky and others added 30 commits August 15, 2025 07:48
Added a check to ensure the player actually has the weapon before removing it.
This prevents players from triggering a bug or exploiting the armory callback.


Signed-off-by: Mr Sneaky <123227860+MrSne7aky@users.noreply.github.com>
Added new handcuffs.ydr model and types1.ytyp type definition to the police job props stream for use in ESX police job addon.
Signed-off-by: Mr Sneaky <123227860+MrSne7aky@users.noreply.github.com>
Signed-off-by: OUALI Salah <32158518+OualiS@users.noreply.github.com>
Repo deprecated, moved to ESX-Legacy-Addons
Update client/main.lua
Update client/main.lua
### Description

This PR replaces ESX.ShowHelpNotification with the new ESX:TextUI system for better consistency across the ESX framework.

### PR Checklist

- [X] My commit messages and PR title follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/?utm_source=chatgpt.com) standard.
- [X] My changes have been tested locally and function as expected.
- [X] My PR does not introduce any breaking changes.
- [X] I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.
This PR replaces ESX.ShowHelpNotification with the new ESX:TextUI system for better consistency across the ESX framework.
Added type annotations and refactored some functions.
Rewrote the functions to load the accounts.
Also moved the exports there.
fix(server/main.lua): ensure player has weapon before removal
refactor(esx_hud): remove outdated check
refactor(esx_dmvschool/client/main): switch to ESX:TextUI
N0tNvll and others added 29 commits October 10, 2025 21:21
 - Replace Vue 3 UI with React 19 + TypeScript + Zustand
 - Implement ESX design guidelines (Roboto font, #FB9B04 brand)
 - Add NUI callback structure for kr3mu integration
 - Remove backdrop-filter for FiveM CEF compatibility
 - Use ESX standard shadows, border-radius, transitions
- Use root font-size approach for automatic rem scaling
- Remove deprecated react-query v3, keep @tanstack/react-query v5
- Scale Framer Motion animation offset for perfect centering
- All components use clean rem values without calc()

Technical implementation:
- ScaleProvider sets document.documentElement.fontSize
- All rem values scale automatically with viewport
-Animation offsets multiply by scale factor
- Industry-standard approach for maintainability"
feat(esx_garage): modernize NUI with React + TypeScript
Changed the CSS object-position of the vehicle image from 'center bottom' to 'center 120%' to improve image alignment within the VehicleCard component.
Increased the opacity of the vehicle image to 1 and applied brightness and saturation filters for a more vivid display.
Introduces an $active prop to CounterButton, CounterIcon, and CounterText components to visually indicate when a filter is active. Updates filter logic to toggle between active and 'all' states for stored and impounded filters, improving user feedback and interaction clarity.
Adjusted filter logic in GarageHeader to use 'all' instead of false for non-selected filters. Removed the filled star icon from VehicleCard, always displaying the border star icon for favorites, and updated the active color to use theme's primary text color.
Backend built on ESX.CreateExtendedVehicle/GetExtendedVehicleFromPlate so
storing, retrieving, impound and transfer stay server authoritative.

- data model aligned with owned_vehicles: stored + parking/pound, plus
  custom_name, is_favorite, last_used, mileage
- idempotent auto migration on start, mirrored in esx_garage.sql
- exports to register static garages with per garage access (jobs map plus
  optional authorize callback), custom logo and color
- impound as self service with a configurable per lot fee; a vehicle left
  out of sync is recovered from an impound only
- NUI wired to the backend with error feedback and input validation
- hardened server side validation and entity handling across the lifecycle
- world cleanup on resource stop and refresh, ground markers at each point
@ASTROWwwW
ASTROWwwW changed the base branch from new-garages to 1.14.1 July 18, 2026 22:21
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.

9 participants