T3 // Economy & Business

coe_housing

Housing & Properties

Starter apartment, hotels, houses and commercial properties with rent

HEADLESS SERVICE (NO UI)
DEPENDS ON coe_corecoe_databasecoe_loggingcoe_uicoe_economycoe_businessescoe_inventory
coe_housing 18 exports · 0 commands

Runs without a NUI: nothing is rendered on the client and the resource stays idle until events arrive.

01 // OVERVIEW

Housing and commercial properties registered in the admin panel: a free starter apartment, hotels, houses and business locations, each unit a contract with its interior in its own world (routing bucket). Daily-rate rent in weekly, biweekly or monthly cycles with renewal and grace; commercial properties rented or assigned to businesses, charged to the society cash.

On FiveM Enhanced

Everyone shares the same interior (MLO/IPL), but each contract has its own bucket: a hundred players can live in the same building without meeting.

02 // FEATURES

What the module delivers

01

Starter Home

Free unit granted once to each character.

02

Rent Cycles

Weekly, biweekly or monthly, with renewal.

03

Commercial Properties

Rented or assigned to businesses.

04

Private World

Each contract in its own routing bucket.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Presentation & NUI
HTML5 · CSS tokens · CoE UI
CEF DX12
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // PRESENTATION & NUI

Responsive NUI & CoE UI Design System

Built with vanilla HTML5, CSS3 tokens, and modern JavaScript. No heavyweight frameworks (React/Vue/Electron). Rendered directly in FiveM DX12's Chromium Embedded Framework at 0.00 ms while closed.

Five themes supported in real time through CSS variables (--coe-accent, --coe-surface)
Fully keyboard-navigable (Tab, Esc, Enter) and ARIA-accessible
Secure asynchronous communication with the FiveM client via fetch("https://...")
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
ACE Permissions
Administrative operations strictly protected by coe.staff and coe.admin principals.
IsPlayerAceAllowed(src, "coe.admin")
📊
Ledger Auditing
Relevant actions write audit records to the database through coe_audit.
exports.coe_audit:Record(severity, category, event, context)
⚡
0.00ms Idle Telemetry
Event-driven thread dispatch that stays dormant until network events fire.
Clean Architecture & HAL
03 // EXPORTS

Public API 18

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_housing']:AddressActive(propertyId, owner) → any

Checks whether the address still exists (an active lease or an illegal property with a world). Returns the interior used to place the delivery.

ParameterType
propertyIdany
ownerany
LUA
local result = exports['coe_housing']:AddressActive(propertyId, owner)
exports['coe_housing']:BeginPreview(playerId) → any

Starts a preview: the admin moves to a private world while viewing interiors. EndPreview returns them to the shared world.

ParameterType
playerIdany
LUA
local result = exports['coe_housing']:BeginPreview(playerId)
exports['coe_housing']:BusinessProperties(businessId) → any

Returns the commercial properties leased or granted to a business for its business tablet.

ParameterType
businessIdany
LUA
local result = exports['coe_housing']:BusinessProperties(businessId)
exports['coe_housing']:CurrentSpace(playerId) → any

Returns the space the player is currently in ({ propertyId, owner, interior }), or nil if they are outside a property.

ParameterType
playerIdany
LUA
local result = exports['coe_housing']:CurrentSpace(playerId)
exports['coe_housing']:DeleteProperty(propertyId) → any

Export server DeleteProperty (server/main.lua).

ParameterType
propertyIdany
LUA
local result = exports['coe_housing']:DeleteProperty(propertyId)
exports['coe_housing']:DeliveryAddresses(playerId) → any

Returns addresses where the character can receive deliveries: homes, business properties where they work, and accessible illegal properties. Expired contracts outside the grace period are excluded.

ParameterType
playerIdany
LUA
local result = exports['coe_housing']:DeliveryAddresses(playerId)
exports['coe_housing']:EndContract(kind, contractId) → any

Admin real-estate action that ends a contract. Initial and business-granted contracts cannot be ended here.

ParameterType
kindany
contractIdany
LUA
local result = exports['coe_housing']:EndContract(kind, contractId)
exports['coe_housing']:EndPreview(playerId) → any

Export server EndPreview (server/main.lua).

ParameterType
playerIdany
LUA
local result = exports['coe_housing']:EndPreview(playerId)
exports['coe_housing']:InteriorThumbs() → any

Captured in-game thumbnails, mapped from interior IDs to JPEG data URLs.

No parameters.

LUA
local result = exports['coe_housing']:InteriorThumbs()
exports['coe_housing']:Interiors() → any

Returns the catalog of native interiors (shared/interiors.lua) for the admin to choose an interior for each property.

No parameters.

LUA
local result = exports['coe_housing']:Interiors()
exports['coe_housing']:IsReady() → any

Export server IsReady (server/main.lua).

No parameters.

LUA
local result = exports['coe_housing']:IsReady()
exports['coe_housing']:ListProperties() → any

Export server ListProperties (server/main.lua).

No parameters.

LUA
local result = exports['coe_housing']:ListProperties()
exports['coe_housing']:PlayersInSpace(propertyId, owner) → any

Returns players inside a space, for showing deliveries to people already there.

ParameterType
propertyIdany
ownerany
LUA
local result = exports['coe_housing']:PlayersInSpace(propertyId, owner)
exports['coe_housing']:PropertyContracts(propertyId) → any

Admin real-estate view: contracts for a property and who is currently inside.

ParameterType
propertyIdany
LUA
local result = exports['coe_housing']:PropertyContracts(propertyId)
exports['coe_housing']:SaveInteriorThumb(interiorId, image) → any

Export server SaveInteriorThumb (server/main.lua).

ParameterType
interiorIdany
imageany
LUA
local result = exports['coe_housing']:SaveInteriorThumb(interiorId, image)
exports['coe_housing']:SaveProperty(raw) → any

Export server SaveProperty (server/main.lua).

ParameterType
rawany
LUA
local result = exports['coe_housing']:SaveProperty(raw)
exports['coe_housing']:TabletCall(playerId, appId, action, payload) → any

Export server TabletCall (server/main.lua).

ParameterType
playerIdany
appIdany
actionany
payloadany
LUA
local result = exports['coe_housing']:TabletCall(playerId, appId, action, payload)
exports['coe_housing']:TabletVisible(playerId, appId) → any

Export server TabletVisible (server/main.lua).

ParameterType
playerIdany
appIdany
LUA
local result = exports['coe_housing']:TabletVisible(playerId, appId)
04 // COMMANDS

In-game commands 0

This module registers no commands: it is driven by exports and events.