Skip to content

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

ExportParametersReturnsDescription
HasHousingAccess(stateId, housingId, privilege?)boolean / access rowOwner always true; otherwise checks keyholder privileges
HasPropertyUpgrade(housingId, upgradeName)booleanWhether 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()booleanBoot finished and data loaded
ToggleLock(housingId, isUnlocked, doorIndex?)booleanLock 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)
end
lua
local properties = exports["prp-housing-v2"]:GetPropertiesByOwner(stateId)
for _, property in ipairs(properties) do
    print(property.location_id)
end

Server — furniture & settings

ExportParametersReturnsDescription
GetFurniture(housingId)table[]All furniture in a property
GetFurnitureByIds(housingId, furnitureId)table?One furniture piece
DestroyFurniture(furnitureId)booleanRemove a furniture piece
IsBreachedStorage(housingId, furnitureId)booleanWhether that storage was breached
SetHousingLocationSetting(housingId, key, value)booleanSet a location setting
GetHousingLocationSetting(housingId, key)anyGet a location setting
AddPlaceHandler(category, handler)voidCustom place handler (server-side registration in furniture.lua)

Server — real estate / market / rent

ExportParametersReturnsDescription
CreateShellLocation(payload)locationId / falseCreate a shell-backed location
CreateIplLocation(payload)locationId / falseCreate 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/errOffer with deposit
PlaceAuctionBid(src, locationId, amount)ok, bid/errAuction bid with deposit
GetRentData(locationId)table?Rent data
SaveRentData(locationId, rentData)booleanUpsert rent row
ResetPlayerShell(src)voidReset a player's shell session / bucket

Guide — phone app integration

  1. Declare / use the client export to open the built-in market UI:
lua
RegisterNetEvent("myphone:openHousingMarket", function()
    exports["prp-housing-v2"]:OpenMarket()
end)
  1. 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)
  1. Load one listing: GetMarketListing(locationId).
  2. Purchase: PurchaseListing(src, locationId).
  3. Offers / auctions: PlaceOffer / PlaceAuctionBid.
  4. List / unlist: ListProperty / RemoveListing.

Staff tablet: exports["prp-housing-v2"]:OpenRealEstate().

Full market player flow: Market.

Server — open world furnishing

ExportParametersReturnsDescription
OverrideGlobalZone(zoneId, roomIndex, layoutId)voidOverride an open world zone layout
RemoveGlobalZoneOverride(zoneId, layoutId)voidRemove a zone layout override
GetParentZoneForLayout(layoutId)string?Parent zone id for a layout
ForceUpdateZone(zoneId, coordinates)voidForce refresh an open world zone

Server — misc

ExportParametersReturnsDescription
GetClosestOrganization(src)false / orgStubbed warehouse HQ helper — currently returns false

Client — garage

ExportParametersReturnsDescription
GetClosestGarage(coords?, skipAccessCheck?)garage?, distance?Nearest property garage
OpenMarket()voidOpen the housing market NUI
OpenRealEstate()voidOpen the staff real estate tablet
lua
local garage = exports["prp-housing-v2"]:GetClosestGarage()
if garage then
    print(garage.housing_id)
end
lua
exports["prp-housing-v2"]:OpenMarket()
exports["prp-housing-v2"]:OpenRealEstate()

Client — apartments & icons

ExportParametersReturnsDescription
GenerateApartments()void(Re)generate apartment interactions
Add3dIcon(id, data)voidAdd a 3D world icon
Remove3dIcon(id)voidRemove a 3D world icon

Client — open world furnishing

ExportParametersReturnsDescription
EnterFurnishMode(zoneKey, layoutId?)voidEnter open world furnish mode
LoadLayout(layoutId)voidLoad a market layout
GetCurrentZone()table?Current furniture zone
GetCurrentRoom()table?Current room
GetCurrentZoneType()string?standard or market
CreateZone(zoneData)numberCreate a furniture zone
AddZoneRoom(zoneId, points)voidAdd a room
DeleteZone(zoneId)voidDelete a zone
DeleteZoneRoom(parentId, zoneId)voidDelete a room
GetAllZones()table[]List zones
IsCoordInsideCurrentRoom(coords)booleanPoint-in-room test
lua
exports["prp-housing-v2"]:EnterFurnishMode("mrpd_lobby_new")

Client — furniture extensions

ExportParametersReturnsDescription
AddFurnitureModelInteraction(model, data)voidExtra target option on a furniture model
AddMoveEvent(model, data)voidMove/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:

HelperRole
isHousingStaff / hasConfiguredStaffJobStaff job / admin checks (Config.HousingStaff)
hasRePermission / getRePermissionsReal estate grade permissions
notify / notifySuccess / notifyErrorFramework notify
chargeBank / depositBankMoney
ensureStash / openStashInventory stashes
actionShow / actionHideTextUI
playLocationSpatial / doorbell feedback

Active electricity helpers live in server/electricity/electricity.lua (GetElectricityDrain, GetMaxElectricity, CanUseFurnitureElectricity, …). See Electricity.