Skip to content

🏠 Housing

Documentation related to the jo_housing script.

1. Installation

jo_housing works on all frameworks compatible with jo_libs (the list).

To install jo_housing :

  • Download the library: jo_libs
  • Unzip the folder and drop it in your resource folder
  • Download jo_housing from your account
  • Unzip the folder and drop it in your resource folder
  • Add this ensure in your server.cfg
    • ensure jo_libs
    • ensure jo_housing
  • This script uses the raw keys module, if you have any problem with the prompts you should set the keyboard layout
  • If you want to use house key item, you must add House Key Item in your inventory:

Congratulation, the Housing script is ready to be used!

WARNING

Be sure you have oxmysql ensure in your server.cfg

💡 No SQL File

The script automatically creates all necessary database tables during its first startup

🔗 Script requirements

Stable, Wagon and Wardrobe are not included. You have to link them with your other scripts.

2. Usage

Create / Update / Delete houses

The housing system provides an admin interface to manage properties on your server.

🔒 Permission Control (By job, grade,etc.)

By default, any player can use the /houseManager command to create and manage houses.
You can restrict access by using the canUseHouseManagerCommand filter to implement your own permission system.

Buying a house

Players can purchase or rent available houses throughout your server.

Using a house

Once you own a house, you can use its features and customize its interior.

💡 Key Mode Configuration

The Config.enableKeyMode setting affects how players access houses after creation:

Key Mode Enabled (enableKeyMode = true):

  • Players receive physical key items when they buy houses
  • House owners can purchase additional keys to give to other players
  • House owners can change locks, making all existing keys obsolete
  • Players must carry their key item to enter their house

Key Mode Disabled (enableKeyMode = false):

  • No physical key items exist in the game
  • House owners manage an access list of players who can enter
  • Access is controlled through the house management menu
  • Players don't need to carry any items to enter their house

This setting is configured in your server's Config.enableKeyMode and affects all houses on your server.

Browse through all available interior options for your housing system.
This gallery showcases the complete collection of interiors you can choose from when creating houses using the /houseManager command.

The gallery

4. Script Configuration

The Housing script is highly configurable to suit your server's needs. Configuration is split between the main settings and language translations.

WARNING

Rather than editing the original config files directly, you should make your changes in overwriteConfig.lua and overwriteLang.lua. This way, you can easily update the script without losing your customizations.

Configuration Files

  • Base configuration: shared/config.lua - Contains all default settings
  • Your customizations: overwriteConfig.lua - Override only the specific settings you want to change
  • Language file: shared/lang.lua - Contains all default translations
  • Your translations: overwriteLang.lua - Override only the specific translations you want to change

Language Configuration

The script supports full translation through the language system. To override any text in the script:

  1. Find the key you want to change in shared/lang.lua
  2. Add only that key to overwriteLang.lua with your new text

Example:

lua
-- In overwriteLang.lua
Lang.houseManagerTitle = "Property Manager"
Lang.buyHouseMoney = "Purchase with Cash"
Lang.rentPaidSuccessfully = "Rent paid successfully! Welcome home."

Available translation categories include:

  • General UI & Common Terms
  • Menu Titles & Subtitles
  • Prompts & Labels
  • Input Prompts
  • Notifications & Messages (success and error messages)

💡Only change the key you need to translate

You only need to include the specific keys you want to change in overwriteLang.lua. Don't copy the entire language file.

5. FAQ

It's raining in my house !

Weather effects (rain, snow) can appear inside interiors due to your framework's weather synchronization system. To fix this, you need to disable weather sync when players enter houses and re-enable it when they leave.

Solution: Use the housing script's server actions to control your framework's weather sync:

lua
-- Disable weather sync when entering a house
exports.jo_housing:registerAction('houseEntered', function(source, house, isVisiting)
    -- Example for different frameworks:
    
    -- VORP Framework
    TriggerClientEvent('vorp:updateWeatherSync', source, false)
    
    -- RSG Framework
    TriggerClientEvent('rsg-weathersync:client:DisableWeather', source)
    
    -- Custom framework - adjust to your weather sync resource
    TriggerClientEvent('your_weather_resource:disable', source)
end)

-- Re-enable weather sync when leaving a house  
exports.jo_housing:registerAction('houseLeft', function(source, house)
    -- Example for different frameworks:
    
    -- VORP Framework
    TriggerClientEvent('vorp:updateWeatherSync', source, true)
    
    -- RSG Framework  
    TriggerClientEvent('rsg-weathersync:client:EnableWeather', source)
    
    -- Custom framework - adjust to your weather sync resource
    TriggerClientEvent('your_weather_resource:enable', source)
end)

Reference: houseEntered action and houseLeft action

Can I add custom interiors ?

Yes! You can add your own custom interiors using the addInteriors filter. This allows you to integrate custom MLO interiors or propsets into the housing system.

How to add custom interiors:

lua
-- In your server-side resource or in jo_housing itself
exports.jo_housing:registerFilter('addInteriors', function(customInteriors)
    -- Add your custom interiors
    customInteriors.my_custom_cabin = {
        entries = {
            vec4(2.022125, -0.556265, 1.696404, 91.094)  -- Main door spawn point (relative to interior origin)
        },
        propset = "my_custom_cabin",     -- Interior propset/MLO name
        category = "shack",              -- Interior category (house, shack, manor, flat, rock_shack, worker)
        numberRoom = 2,                  -- Number of rooms in the interior
        insideDoors = {                  -- Optional: Interior working doors configuration
            { 
                model = "p_door04x", 
                position = vec3(0.062589, -4.6552873, 0.738253) 
            }
        }
    }
    
    customInteriors.luxury_penthouse = {
        entries = {
            vec4(0.0, 0.0, 2.0, 180.0)  -- Main door spawn point
        },
        propset = "luxury_penthouse_mlo",
        category = "manor",
        numberRoom = 8
        -- insideDoors is optional - omit if no working interior doors needed
    }
    
    return customInteriors
end)

Configuration Tips:

  • Set furniture limits for your custom interiors in Config.interiorsMaxFurnitures
  • Use /houseManager visit mode to test and preview your interior placement
  • Interior categories affect available furniture limits and UI organization

Reference: addInteriors filter in the Developer section

Can I add custom furnitures (props) ?

Yes! You can add custom furniture categories and props using the addFurnitures filter. This allows you to expand the available furniture options beyond the default categories.

How to add custom furniture:

lua
-- In your server-side resource or in jo_housing itself
exports.jo_housing:registerFilter('addFurnitures', function(customFurnitures)
    -- Add your custom furniture categories
    customFurnitures.custom_electronics = {
        "p_tv01x",
        "p_radio01x", 
        "p_lamp_handheld01x",
        "p_phonograph01x"
    }
    
    customFurnitures.outdoor_furniture = {
        "p_bench05x",
        "p_campfire01x",
        "p_tent01x",
        "p_waterbarrel01x"
    }
    
    customFurnitures.western_decor = {
        "p_spittoon01x",
        "p_horseshoe01x",
        "p_banjo01x"
    }
    
    return customFurnitures
end)

Don't forget to configure pricing: Add pricing for your custom categories in your overwriteConfig.lua:

lua
-- Configure pricing for custom furniture categories
Config.furnituresCategoriesPrices.custom_electronics = {
    money = 250,
    gold = 3
}

Config.furnituresCategoriesPrices.outdoor_furniture = {
    money = 75,
    gold = 1
}

-- You can also set specific prices for individual props
Config.furnituresPrices.p_tv01x = {
    money = 500,
    gold = 5
}

Reference: addFurnitures filter and Furniture Configuration in the Developer section

Can I disable the Build Mode ?

If you set the interior’s max furniture to 0 (zero), players won’t be able to add any furniture inside, effectively disabling build mode for that interior.

Example:

lua
-- Available interior categories: shack, rock_shack, house, flat, manor, worker
-- Default furniture limit for interior categories
Config.interiorsCategoriesMaxFurnitures = {
    default = 0,      -- Disable build mode for all interiors
    manor = 200         -- Except for the manor category
}

-- Specific furniture limits per interior ID
Config.interiorsMaxFurnitures = {
    jo_pai_house = 0, -- Disable build mode only for jo_pai_house
}
The prompts are not working !

If prompts aren't appearing or responding, this is usually related to key binding or keyboard layout issues. Here are the most common solutions:

Primary Solution - Keyboard Layout: This script uses the raw keys module. If you have problems with prompts, set the keyboard layout properly.

Additional Troubleshooting Steps:

  1. Check for Key Conflicts:

    • Other resources might be using the same keys
    • Review your Config.keys settings in overwriteConfig.lua
    • Try changing conflicting keys to different bindings
  2. Verify Distance Settings:

    • Make sure you're close enough to interact with objects
    • Check Config.distanceShowHousePrompt and related distance settings
    • Default house prompt distance is 2.5 meters
  3. Framework Compatibility:

    • Ensure your framework is compatible with jo_libs
    • Check that jo_libs is properly installed and started before jo_housing

6. For Developers

Actions

Actions are one of the two types of Hooks. They provide a way for running a function at a specific point in the execution of scripts. Callback functions for an Action do not return anything back to the calling Action hook. They are the counterpart to Filters.

Below is a complete list of all available actions in the jo_housing script.

Server accessibilityChanged

Triggered when house accessibility settings are changed.

lua
-- @param source - serverID of the house owner
-- @param house - the house object
-- @param accessibilityType - new accessibility type ("everyone", "list", or "onlyMe")
exports.jo_housing:registerAction('accessibilityChanged', function(source, house, accessibilityType)
    -- Your code here
end)

Server buildModeEntered

Triggered when a player enters build mode in their house.

lua
-- @param source - serverID of the player
exports.jo_housing:registerAction('buildModeEntered', function(source)
    -- Your code here
end)

Server dressingLocationSet

Triggered when a dressing room location is set in a house.

lua
-- @param source - serverID of the player
-- @param house - the house object
-- @param coords - coordinates of the dressing location
exports.jo_housing:registerAction('dressingLocationSet', function(source, house, coords)
    -- Your code here
end)

Server furnitureBought

Triggered when a player purchases furniture for their house.

lua
-- @param source - serverID of the player
-- @param house - the house object where furniture was bought
-- @param furniture - the furniture object that was purchased
exports.jo_housing:registerAction('furnitureBought', function(source, house, furniture)
    -- Your code here
end)

Server furnitureMoved

Triggered when furniture is moved within a house.

lua
-- @param source - serverID of the player
-- @param house - the house object containing the furniture
-- @param furnitureId - ID of the furniture that was moved
exports.jo_housing:registerAction('furnitureMoved', function(source, house, furnitureId)
    -- Your code here
end)

Server houseBought

Triggered when a player successfully purchases a house.

lua
-- @param source - serverID of the buyer
-- @param house - the house object that was purchased
exports.jo_housing:registerAction('houseBought', function(source, house)
    -- Your code here
end)

Server houseCreated

Triggered when a new house is created .

lua
-- @param source - serverID of the player who created the house
-- @param house - the newly created house object
exports.jo_housing:registerAction('houseCreated', function(source, house)
    -- Your code here
end)

Server houseDeleted

Triggered when a house is deleted .

lua
-- @param source - serverID of the player who deleted the house
-- @param house - the house object that was deleted
exports.jo_housing:registerAction('houseDeleted', function(source, house)
    -- Your code here
end)

Server houseEntered

Triggered when a player enters a house.

lua
-- @param source - serverID of the player
-- @param house - the house object being entered
-- @param isVisiting - boolean indicating if the player is visiting
exports.jo_housing:registerAction('houseEntered', function(source, house, isVisiting)
    -- Your code here
end)

Server houseKeyBought

Triggered when a new house key is purchased.

lua
-- @param source - serverID of the player buying the key
-- @param house - the house object
exports.jo_housing:registerAction('houseKeyBought', function(source, house)
    -- Your code here
end)

Server houseLeft

Triggered when a player leaves a house.

lua
-- @param source - serverID of the player
-- @param house - the house object being left
exports.jo_housing:registerAction('houseLeft', function(source, house)
    -- Your code here
end)

Server houseLocationMenuOpened

Triggered when a player opens the house location menu.

lua
-- @param source - serverID of the player
-- @param houses - array of nearby houses
exports.jo_housing:registerAction('houseLocationMenuOpened', function(source, houses)
    -- Your code here
end)

Server houseLockChanged

Triggered when a house lock is changed.

lua
-- @param source - serverID of the house owner
-- @param house - the house object
-- @param success - boolean indicating if lock change was successful
exports.jo_housing:registerAction('houseLockChanged', function(source, house, success)
    -- Your code here
end)

Server houseStorageOpened

Triggered when a player opens house storage.

lua
-- @param source - serverID of the player
-- @param house - the house object
-- @param invId - inventory ID that was opened
exports.jo_housing:registerAction('houseStorageOpened', function(source, house, invId)
    -- Your code here
end)

Server houseTransfered

Triggered when house ownership is transferred to another player.

lua
-- @param source - serverID of the current owner
-- @param toPlayerSrc - serverID of the new owner
-- @param house - the house object being transferred
-- @param transferDone - boolean indicating if transfer was successful
exports.jo_housing:registerAction('houseTransfered', function(source, toPlayerSrc, house, transferDone)
    -- Your code here
end)

Server houseUpdated

Triggered when an existing house is updated .

lua
-- @param source - serverID of the player who updated the house
-- @param house - the updated house object
-- @param changeset - table containing the changes made
exports.jo_housing:registerAction('houseUpdated', function(source, house, changeset)
    -- Your code here
end)

Server knockedOnHouse

Triggered when someone knocks on a house door.

lua
-- @param source - serverID of the player knocking
-- @param house - the house object being knocked on
-- @param foundSources - array of player sources inside the house who were notified
exports.jo_housing:registerAction('knockedOnHouse', function(source, house, foundSources)
    -- Your code here
end)
Rental & Keys Actions

Server playerAddedToHouse

Triggered when a player is added to a house's access list.

lua
-- @param source - serverID of the house owner
-- @param house - the house object
-- @param playerSrc - serverID of the player being added
-- @param playerName - name of the player being added
exports.jo_housing:registerAction('playerAddedToHouse', function(source, house, playerSrc, playerName)
    -- Your code here
end)

Server playerRemovedFromHouse

Triggered when a player is removed from a house's access list.

lua
-- @param source - serverID of the house owner
-- @param house - the house object
-- @param accessibilityId - ID of the access entry that was removed
-- @param success - boolean indicating if removal was successful
exports.jo_housing:registerAction('playerRemovedFromHouse', function(source, house, accessibilityId, success)
    -- Your code here
end)

Server storageLocationSet

Triggered when a storage location is set in a house.

lua
-- @param source - serverID of the player
-- @param house - the house object
-- @param coords - coordinates of the storage location
exports.jo_housing:registerAction('storageLocationSet', function(source, house, coords)
    -- Your code here
end)
Access Management Actions

Server rentPaid

Triggered when rent is paid for a house.

lua
-- @param source - serverID of the player paying rent
-- @param house - the house object
-- @param numPeriods - number of periods paid for
-- @param isDaily - boolean indicating if it's daily or weekly rent
-- @param totalPrice - total amount paid
-- @param moneyType - payment type (0 for money, 1 for gold)
-- @param success - boolean indicating if payment was successful
exports.jo_housing:registerAction('rentPaid', function(source, house, numPeriods, isDaily, totalPrice, moneyType, success)
    -- Your code here
end)

Filters

Filters allow you to modify data or control permissions during script execution. Introduced in v1.2.0, filters provide a synchronous way to intercept and modify script behavior at specific points, unlike events which are asynchronous.

Below is a complete list of all available filters in the jo_housing script.

Server addFurnitures

Allows you to add custom furniture categories and items to the housing system.

lua
-- @param customFurnitures - empty table by default
-- @return table - table with custom furniture categories
exports.jo_housing:registerFilter('addFurnitures', function(customFurnitures)
    -- Add your custom furniture categories
    customFurnitures.custom_electronics = {
        "p_tv01x",
        "p_radio01x", 
        "p_lamp_handheld01x"
    }
    
    customFurnitures.outdoor_furniture = {
        "p_bench05x",
        "p_campfire01x",
        "p_tent01x"
    }
    
    return customFurnitures
end)

💡 Custom Furniture Pricing

Don't forget to configure pricing for your custom categories in Config.furnituresCategoriesPrices or specific items in Config.furnituresPrices.

lua
-- In your overwriteConfig.lua
Config.furnituresCategoriesPrices.custom_electronics = {
    money = 250,
    gold = 3
}

Config.furnituresCategoriesPrices.outdoor_furniture = {
    money = 75,
    gold = 1
}

Server addInteriors

Allows you to add custom interior configurations to the housing system.

lua
-- @param customInteriors - empty table by default
-- @return table - table with custom interior configurations
exports.jo_housing:registerFilter('addInteriors', function(customInteriors)
    -- Add your custom interiors
    customInteriors.my_custom_cabin = {
        entries = {
            vec4(2.022125, -0.556265, 1.696404, 91.094)  -- Main door spawn point (relative to interior origin)
        },
        propset = "my_custom_cabin",     -- Interior propset/MLO name
        category = "shack",              -- Interior category (house, shack, manor, flat, rock_shack, worker)
        numberRoom = 2,                  -- Number of rooms in the interior
        insideDoors = {                  -- Optional: Interior working doors configuration
            { 
                model = "p_door04x", 
                position = vec3(0.062589, -4.6552873, 0.738253) 
            },
            { 
                model = "p_door04x", 
                position = vec3(-1.473662, -4.661302, 0.738253) 
            },
        }
    }
    
    customInteriors.luxury_penthouse = {
        entries = {
            vec4(0.0, 0.0, 2.0, 180.0)  -- Main door spawn point (relative to interior origin)
        },
        propset = "luxury_penthouse_mlo",
        category = "manor",
        numberRoom = 8
        -- insideDoors is optional - omit if no working interior doors needed
    }
    
    return customInteriors
end)

Interior Properties:

PropertyTypeRequiredDescription
entriestableArray containing the main door spawn point (vec4 with heading). Only the first entry is used, coordinates are relative to interior origin
propsetstringInterior propset/MLO resource name
categorystringInterior category: house, shack, manor, flat, rock_shack, worker
numberRoomnumberNumber of rooms in the interior
insideDoorstableOptional array of interior doors with model and position properties

💡 Interior Configuration

lua
-- In your overwriteConfig.lua
Config.interiorsMaxFurnitures.my_custom_cabin = 150
Config.interiorsCategoriesMaxFurnitures.luxury = 300  -- If you add a custom category

Server canAddPlayerToHouse

Controls who can add players to a house's access list.

lua
-- @param canAdd - boolean indicating if the action is allowed by default
-- @param source - serverID of the player adding someone
-- @param houseId - ID of the house
-- @param playerSrc - serverID of the player being added
-- @param playerName - name of the player being added
exports.jo_housing:registerFilter('canAddPlayerToHouse', function(canAdd, source, houseId, playerSrc, playerName)
    return canAdd
end)

Server canBuyFurniture

Controls who can buy furniture.

lua
-- @param canBuy - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param furniture - furniture model/object data
-- @param houseId - ID of the house
-- @param moneyType - payment type (0 for money, 1 for gold)
-- @param categoryKey - category key of the furniture
exports.jo_housing:registerFilter('canBuyFurniture', function(canBuy, source, furniture, houseId, moneyType, categoryKey)
    return canBuy
end)

Server canBuyHouse

Controls who can buy a house.

lua
-- @param canBuy - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house being purchased
-- @param moneyType - payment type (0 for money, 1 for gold)
-- @param period - for rentals, number of periods the player is paying for
exports.jo_housing:registerFilter('canBuyHouse', function(canBuy, source, houseId, moneyType, period)
    return canBuy
end)

Server canDeleteFurniture

Controls who can delete furniture from a house.

lua
-- @param canDelete - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param furnitureId - ID of the furniture
-- @param houseId - ID of the house
exports.jo_housing:registerFilter('canDeleteFurniture', function(canDelete, source, furnitureId, houseId)
    return canDelete
end)

Server canDeleteHouse

Controls who can delete houses.

lua
-- @param canDelete - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseData - table containing house data
exports.jo_housing:registerFilter('canDeleteHouse', function(canDelete, source, houseData)
    return canDelete
end)

Server canEnterBuildMode

Controls who can enter build mode in a house.

lua
-- @param canEnter - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house
exports.jo_housing:registerFilter('canEnterBuildMode', function(canEnter, source, houseId)
    return canEnter
end)

Server canEnterHouse

Controls who can enter a house.

lua
-- @param canEnter - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house being entered
exports.jo_housing:registerFilter('canEnterHouse', function(canEnter, source, houseId)
    return canEnter
end)

Server canMoveFurniture

Controls who can move furniture in a house.

lua
-- @param canMove - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param furnitureId - ID of the furniture
-- @param houseId - ID of the house
-- @param relPos - new relative position for the furniture
-- @param relRot - new relative rotation for the furniture
exports.jo_housing:registerFilter('canMoveFurniture', function(canMove, source, furnitureId, houseId, relPos, relRot)
    return canMove
end)

Server canOpenHouseLocationMenu

Controls who can open the house location menu.

lua
-- @param canOpen - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houses - array of nearby houses
exports.jo_housing:registerFilter('canOpenHouseLocationMenu', function(canOpen, source, houses)
    return canOpen
end)

Server canOpenHouseStorage

Controls who can open a house's storage.

lua
-- @param canOpenStorage - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house
exports.jo_housing:registerFilter('canOpenHouseStorage', function(canOpenStorage, source, houseId)
    return canOpenStorage
end)

Server canPlaceFurniture

Controls who can place furniture in a house.

lua
-- @param canPlace - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param furniture - furniture model/object data
-- @param houseId - ID of the house
-- @param relPos - relative position where furniture will be placed
-- @param relRot - relative rotation of the furniture
-- @param moneyType - payment type (0 for money, 1 for gold)
-- @param categoryKey - category key of the furniture
exports.jo_housing:registerFilter('canPlaceFurniture', function(canPlace, source, furniture, houseId, relPos, relRot, moneyType, categoryKey)
    return canPlace
end)

Server canRemovePlayerFromHouse

Controls who can remove players from a house's access list.

lua
-- @param canRemove - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house
-- @param accessibilityId - ID of the access entry to remove
exports.jo_housing:registerFilter('canRemovePlayerFromHouse', function(canRemove, source, houseId, accessibilityId)
    return canRemove
end)

Server canSetDressingLocation

Controls who can set a dressing room location inside a house.

lua
-- @param canSet - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house
-- @param coords - coordinates for the dressing location
exports.jo_housing:registerFilter('canSetDressingLocation', function(canSet, source, houseId, coords)
    return canSet
end)

Server canSetStorageLocation

Controls who can set a storage location inside a house.

lua
-- @param canSet - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house
-- @param coords - coordinates for the storage location
exports.jo_housing:registerFilter('canSetStorageLocation', function(canSet, source, houseId, coords)
    return canSet
end)

Server canTransferHouse

Controls who can transfer house ownership.

lua
-- @param canTransfer - boolean indicating if the action is allowed by default
-- @param source - serverID of the current owner
-- @param toPlayerSrc - serverID of the player receiving the house
-- @param houseId - ID of the house being transferred
exports.jo_housing:registerFilter('canTransferHouse', function(canTransfer, source, toPlayerSrc, houseId)
    return canTransfer
end)

Server canUpdateAccessibility

Controls who can update a house's accessibility settings.

lua
-- @param canUpdate - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param accessibilityType - type of access ("everyone", "list", or "onlyMe")
-- @param houseId - ID of the house
exports.jo_housing:registerFilter('canUpdateAccessibility', function(canUpdate, source, accessibilityType, houseId)
    return canUpdate
end)

Server canUpsertHouse

Controls who can create or update houses.

lua
-- @param canUpsert - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
-- @param houseId - ID of the house (nil for creation)
-- @param changesetOrHouseData - changes to apply or full house data for creation
exports.jo_housing:registerFilter('canUpsertHouse', function(canUpsert, source, houseId, changesetOrHouseData)
    return canUpsert
end)

Server canUseHouseManagerCommand

Controls who can use the /houseManager command to create and manage houses.

lua
-- @param canUse - boolean indicating if the action is allowed by default
-- @param source - serverID of the player
exports.jo_housing:registerFilter('canUseHouseManagerCommand', function(canUse, source)
    -- Example: Only allow admins
    local isAdmin = exports.your_permission_system:isAdmin(source)
    return isAdmin
end)
Example of job lock for VORP
lua
AllowedJobs = {
    houser = true,
    houseManager = true,
}

exports.jo_housing:registerFilter('canUseHouseManagerCommand', function(canUse, source)
    local job = jo.framework:getJob(source)
    if AllowedJobs[job] then
      return canUse
    else
      jo.notif.rightError("You don't have the right job to use the house manager")
      return false
    end
end)

Last updated: