# qb-houses

`qb-houses` is QBCore's housing resource for player-owned houses using shells and furniture
decoration. Current source manages house locations, ownership/keyholders, entry/exit state, stashes,
outfits, decorations and house-garage integration.

The official resource does **not** implement the mortgage, dynamic market, rental, utility or
property-tax systems previously described on this page.

## Official dependencies

The current manifest declares:

```text
qb-core
qb-interior
qb-clothing
qb-weathersync
```

It also uses PolyZone client files and `oxmysql` on the server.

Start dependencies before qb-houses and verify their APIs when updating.

## Data model

Current server code reads house definitions from the `houselocations` table and ownership from
`player_houses`.

A loaded house contains source-backed fields such as:

- coordinates
- owned state
- price
- lock state
- address/label
- tier
- garage data
- decorations

Do not add mortgage/rental/property-sales tables unless a maintained fork you intentionally deploy
requires them.

## House ownership

The server tracks owner identifiers/citizen IDs and keyholders from persisted house data. When
customizing access, preserve server-side ownership checks.

Do not accept a client-supplied “is owner” Boolean or citizen ID as authorization.

## Stashes

Current server code handles a house stash from the house tier and configured stash weight/slot
settings before opening the inventory.

Inventory behavior belongs to your installed [qb-inventory](/docs/resources/qb-inventory) revision.
If stashes stop working after an inventory migration, inspect both resources rather than inventing
new stash tables.

## House garages

At startup, current qb-houses builds house garage config from persisted house locations and sends it
to qb-garages.

When a garage is added, the resource updates the house location and publishes garage info to
qb-garages.

See [qb-garages](/docs/resources/qb-garages).

## Interior and decoration

The manifest describes qb-houses as a shell/furniture housing system and includes
`client/decorate.lua`. Shell behavior depends on `qb-interior`.

Treat furniture models, placement and NUI behavior as implementation details of the exact revision
you deploy. Do not copy generic furniture APIs or item definitions unless current source declares
them.

## Creating houses

Current server code contains the house creation flow and writes new house locations to
`houselocations`, then updates clients.

If you customize creation:

1. validate the caller's real-estate authorization server-side;
2. validate price/tier/coordinates server-side;
3. use parameterized database operations;
4. test house, key, stash, decoration and garage persistence across restart.

## Security review

Housing combines valuable inventory storage and ownership state. Review network handlers for:

- ownership/keyholder validation,
- distance/proximity validation,
- trusted house identifiers,
- server-controlled prices and tiers,
- inventory authorization,
- garage ownership integration.

See [Server Authority Checklist](/docs/security/server-authority-checklist).

## Troubleshooting

| Symptom | Check |
| --- | --- |
| House missing after restart | `houselocations` persistence and first server error. |
| Player cannot enter owned house | owner/keyholder state, lock state and client/server house config sync. |
| Stash will not open | house tier stash config plus current qb-inventory API. |
| Interior/shell missing | qb-interior state and resource ordering. |
| House garage missing | persisted garage JSON and qb-houses ↔ qb-garages integration. |
| Old mortgage/rental config is nil | Those features are not part of the current official qb-houses resource. |

If you replace qb-houses instead of patching it, compare
[housing scripts on RPScripts](https://rpscripts.net/product-category/fivem-housing/) by declared QBCore
version, ownership data migration and stash/garage integration. RPScripts and qbcore.net are operated by the same owner.

## Sources

- [qb-houses repository](https://github.com/qbcore-fivem/qb-houses)
- [Current fxmanifest.lua](https://github.com/qbcore-fivem/qb-houses/blob/main/fxmanifest.lua)
- [Current server.lua](https://github.com/qbcore-fivem/qb-houses/blob/main/server.lua)
- [qb-garages repository](https://github.com/qbcore-fivem/qb-garages)

Verified against current upstream source on **2026-09-27**.
