Exports
With these exports, you will be able to manipulate the system from scripts external to it.
Client Exports
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.
Server Exports
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 _, houseID in ipairs(ownedHouses) do
local house = exports['origen_housing']:getHouse(houseID)
if house then
print(house.name)
end
end
SetHouseOwner
-- @param houseID (int): The identifier of the house.
-- @param source (int): The player source
exports['origen_housing']:setHouseOwner(houseID, source)
Establishes the player as the owner of the house.
Example:
local houseID = 1
local success = exports['origen_housing']:setHouseOwner(houseID, source)
if success then
print('House ownership assigned successfully.')
else
print('Failed to assign house ownership.')
end
RegisterHook
-- @param eventName (string): Name of hook event
-- @param options (table): Table of hook options
exports.origen_housing:registerHook(eventName, function(payload)
end, options)
Last updated