Server
Server-side exports exposed by rcore_housing. Call them from other resources running on the server.
🏠 Properties
GetProperty
Returns the full property data for a given property id.
---@param propertyId number
---@return Property|nil property
local property = exports.rcore_housing:GetProperty(propertyId)Returns nil if no property exists with that id.
Type: Property
---@class Property
---@field id number
---@field name string
---@field address string
---@field region string
---@field property_type string -- "HOUSE" | "APARTMENT" | "BUSINESS"
---@field interior_type string -- "SHELL" | "IPL" | "MLO"
---@field state string -- "FOR_SALE" | "FOR_RENT" | "RENTED" | "OWNED"
---@field price number
---@field rent_price number
---@field lock boolean
---@field is_hidden boolean
---@field is_building boolean
---@field is_starter_template boolean
---@field is_business_property boolean
---@field interior_id number
---@field coords Vector3
---@field zones Vector3[]
---@field interior Interior
---@field shell_interior ShellInterior
---@field points Point[]
---@field players string[]
---@field furniture table[]
---@field doors table[]
---@field dirt DirtItem[]
---@field metadata { size: number }
---@class Vector3
---@field x number
---@field y number
---@field z number
---@class Vector4 : Vector3
---@field w number
---@class Interior
---@field id number
---@field label string
---@field model string
---@field rot number
---@field shell_pos Vector3
---@field offsets InteriorOffsets
---@class InteriorOffsets
---@field management Vector4
---@field doors Vector4
---@field wardrobe Vector4
---@field storage Vector4
---@class ShellInterior
---@field model string
---@field rot number
---@field pos Vector3
---@field offset InteriorOffsets
---@class Point
---@field type string -- "entry" | "exit" | "management" | "storage" | "wardrobe" | "furniture_delivery_outside"
---@field coords Vector3
---@field heading? number
---@class DirtItem
---@field id number
---@field label string
---@field model string
---@field isInterior boolean
---@field locationType string -- "yard_point" | "interior_point"
---@field coords Vector3Example Usage:
local property = exports.rcore_housing:GetProperty(7)
if property then
-- Basic property info
print(property.name) -- "RCore Housing"
print(property.address) -- "Senora Way"
print(property.price) -- 1000
print(property.property_type) -- "HOUSE"
-- Location data
print(property.coords.x) -- 2719.2
print(property.coords.y) -- 1344.9
print(property.coords.z) -- 24.52
-- Interaction points
print(#property.points) -- 7 interaction points
for _, point in ipairs(property.points) do
print(point.type, point.coords.x, point.coords.y)
end
-- Cleanup items
print(#property.dirt) -- 9 dirt items
for _, dirt in ipairs(property.dirt) do
print(dirt.label, dirt.model) -- "Litter", "prop_rub_litter_06"
end
-- Zone coverage
print(#property.zones) -- 4 zone points
endGetAllProperties
Returns every property currently registered on the server.
---@return table properties
local properties = exports.rcore_housing:GetAllProperties()GetPlayerProperties
Returns properties owned or rented by a given player.
Accepts either a player server id (number) or an identifier (string).
---@param identifier number|string Player Server ID or Player Identifier
---@return Property[] properties
local properties = exports.rcore_housing:GetPlayerProperties(identifier)Returns an array of Property objects. See GetProperty for the Property type structure.
Example:
local byId = exports.rcore_housing:GetPlayerProperties(source)
local byIdentifier = exports.rcore_housing:GetPlayerProperties('char1:abc123')
if #byId > 0 then
for _, property in ipairs(byId) do
print(property.name, property.property_type)
end
endGetPlayerCurrentProperty
Returns the id of the property the player is currently inside, or nil.
---@param src number Player server id
---@return number|nil propertyId
local propertyId = exports.rcore_housing:GetPlayerCurrentProperty(src)IsPlayerInProperty
Returns whether the player is currently inside a specific property.
---@param src number Player server id
---@param propertyId number
---@return boolean inside
local inside = exports.rcore_housing:IsPlayerInProperty(src, propertyId)🗝️ Keys & Permissions
HasKeys
Returns whether the player has access to a property - covers ownership, tenant status, shared access, and physical key items.
Example:
HasAnyPermission
Binary access check - whether the player is owner, tenant, has shared access, or business-synthesized access on a property.
HasPermission
Granular permission check. permissionKey is a PERMISSIONS constant value, e.g. property:security:manage.
You may pass the raw string value directly, or use the PERMISSIONS constant (recommended) which resolves to the same value.
Property permissions
PERMISSIONS.PROPERTY_DASHBOARD_VIEW
property:dashboard:view
PERMISSIONS.PROPERTY_CAMERAS_VIEW
property:cameras:view
PERMISSIONS.PROPERTY_CAMERAS_MANAGE
property:cameras:manage
PERMISSIONS.PROPERTY_CAMERAS_DELETE
property:cameras:delete
PERMISSIONS.PROPERTY_LIGHTS_VIEW
property:lights:view
PERMISSIONS.PROPERTY_LIGHTS_MANAGE
property:lights:manage
PERMISSIONS.PROPERTY_KEYS_VIEW
property:keys:view
PERMISSIONS.PROPERTY_KEYS_MANAGE
property:keys:manage
PERMISSIONS.PROPERTY_ACCESS_VIEW
property:access:view
PERMISSIONS.PROPERTY_ACCESS_MANAGE
property:access:manage
PERMISSIONS.PROPERTY_UPGRADES_VIEW
property:upgrades:view
PERMISSIONS.PROPERTY_UPGRADES_BUY
property:upgrades:buy
PERMISSIONS.PROPERTY_DOORS_VIEW
property:doors:view
PERMISSIONS.PROPERTY_DOORS_MANAGE
property:doors:manage
PERMISSIONS.PROPERTY_INTERACTIONS_VIEW
property:interactions:view
PERMISSIONS.PROPERTY_INTERACTIONS_MANAGE
property:interactions:manage
PERMISSIONS.PROPERTY_BILLS_VIEW
property:bills:view
PERMISSIONS.PROPERTY_BILLS_PAY
property:bills:pay
PERMISSIONS.PROPERTY_FURNITURE_STORAGE_VIEW
property:furniture_storage:view
PERMISSIONS.PROPERTY_FURNITURE_STORAGE_MANAGE
property:furniture_storage:manage
PERMISSIONS.PROPERTY_FURNITURE_EDITOR_VIEW
property:furniture_editor:view
PERMISSIONS.PROPERTY_FURNITURE_EDITOR_USE
property:furniture_editor:use
PERMISSIONS.PROPERTY_FURNITURE_ORDER_VIEW
property:furniture_order:view
PERMISSIONS.PROPERTY_FURNITURE_ORDER_CREATE
property:furniture_order:create
PERMISSIONS.PROPERTY_OWNERSHIP_RENT
property:ownership:rent
PERMISSIONS.PROPERTY_OWNERSHIP_SELL
property:ownership:sell
PERMISSIONS.PROPERTY_OWNERSHIP_TRANSFER
property:ownership:transfer
PERMISSIONS.PROPERTY_SECURITY_VIEW
property:security:view
PERMISSIONS.PROPERTY_SECURITY_MANAGE
property:security:manage
Zone permissions
PERMISSIONS.ZONE_STORAGE_ACCESS
zones:storage:access
PERMISSIONS.ZONE_WARDROBE_ACCESS
zones:wardrobe:access
PERMISSIONS.ZONE_GARAGE_ACCESS
zones:garage:access
PERMISSIONS.ZONE_MANAGEMENT_ACCESS
zones:management:access
PERMISSIONS.ZONE_FURNITURE_DELIVERY_INSIDE_ACCESS
zones:furniture_delivery_inside:access
PERMISSIONS.ZONE_FURNITURE_DELIVERY_OUTSIDE_ACCESS
zones:furniture_delivery_outside:access
See Access and Permissions for more on how permissions are applied.
🚪 Property Actions
GiveProperty
Gives a property to an identifier.
Returns false, "Property not found" if the property does not exist.
WipeProperty
Wipes a property - optionally removing ownership as well.
Returns false, "Property not found" if the property does not exist.
KickPlayerFromProperty
Kicks the player out of the property they are currently inside.
Returns false if the player is not inside any property.
⭐ Starter Apartments
Last updated