With these exports, you will be able to manipulate the system from scripts external to it.
Client Exports
InsideHouse
exports['origen_housing']:insideHouse()
Check if a player is inside a house, return true if inside or false if not inside.
Example:
local inside = exports['origen_housing']:insideHouse()if inside thenprint("Player is inside a house.")elseprint("Player is not inside a house.")end
GetHouses
exports['origen_housing']:getHouses()
Returns all server houses as a client request.
Example:
local houses = exports['origen_housing']:getHouses()for , house inipairs(houses) doprint(house.name)end
GetPlayerHouses
-- @param identifier (string): The identifier of the character.-- If empty, it will take the client identifier.exports['origen_housing']:getPlayerHouses(identifier)
Returns a table with house data or an empty table if there are no houses.
IsBusy
exports['origen_housing']:isBusy()
Returns if the player is busy using menus or creating a house.
Example:
local busy = exports['origen_housing']:isBusy()if busy thenprint("Player is busy.")elseprint("Player is not busy.")end
OpenHouseMenu
exports['origen_housing']:OpenHouseMenu()
Export to open the house management menu
CloseHouseMenu
exports['origen_housing']:CloseHouseMenu()
Esport to close the house management menu
Server Exports
GetAllHouses
exports['origen_housing']:getAllHouses()
Returns all server houses as a server request.
Example:
local houses = exports['origen_housing']:getAllHouses()for _, house inipairs(houses) doprint(house.name)end
GetHouse
-- @param houseID (int): The ID of the house.exports['origen_housing']:getHouse(houseID)
Returns a specific house using the ID of the house.
Example:
local houseID =1local house = exports['origen_housing']:getHouse(houseID)if house thenprint(house.name)elseprint('The house id is not valid')end
GetOwnedHouses
-- @param identifier (string): The identifier of the character.exports['origen_housing']:getOwnedHouses(identifier)
Returns all houses of a certain character using their identifier.
Example:
local identifier ='AB12345'local ownedHouses = exports['origen_housing']:getOwnedHouses(identifier)for _, house inipairs(ownedHouses) doprint(house.name)end
SetHouseOwner
-- @param houseID (int): The identifier of the house.-- @param source (int): The player sourceexports['origen_housing']:setHouseOwner(houseID, source)
Establishes the player as the owner of the house.
Example:
local houseID =1local success = exports['origen_housing']:setHouseOwner(houseID, source)if success thenprint('House ownership assigned successfully.')elseprint('Failed to assign house ownership.')end