Origen Network Store
  • 👋Welcome to Origen Network Store
  • 🆘¿You need help?
  • ❓FAQS
  • 👮Origen Police
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • Pma-Voice
    • 📙Guide of Use
      • 💻Police CAD
        • Dispatch
        • Citizen Search
        • Reports
        • Vehicles
        • Criminal Code
        • Search and Capture
        • Debtors
        • Federal Management
        • Agent Management
        • Security Cameras
        • Radio
        • Time Control
        • Operations
      • 📄Interaction Menu
      • 📹Vehicle Radar
      • 🚔Sirens System
      • 🔦Evidence System
      • 🎛️Mini Dispatch
      • 🚁Helicopter Camera
      • 🪪Badges
      • ⛓️Federal System
      • 🔫Holster
      • 🐕K9 Dog
    • ❓Frequent Questions
    • ⚙️Configuration
      • Framework
      • Armoury
      • Commands
      • Confiscate
      • Evidences
      • Federal
      • Holster
      • K9
      • Licenses
      • Markers
      • Names
      • Outfits
      • Permissions
      • Props
      • Radio
      • Vehicles
    • #️⃣Exports
      • Client Exports
      • Server Exports
  • 📻Origen Radio
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • Pma-Voice
    • ⚙️Configuration
  • 🛠️Origen Admin
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
  • 🏎️Origen Races
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • #️⃣Exports
      • Client Exports
  • 🔫Origen Ilegal
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
      • qb-inventory
    • 💬Commands
    • ♻️Exports
  • 🏚️Origen Housing
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • ⚙️API
      • Exports
      • Hooks
      • Events
      • Scripts Support
        • 📱LB-Phone
  • 🚙Origen Parking
    • ⚠️Dependencies
    • 🔧Installation
      • QBCore SQL
      • ESX SQL
    • ⚙️Configuration
    • ♻️Exports
  • 💼origen_inventory
    • ⚠️Dependencies
    • 🔧Installation
      • SQL
    • ⛏️Scripts Support
      • 📱LB Phone
        • 2️From v2.1.14
      • 🏨QB Apartments
      • 🔫QB-Weapons
      • 🔨Jobs creator (Jaksam)
    • ♻️Exports
      • 🛥️Client Exports
      • ⚓Server
        • Hooks
    • How to
  • 🕵️‍♂️origen_hostage
    • 🔧Installation
  • 👷‍♂️Origen Masterjob
    • 🔧Installation
      • SQL
      • qb-inventory
      • qs-inventory
      • ox_inventory
    • ♻️Exports
  • ⌨️Origen Chat
    • 🔧Installation
    • ⚙️API
      • Exports
      • Events
  • QBCORE
    • 🍔origen_hud
      • ❔¿What is origen_hud?
      • 🔧Installations origen_hud
      • ❓FAQS origen_hud
    • 💬origen_notify
      • ❔¿What is origen_notify?
      • 🔧Installations origen_notify
      • ❓FAQS origen_notify
        • 🥬Snippets origen_notify
    • ⏸️origen_pausemenu
      • ❔¿What is origen_pausemenu?
      • 🔧Installations origen_pausemenu
      • ❓FAQS origen_pausemenu
      • 🔑EXPORTS origen_pausemenu
    • 🥷origen_blackmarket
      • ❔¿What is origen_blackmarket?
      • 🔧Installations origen_blackmarket
      • ❓FAQS origen_blackmarket
      • 🥬Snippets origen_blackmarket
    • 🧑‍🤝‍🧑origen_titlemenu
      • ❔¿What is origen_titlemenu?
      • 🔧Installations origen_titlemenu
      • ❓FAQS origen_titlemenu
      • 🥬Snippets origen_titles (soon)
    • 🚗origen_importheist
      • ❔¿What is origen_importheist?
      • 🔧Installations origen_importheist
      • ❓FAQS origen_importheist
      • 🥬Snippets origen_importheist (soon)
  • ESX
    • 🍔origen_hud
      • ❔¿What is origen_hud?
      • 🔧Installations origen_hud
      • ❓FAQS origen_hud
    • 💬origen_notify
      • ❔¿What is origen_notify?
      • 🔧Installations origen_notify
      • ❓FAQS origen_notify
      • 🥬Snippets origen_notify
    • ⏸️origen_pausemenu
      • ❔¿What is origen_pausemenu?
      • 🔧Installations origen_pausemenu
      • ❓FAQS origen_pausemenu
      • 🔑EXPORTS origen_pausemenu
    • 🧑‍🤝‍🧑origen_titlemenu
      • ❔¿What is origen_titlemenu?
      • 🔧Installations origen_titlemenu
      • ❓FAQS origen_titlemenu
      • 🥬Snippets origen_titles (soon)
    • 🚗origen_importheist
      • ❔¿What is origen_importheist?
      • 🔧Installations origen_importheist
      • ❓FAQS origen_importheist
      • 🥬Snippets origen_importheist (soon)
Powered by GitBook
On this page
  • RegisterHook
  • RemoveHooks
  • Hooks events
  • BuyHouse
  • AddHolder
  • RemoveHolder
  • CreateDoor
  • DeleteDoor
  • OpenDoor
  • UpdateLight
  • UpdateBoard
  • BuyFurniture
  • UpdateFurniture
  • DeleteFurniture
  • BuyUpgrade
  • BuyHouseUpgrade
  1. Origen Housing
  2. API

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: string

  • payload: table

  • options?: table

    • print?: boolean

      • Print 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


exports.origen_housing:removeHooks(id)

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: number

    • houseID: number

    • count: number: Number of player's houses

    • payMethod: string

    • price: number

    • isSetOwner: boolean

Example:

local hookId = exports.origen_housing:registerHook('buyHouse', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • identifier: string

    • payMethod: string

    • name: string

    • isSetOwner: boolean

    • owner: string

Example:

local hookId = exports.origen_housing:registerHook('addHolder', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    userFilter = { ['identifier1'] = true, ['identifier2'] = true },
    ownerFilter = { ['ownerIdentifier'] = true },
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • owner: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('removeHolder', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    userFilter = { ['identifier1'] = true, ['identifier2'] = true },
    ownerFilter = { ['ownerIdentifier'] = true },
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • name: string

    • type: string

    • owner: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('createDoor', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    userFilter = { ['identifier1'] = true, ['identifier2'] = true },
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • id: number

    • owner: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('deleteDoor', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    userFilter = { ['identifier1'] = true, ['identifier2'] = true },
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • id: number

    • owner: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('openDoor', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    userFilter = { ['identifier1'] = true, ['identifier2'] = true },
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • propId: string

    • zone: string

    • owner: string

    • propModel: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('updateLight', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    zoneFilter = { ['exterior'] = true },
    propFilter = { ['lamp_model'] = true },
})

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: number

    • houseID: number

    • propId: string

    • url: string

    • zone: string

    • owner: string

    • propModel: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('updateBoard', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    zoneFilter = { ['interior'] = true, ['exterior'] = true },
    propFilter = { ['board_model'] = true },
})

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: number

    • houseID: number

    • propId: string

    • zone: string

    • owner: string

    • propModel: string

    • price: number

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('buyFurniture', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    ownerFilter = { ['owner123'] = true },
    propFilter = { ['sofa_model'] = true, ['table_model'] = true },
})

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: number

    • houseID: number

    • propId: string

    • zone: string

    • owner: string

    • propModel: string

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('updateFurniture', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    houseFilter = { [505] = true, [606] = true },
    propFilter = { ['bed_model'] = true },
})

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: number

    • houseID: number

    • propId: string

    • zone: string

    • owner: string

    • propModel: string

    • price: number

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('deleteFurniture', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    ownerFilter = { ['owner456'] = true },
    zoneFilter = { ['interior'] = true },
    propFilter = { ['chair_model'] = true },
})

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: number

    • houseID: number

    • upgrade: string

    • zone: string

    • owner: string

    • price: number

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('buyUpgrade', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    houseFilter = { [101] = true, [202] = true },
})

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: number

    • houseID: number

    • style: string

    • owner: string

    • price: number

    • identifier: string

Example:

local hookId = exports.origen_housing:registerHook('buyHouseUpgrade', function(payload)
    print(json.encode(payload, { indent = true }))
    return false
end, {
    print = true,
    houseFilter = { [303] = true, [404] = true },
})
PreviousExportsNextEvents

Last updated 3 months ago

🏚️
⚙️