Skip to main content

v5.5.0

Private garages, and a housing bridge that works with any housing script.

Nothing changes if you ignore this

A garage is only private once it has an owner. Until you set one, every garage behaves exactly as it did in 5.4.4, including how the definitions are sent to your players.

Added

  • Private garages. A garage becomes private the moment it has an owner. From then on only that owner and the people they let in can park there. Set an owner with /garageowner <garageId> <serverId> (requires the garage.edit right) and release the garage again with /garageowner <garageId> clear. Both also work from the server console, which is how you fix a garage nobody can reach any more.
  • Owners share the garage from the garage menu. A private garage the player owns shows an Access button in its header. It lists who may currently park there, takes a server id to let somebody in, and removes people again with one click. Both sides get a notification. Only the owner sees the button and only the owner can hand out access, so the first roommate cannot pass the house on to the whole server. Config.PrivateGarageMaxMembers caps how many people fit into one garage.
  • The same thing as a command, for when the garage is out of reach and for rcon or txAdmin. /garagezugriff lists the private garages a player owns, /garagezugriff <garageId> shows who may use it, and /garagezugriff <garageId> add <serverId> lets somebody in. remove also accepts an identifier, because the person you want to remove is usually offline.
  • A housing bridge for any housing script. msk_garage does not know a single housing script by name, it offers an interface instead. The preferred direction is your housing script telling msk_garage what happened, through seven new server exports. For scripts you cannot patch there are three adapters in config/static.lua instead. The whole topic has its own page: Private garages.
  • A garage template. A full garage definition has a ped, a blip, a marker, types and distances, and no third-party script can be expected to produce that. CreatePrivateGarage therefore only needs coordinates and an owner, everything cosmetic comes from Config.PrivateGarageTemplate.

Changed

  • Definitions are sent per player once private garages exist. Every client only ever learns about the private garages it may actually use. Without that, every house on the server would end up as a blip on the map of everyone else, and a server with a few hundred houses would push a few hundred definitions into every single client on join. Servers without a single private garage keep the old single broadcast, so nothing changes for them.
  • dashboardGroups is no longer part of the definitions sent to clients. The client never read it, and it listed the names of your admin groups.

Fixed

  • A vehicle can no longer be locked inside a garage you lost access to. This is the one way the feature could have cost somebody their car, and it is handled in all four cases: access being removed, an owner change, a public garage becoming private for the first time, and a housing script re-registering a house after a resale. In each of them the affected vehicles move to the default garage of their category first, boats to the sea default and helicopters to the air one, and only then does the change take effect. Turning a private garage back into a public one moves nothing, because everybody may use it afterwards.

Database

Both changes are applied automatically on start, there is no SQL to run by hand:

  • msk_garage_garages gains the nullable columns owner and house_ref
  • the new table msk_garage_private_access holds who may use which garage

Changed files

fxmanifest.lua
config/static.lua
locales/de.lua
locales/en.lua
locales/es.lua
locales/fr.lua
locales/hu.lua
locales/pl.lua
locales/pt.lua
server/private.lua (new)
server/private_command.lua (new)
server/housing/init.lua (new)
server/housing/db.lua (new)
server/housing/export.lua (new)
server/housing/custom.lua (new)
server/validation.lua
server/api.lua
server/admin/api.lua
server/admin/boot.lua
server/admin/store.lua
client/nui.lua
web/src/components/AccessDialog.tsx (new)
web/src/components/Header.tsx
web/src/App.tsx
web/src/devMock.ts
web/src/i18n/types.ts
web/src/lib/nui.ts
web/package.json (4.0.0 -> 5.5.0)
web/package-lock.json
html/** (rebuilt)

The NUI changed in this version. Replace the html/ folder together with the rest of the resource files, then restart it.