cobalt_housing
Properties and who can enter them.
GetProperty
ServerReturns a property by id, or nil when it does not exist.
exports.cobalt_housing:GetProperty(id)| Parameter | Type | Optional | Description |
|---|---|---|---|
id | integer | No |
| Returns | Description |
|---|---|
HousingProperty? |
local property = exports.cobalt_housing:GetProperty(1)FindProperties
ServerProperties whose name contains query, ignoring case, sorted by id. limit defaults to 25, which is also the most it returns. Empty when query is under 2 characters.
exports.cobalt_housing:FindProperties(query, limit)| Parameter | Type | Optional | Description |
|---|---|---|---|
query | string | No | |
limit | integer | Yes |
| Returns | Description |
|---|---|
HousingProperty[] |
local properties = exports.cobalt_housing:FindProperties(
'SELECT * FROM players WHERE citizenid = ?',
10
)GetOwnedProperties
ServerReturns the properties a character owns.
exports.cobalt_housing:GetOwnedProperties(citizenid)| Parameter | Type | Optional | Description |
|---|---|---|---|
citizenid | string | No |
| Returns | Description |
|---|---|
HousingPropertySummary[] |
local propertySummaries = exports.cobalt_housing:GetOwnedProperties('ABC12345')HasAccess
ServerWhether the character owns the property.
exports.cobalt_housing:HasAccess(citizenid, propertyId)| Parameter | Type | Optional | Description |
|---|---|---|---|
citizenid | string | No | |
propertyId | integer | No |
| Returns | Description |
|---|---|
boolean |
local ok = exports.cobalt_housing:HasAccess('ABC12345', 1)