Exports
Use these from other resources to interact with the housing system.
Resource name: prp-housing-v2.
Manifest note
fxmanifest.lua only lists HasPropertyUpgrade under server_exports. Other exports below are still registered with exports("Name", ...) and work the same way.
Server — access & housing records
| Export | Parameters | Returns | Description |
|---|---|---|---|
HasHousingAccess | (stateId, housingId, privilege?) | boolean / access row | Owner always true; otherwise checks keyholder privileges |
HasPropertyUpgrade | (housingId, upgradeName) | boolean | Whether the housing has that upgrade |
GetHousing | (housingId) | table? | Housing row by id |
GetHousingFromLocationId | (locationId) | table? | Housing row for a location |
GetLocationFromHousingId | (housingId) | table? | Location data for a housing id |
GetProperties | (term?, onlyOwner?) | table[] | Search / list properties |
GetPropertiesByOwner | (ownerStateId) | table[] | Properties owned by a character |
GetPlayersCloseToHouse | (housing) | number[] | Player sources near the property |
IsHousingLoaded | () | boolean | Boot finished and data loaded |
ToggleLock | (housingId, isUnlocked, doorIndex?) | boolean | Lock or unlock a door |
Examples
lua
local hasAccess = exports["prp-housing-v2"]:HasHousingAccess(stateId, housingId, "FURNISH")lua
local housing = exports["prp-housing-v2"]:GetHousingFromLocationId(locationId)
if housing then
exports["prp-housing-v2"]:ToggleLock(housing.id, true)
endlua
local properties = exports["prp-housing-v2"]:GetPropertiesByOwner(stateId)
for _, property in ipairs(properties) do
print(property.location_id)
endServer — furniture & settings
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetFurniture | (housingId) | table[] | All furniture in a property |
GetFurnitureByIds | (housingId, furnitureId) | table? | One furniture piece |
DestroyFurniture | (furnitureId) | boolean | Remove a furniture piece |
IsBreachedStorage | (housingId, furnitureId) | boolean | Whether that storage was breached |
SetHousingLocationSetting | (housingId, key, value) | boolean | Set a location setting |
GetHousingLocationSetting | (housingId, key) | any | Get a location setting |
AddPlaceHandler | (category, handler) | void | Custom place handler (server-side registration in furniture.lua) |
Server — real estate / market / rent
| Export | Parameters | Returns | Description |
|---|---|---|---|
CreateShellLocation | (payload) | locationId / false | Create a shell-backed location |
CreateIplLocation | (payload) | locationId / false | Create an IPL interior location |
GetMarketListings | (filter?) | table[] | all / sale / rent / auction |
GetMarketListing | (locationId) | table? | Single market listing |
PurchaseListing | (src, locationId) | ok, err? | Bank purchase for direct sale |
ListProperty | (src, locationId, data) | ok, err? | Put on market (sale/offer/auction) |
RemoveListing | (src, locationId) | ok, err? | Clear sale listing + refund bids |
PlaceOffer | (src, locationId, amount) | ok, bid/err | Offer with deposit |
PlaceAuctionBid | (src, locationId, amount) | ok, bid/err | Auction bid with deposit |
GetRentData | (locationId) | table? | Rent data |
SaveRentData | (locationId, rentData) | boolean | Upsert rent row |
ResetPlayerShell | (src) | void | Reset a player's shell session / bucket |
Guide — phone app integration
- Declare / use the client export to open the built-in market UI:
lua
RegisterNetEvent("myphone:openHousingMarket", function()
exports["prp-housing-v2"]:OpenMarket()
end)- Or build a custom NUI: fetch listings on the server:
lua
lib.callback.register("myphone:housingListings", function(src, filter)
if not src then return {} end
return exports["prp-housing-v2"]:GetMarketListings(filter or "sale")
end)- Load one listing:
GetMarketListing(locationId). - Purchase:
PurchaseListing(src, locationId). - Offers / auctions:
PlaceOffer/PlaceAuctionBid. - List / unlist:
ListProperty/RemoveListing.
Staff tablet: exports["prp-housing-v2"]:OpenRealEstate().
Full market player flow: Market.
Server — open world furnishing
| Export | Parameters | Returns | Description |
|---|---|---|---|
OverrideGlobalZone | (zoneId, roomIndex, layoutId) | void | Override an open world zone layout |
RemoveGlobalZoneOverride | (zoneId, layoutId) | void | Remove a zone layout override |
GetParentZoneForLayout | (layoutId) | string? | Parent zone id for a layout |
ForceUpdateZone | (zoneId, coordinates) | void | Force refresh an open world zone |
Server — misc
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetClosestOrganization | (src) | false / org | Stubbed warehouse HQ helper — currently returns false |
Client — garage
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetClosestGarage | (coords?, skipAccessCheck?) | garage?, distance? | Nearest property garage |
OpenMarket | () | void | Open the housing market NUI |
OpenRealEstate | () | void | Open the staff real estate tablet |
lua
local garage = exports["prp-housing-v2"]:GetClosestGarage()
if garage then
print(garage.housing_id)
endlua
exports["prp-housing-v2"]:OpenMarket()
exports["prp-housing-v2"]:OpenRealEstate()Client — apartments & icons
| Export | Parameters | Returns | Description |
|---|---|---|---|
GenerateApartments | () | void | (Re)generate apartment interactions |
Add3dIcon | (id, data) | void | Add a 3D world icon |
Remove3dIcon | (id) | void | Remove a 3D world icon |
Client — open world furnishing
| Export | Parameters | Returns | Description |
|---|---|---|---|
EnterFurnishMode | (zoneKey, layoutId?) | void | Enter open world furnish mode |
LoadLayout | (layoutId) | void | Load a market layout |
GetCurrentZone | () | table? | Current furniture zone |
GetCurrentRoom | () | table? | Current room |
GetCurrentZoneType | () | string? | standard or market |
CreateZone | (zoneData) | number | Create a furniture zone |
AddZoneRoom | (zoneId, points) | void | Add a room |
DeleteZone | (zoneId) | void | Delete a zone |
DeleteZoneRoom | (parentId, zoneId) | void | Delete a room |
GetAllZones | () | table[] | List zones |
IsCoordInsideCurrentRoom | (coords) | boolean | Point-in-room test |
lua
exports["prp-housing-v2"]:EnterFurnishMode("mrpd_lobby_new")Client — furniture extensions
| Export | Parameters | Returns | Description |
|---|---|---|---|
AddFurnitureModelInteraction | (model, data) | void | Extra target option on a furniture model |
AddMoveEvent | (model, data) | void | Move/gizmo event for a model |
lua
exports["prp-housing-v2"]:AddFurnitureModelInteraction("pr_furniture_tv_01", {
label = "Turn On",
onSelect = function(entity)
-- custom logic
end
})HousingBridge (same resource)
HousingBridge in shared/bridge_adapter.lua is not a FiveM export. Call it only from within prp-housing-v2 (or after editing that file). Useful helpers for integrators editing the resource:
| Helper | Role |
|---|---|
isHousingStaff / hasConfiguredStaffJob | Staff job / admin checks (Config.HousingStaff) |
hasRePermission / getRePermissions | Real estate grade permissions |
notify / notifySuccess / notifyError | Framework notify |
chargeBank / depositBank | Money |
ensureStash / openStash | Inventory stashes |
actionShow / actionHide | TextUI |
playLocation | Spatial / doorbell feedback |
Active electricity helpers live in server/electricity/electricity.lua (GetElectricityDrain, GetMaxElectricity, CanUseFurnitureElectricity, …). See Electricity.