Hooks
Event hooks let third-party resources add new behavior to the housing system without modifying its core code, ensuring flexibility and maintainability. They are for server-side use only.
RegisterHook
exports.origen_housing:registerHook(eventName, function(payload)
end, options)eventName:
stringpayload:
tableoptions?:
tableprint?:
booleanPrint to the console when triggering the event.
ownerFilter?:
{ [string]: true }The event will only trigger for owners defined as keys in a set.
houseFilter?:
{ [number]: true }The event will only trigger for houses defined as keys in a set.
zoneFilter?:
{ [string]: true }The event will only trigger for zone defined as keys in a set.
propFilter?:
{ [string]: true }The event will only trigger for props defined as keys in a set.
userFilter?:
{ [string]: true }The event will only trigger for identifiers defined as keys in a set.
Return:
hookId:
number
RemoveHooks
id?: number
Hooks events
BuyHouse
This event is triggered when a house is purchased or the setHouseOwner export is used.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numbercount:
number: Number of player's housespayMethod:
stringprice:
numberisSetOwner:
boolean
Example:
AddHolder
This event is executed when an attempt is made to add a keyholder to the house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberidentifier:
stringpayMethod:
stringname:
stringisSetOwner:
booleanowner:
string
Example:
RemoveHolder
This event is executed when an attempt is made to remove a keyholder from the house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberowner:
stringidentifier:
string
Example:
CreateDoor
This hook is triggered when an attempt is made to create a new door in a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numbername:
stringtype:
stringowner:
stringidentifier:
string
Example:
DeleteDoor
This hook is triggered when an attempt is made to delete a door from a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberid:
numberowner:
stringidentifier:
string
Example:
OpenDoor
This hook is triggered when an attempt is made to open a door in a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberid:
numberowner:
stringidentifier:
string
Example:
UpdateLight
This hook is triggered when an attempt is made to update a house's lighting.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberpropId:
stringzone:
stringowner:
stringpropModel:
stringidentifier:
string
Example:
UpdateBoard
This hook is triggered when an attempt is made to update a board within the house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberpropId:
stringurl:
stringzone:
stringowner:
stringpropModel:
stringidentifier:
string
Example:
BuyFurniture
This hook is triggered when an attempt is made to purchase furniture for a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberpropId:
stringzone:
stringowner:
stringpropModel:
stringprice:
numberidentifier:
string
Example:
UpdateFurniture
This hook is triggered when an attempt is made to update existing furniture in a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberpropId:
stringzone:
stringowner:
stringpropModel:
stringidentifier:
string
Example:
DeleteFurniture
This hook is triggered when an attempt is made to remove furniture from a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberpropId:
stringzone:
stringowner:
stringpropModel:
stringprice:
numberidentifier:
string
Example:
BuyUpgrade
This hook is triggered when an attempt is made to purchase an upgrade for a house.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberupgrade:
stringzone:
stringowner:
stringprice:
numberidentifier:
string
Example:
BuyHouseUpgrade
This hook is triggered when an attempt is made to purchase a house style upgrade.
By returning false, you can cancel the action.
payload
source:
numberhouseID:
numberstyle:
stringowner:
stringprice:
numberidentifier:
string
Example:
Last updated