Exports
Use these from other resources to interact with the housing system.
Resource name: prp-property.
Manifest note
fxmanifest.lua lists a subset under server_exports / client_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
local hasAccess = exports["prp-property"]:HasHousingAccess(stateId, housingId, "FURNISH")local housing = exports["prp-property"]:GetHousingFromLocationId(locationId)
if housing then
exports["prp-property"]:ToggleLock(housing.id, true)
endlocal properties = exports["prp-property"]:GetPropertiesByOwner(stateId)
for _, property in ipairs(properties) do
print(property.location_id)
endServer — apartments
Requires prp-apartments started. See Apartments.
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetPlayerApartment | (src) | table / false | Session unit assigned to that player |
GetApartment | (apartmentId) | table / false | Unit by physical apartment id |
GetApartmentIdByStateId | (stateId) | number / nil | Physical unit id for a character |
GetHousingFromApartmentId | (apartmentId) | housing, housingId / false | Persistent world_housing row (location_id = -1) for whoever is assigned that unit |
EnsurePlayerApartmentHousing | (src) | table / false | Ensure / return the character’s apartment housing row |
Apartment table fields:
| Field | Type | Description |
|---|---|---|
id | number | Physical unit id |
room | string | Room number (e.g. "101") |
floor | number | Floor |
building | number | Tower id (1–4) |
coords | vector3 / table | Unit coordinates |
Tower (building) ids:
building | Tower |
|---|---|
1 | Lombank Tower 1 |
2 | Lombank Tower 2 |
3 | Eclipse Tower |
4 | Tinsel Tower |
Examples
local apartment = exports["prp-property"]:GetPlayerApartment(src)
if apartment then
print(apartment.room, apartment.floor, apartment.building)
endlocal apartment = exports["prp-property"]:GetPlayerApartment(src)
if not apartment then return end
local towerNames = {
[1] = "Lombank Tower 1",
[2] = "Lombank Tower 2",
[3] = "Eclipse Tower",
[4] = "Tinsel Tower",
}
print(("Room %s · Floor %s · %s"):format(
apartment.room,
apartment.floor,
towerNames[apartment.building] or ("Tower " .. tostring(apartment.building))
))local housing = exports["prp-property"]:EnsurePlayerApartmentHousing(src)
if housing then
print(housing.id, housing.location_id) -- location_id is always -1 for apartments
endlocal apartmentId = exports["prp-property"]:GetApartmentIdByStateId(stateId)
local unit = apartmentId and exports["prp-property"]:GetApartment(apartmentId)Server — 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 |
ResetPlayerIpl | (src) | void | Reset a player's IPL interior session / bucket |
Guide — phone app integration
- Declare / use the client export to open the built-in market UI:
RegisterNetEvent("myphone:openHousingMarket", function()
exports["prp-property"]:OpenMarket()
end)- Or build a custom NUI: fetch listings on the server:
lib.callback.register("myphone:housingListings", function(src, filter)
if not src then return {} end
return exports["prp-property"]: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-property"]:OpenRealEstate().
Full market player flow: Market.
Server — electricity
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetMaxElectricity | (housingId) | number | Max electricity capacity |
GetElectricityDrain | (housingId) | number | Current drain |
GetPotentialElectricityDrain | (housingId) | number | Potential drain |
CanUseFurnitureElectricity | (housingId, …) | boolean | Whether furniture can draw power |
TriggerElectricityOverload | (housingId) | void | Force an overload |
See Electricity.
Server — misc
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetClosestOrganization | (src) | false / org | Stubbed warehouse HQ helper — currently returns false |
Client — apartments
| Export | Parameters | Returns | Description |
|---|---|---|---|
GetMyApartment | () | table? | Local player’s assigned unit (id, room, floor, building, coords) |
GenerateApartments | (floor, buildingId) | void | (Re)generate apartment door interactions for a floor |
local apartment = exports["prp-property"]:GetMyApartment()
if apartment then
print(apartment.room, apartment.floor, apartment.building)
endSame tower ids as the server section (building 1–4).
Client — garage & UI
| 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 |
local garage = exports["prp-property"]:GetClosestGarage()
if garage then
print(garage.housing_id)
endexports["prp-property"]:OpenMarket()
exports["prp-property"]:OpenRealEstate()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 |
exports["prp-property"]: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-property (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.