Skip to main content

ESX

This is the default configuration for ESX

V2​

config/config.lua
function HelpText(show, message)
if show then
-- exports['ataUI']:openText('e', message, 'light', 'blue', 'blue')
-- TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
-- lib.showTextUI(message)
ESX.TextUI(message)
-- exports['okokTextUI']:Open(message, 'lightblue', 'right')
-- exports['qb-core']:DrawText(message)
-- exports['bcs_hud']:displayHelp(message)
else
-- exports['ataUI']:closeText()
-- TriggerEvent('cd_drawtextui:HideUI')
-- lib.hideTextUI()
ESX.HideUI()
-- exports['okokTextUI']:Close()
-- exports['qb-core']:HideText()
-- exports['bcs_hud']:closeHelp()
end
end

function Notify(title, message, type, duration)
-- ===== QB uncomment below =====
-- if type == 'info' or type == 'warning' then
-- type = 'primary'
-- end
-- QBCore.Functions.Notify(message, type, duration)
-- ===== QB uncomment above ======

-- exports['ataUI']:Alert({
-- Theme='dark',
-- Type=type,
-- title=title,
-- msg=message,
-- time=duration
-- })
-- exports['bcs_hud']:SendAlert(title, message, type, duration)
-- exports['okokNotify']:Alert(title, message, duration, type)
ESX.ShowNotification(message)
end

function debugPrint(...)
if Config.debug then
print(...)
end
end

RegisterNetEvent('Housing:notify', Notify)

Config = {
framework = 'ESX', -- ESX or QB or custom
target = false,
debug = false,
-- options are:
-- ox_inventory
-- qs-inventory
-- qb-inventory
-- lj-inventory
-- core_inventory
-- chezza
Inventory = "ox_inventory",
DefaultAccount = 'bank', -- for buying house and furnitures
DefaultSlots = 10, -- Default slots for inventory
SaveDoorsWhenSold = true, -- When MLO is sold, should the door locks persist?
AutoLock = false, -- Auto lock doors when you exit a shell or ipl (if house is empty & person haskey)
EnableLastProperty = true, -- When players logout inside a shell or IPL, they will login inside it
LimitKeys = 4, -- maximum amount of keys per house that can be duplicated
LimitHouses = 0, -- maximum amount of players owned houses, if 0 then no limit is placed
exportname = {
es_extended = "es_extended",
qtarget = 'qtarget',
qbtarget = 'qb-target',
ox_target = 'ox_target'
},
useDataStore = false, -- For ESX, saving wardrobe/outfit in esx_datastore
furnitureStorage = true, -- if false, use /setstorage to set the storage in your home
sellFurniturePercentage = 50, -- Selling unused furniture for half price (50%)
keybinds = {
lockdoor = 'E'
},
AdminGroups = { -- admins can make houses
'superadmin',
'admin',
'moderator'
},
EnableMarkers = {
enable = false, -- enable marker (small decrease in performance)
type = 20, -- the marker type
color = { r = 237, g = 170, b = 26 },
size = { x = 1.0, y = 1.0, z = 1.0 },
},
creation = {
MaxFrontyardDistance = 100, -- Maximum distance of the frontyard point from the entry point of the house
},
robbery = {
enable = true,
lockpickItem = 'lockpick',
alertAfterFailed = 5, -- Alert police after certain amount of times
alertLockpick = true, -- Alert owner and key owners when house is lockpicked
alertNonOwnerEntering = true, -- Alert owner and key owners when non-owner enters the house
storageLockpick = true, -- Requires non owner to lockpick storage before accessing it
storageRobbery = true, -- Disable stash robbery or non owner to access it
alertPolice = true, -- Alert police if lockpick succeed
minPolice = 0, -- Minimum police to do a lockpick
enableRaid = true, -- Police raid
offlineRobbery = false, -- Enable robbery even if the owner of the house is offline
policeName = {
['police'] = 2,
['bcso'] = 2
}, -- Police job name and minimum grade
},
rent = {
rentCheckTimer = 10 * 60, -- Check Rent every 10 minute
rentTimer = 1, -- pay rent per day in example every 1 day
paymentAccount = 'bank', -- account for manual payment
autoRemove = 2 * 7, -- this will remove the rented home after 2 weeks of no payment
autoPayment = true, -- auto pay rent when the player joins
autoPaymentAccount = 'bank',
deleteAfterAutoRemove = false -- Deletes the home after being revoked from the player
},
mortgage = {
checkTimer = 60 * 60, -- Check mortgage every 1 hour
weeks = 7, -- Days,
months = 30, -- Days,
paymentAccount = 'bank', -- account for manual payment
autoPaymentAccount = 'bank',
removeAfter = 7, -- Days
returnMoneyAfterRemoval = false,
deleteAfterAutoRemove = false
},
locksmith = {
enable = true,
locations = {
{
coords = vector4(158.1572, 6654.481, 31.66717, 131.2029),
ped = 's_m_y_dwservice_01',
sprite = 255,
colour = 44,
scale = 1.0,
label = 'Locksmith'
},
-- {
-- coords = vector4(-81.9154, -1329.2770, 29.2796, 101.5406),
-- ped = 's_m_y_dwservice_01',
-- sprite = 255,
-- colour = 44,
-- scale = 1.0,
-- label = 'Locksmith'
-- }
}
},
Blips = {
house_sell = {
enable = true,
sprite = 350,
colour = 43,
scale = 0.5,
label = 'House for Sale'
},
owned_house = {
enable = true,
sprite = 40,
colour = 60,
scale = 0.8,
},
owned_apartment = {
enable = true,
sprite = 475,
colour = 47,
scale = 0.8,
},
apartment_available = {
enable = true,
sprite = 475,
colour = 2,
scale = 0.8,
},
apartment_unavailable = {
enable = true,
sprite = 475,
colour = 76,
scale = 0.8,
},
},
-- CREDITS TO ESX_PROPERTY V2
CCTV = {
HeightAboveDoor = 1.5, -- Height above the door to place the cctv camera
FOV = 80.0, -- Camera Field of View
MaxLeftRotation = 80,
MaxZoom = 30,
MinZoom = 100,
MaxRightRotation = -50,
MaxUpRotation = 10,
MaxDownRotation = -45,
RotateSpeed = 0.3, -- Camera Rotation Speed
Controls = {
Left = 34, -- LEFT Arrow
Right = 35, -- RIGHT Arrow
Screenshot = 201, -- ENTER
NightVision = 38, -- E
ZoomIn = 96, -- UP Arrow
ZoomOut = 97, -- DOWN Arrow
Up = 32, -- UP Arrow
Down = 33, -- DOWN Arrow
Exit = 194, -- BACKSPACE
}
}
}

Config.SQLQueries = {}

V3​

bcs_housing/config/config.lua
function HelpText(show, message)
if show then
-- exports['ataUI']:openText('e', message, 'light', 'blue', 'blue')
-- TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
-- lib.showTextUI(message)
ESX.TextUI(message)
-- exports['okokTextUI']:Open(message, 'lightblue', 'right')
-- exports['qb-core']:DrawText(message)
-- exports['bcs_hud']:displayHelp(message)
else
-- exports['ataUI']:closeText()
-- TriggerEvent('cd_drawtextui:HideUI')
-- lib.hideTextUI()
ESX.HideUI()
-- exports['okokTextUI']:Close()
-- exports['qb-core']:HideText()
-- exports['bcs_hud']:closeHelp()
end
end

function Notify(title, message, type, duration)
-- ===== QB uncomment below =====
-- if type == 'info' or type == 'warning' then
-- type = 'primary'
-- end
-- QBCore.Functions.Notify(message, type, duration)
-- ===== QB uncomment above ======

-- exports['ataUI']:Alert({
-- Theme='dark',
-- Type=type,
-- title=title,
-- msg=message,
-- time=duration
-- })
-- exports['bcs_hud']:SendAlert(title, message, type, duration)
-- exports['okokNotify']:Alert(title, message, duration, type)
ESX.ShowNotification(message)
-- lib.notify({ title = title, description = message, type = type, duration = duration })
end

function debugPrint(...)
if Config.debug then
print(...)
end
end

RegisterNetEvent('Housing:notify', Notify)

Config = Config or {}

Config.framework = 'ESX' -- ESX or QB or custom
Config.target = false
Config.debug = true

-- options are:
-- ox_inventory
-- qs-inventory
-- qb-inventory
-- lj-inventory
-- core_inventory
-- chezza
Config.Inventory = 'qb-inventory'

Config.DefaultAccount = 'bank' -- for buying house and furnitures
Config.SaveDoorsWhenSold = true -- When MLO is sold, should the door locks persist?
Config.AutoLock = false -- Auto lock doors when you exit a shell or ipl (if house is empty & person haskey)
Config.EnableLastProperty = true -- When players logout inside a shell or IPL, they will login inside it
Config.LimitHouses = 0 -- maximum amount of players owned houses, if 0 then no limit is placed
Config.useDataStore = false -- For ESX, saving wardrobe/outfit in esx_datastore
Config.sellFurniturePercentage = 50 -- Selling unused furniture for half price (50%)

-- set either one of this up in your server.cfg
-- fivemanage
-- setr FIVEMANAGE_TOKEN fivemanagetoken
-- standalone
-- setr IMAGE_SERVER http://your.image.server.ip:5000
-- discord
-- setr SCREENSHOT_WEBHOOK your_webhook_link
-- offline
-- this method is for those who does not want to use image upload server
-- and put the image in the html folder instead
Config.Screenshot = 'standalone'

Config.exportname = {
es_extended = "es_extended",
qtarget = 'qtarget',
qbtarget = 'qb-target',
ox_target = 'ox_target'
}

Config.MaxDistance = {
Furniture = 100,
Freecam = 100,
FrontyardDistance = 100 -- Maximum distance of the area point from the entry point of the house
}

Config.FurnitureStorage = { -- Default values
slots = 10,
weight = 100000
}
Config.keybinds = {
lockdoor = 38, -- 'E'
}

Config.AdminGroups = { -- admins can make houses
'superadmin',
'admin',
'moderator'
}

Config.EnableMarkers = {
enable = false, -- enable marker (small decrease in performance)
type = 20, -- the marker type
color = { r = 237, g = 170, b = 26 },
size = { x = 1.0, y = 1.0, z = 1.0 },
}

Config.configuration = {
DefaultMaxStorage = 3,
LimitWardrobes = 2, -- maximum amount of wardrobe marker placement
LimitKeys = 4, -- maximum amount of keys per house that can be duplicated
}

Config.DefaultOwnerPermission = {
sell = true,
transfer = true,
doorlock = false,
moveGarage = true
}

Config.robbery = {
enable = true,
lockpickItem = 'lockpick',
alertAfterFailed = 5, -- Alert police after certain amount of times
alertLockpick = true, -- Alert owner and key owners when house is lockpicked
alertNonOwnerEntering = true, -- Alert owner and key owners when non-owner enters the house
storageLockpick = true, -- Requires non owner to lockpick storage before accessing it
storageRobbery = true, -- Disable stash robbery or non owner to access it
alertPolice = true, -- Alert police if lockpick succeed
minPolice = 0, -- Minimum police to do a lockpick
enableRaid = true, -- Police raid
offlineRobbery = false, -- Enable robbery even if the owner of the house is offline
policeName = {
['police'] = 2,
['bcso'] = 2
}, -- Police job name and minimum grade
}

Config.rent = {
rentCheckTimer = 10 * 60, -- Check Rent every 10 minute
rentTimer = 1, -- pay rent per day in example every 1 day
paymentAccount = 'bank', -- account for manual payment
autoRemove = 2 * 7, -- this will remove the rented home after 2 weeks of no payment
autoPayment = false, -- auto pay rent when the player joins
autoPaymentAccount = 'bank',
deleteAfterAutoRemove = false -- Deletes the home after being revoked from the player
}

Config.mortgage = {
checkTimer = 60 * 60, -- Check mortgage every 1 hour
weeks = 7, -- Days,
months = 30, -- Days,
paymentAccount = 'bank', -- account for manual payment
autoPaymentAccount = 'bank',
removeAfter = 7, -- Days
returnMoneyAfterRemoval = false,
deleteAfterAutoRemove = false
}


Config.tax = {
enable = false,
account = 'bank', -- cash or money or bank
society = 'government',
percentage = 0.1,
}

Config.FurnitureShop = {
coords = vec3(2753.46, 3470.33, 56.0),
size = vec3(13.0, 4.0, 2.5),
rotation = 65.0,
-- Blip
label = 'Furniture Store',
sprite = 566,
colour = 27,
scale = 0.8,
-- Camera
furnitureSpawn = vec3(2769.7773, 3467.4678, 55.5595),
}

Config.Blips = {
house_sell = {
enable = true,
sprite = 350,
colour = 43,
scale = 0.5,
label = 'House for Sale'
},
-- For Admin to be able to see other player houses
admin_owned_house = {
label = 'Player House',
enable = true,
sprite = 40,
colour = 50,
scale = 0.6,
},
owned_house = {
enable = true,
sprite = 40,
colour = 60,
scale = 0.8,
},
apartment_sell = {
enable = true,
sprite = 476,
colour = 43,
scale = 0.5,
label = 'Apartment for Sale'
},
owned_apartment = {
enable = true,
sprite = 475,
colour = 60,
scale = 0.8,
},
owned_flat = {
enable = true,
sprite = 475,
colour = 47,
scale = 0.8,
},
flat_available = {
enable = true,
sprite = 476,
colour = 2,
scale = 0.8,
},
flat_unavailable = {
enable = true,
sprite = 475,
colour = 76,
scale = 0.8,
},
}

-- CREDITS TO ESX_PROPERTY V2
Config.CCTV = {
HeightAboveDoor = 1.5, -- Height above the door to place the cctv camera
FOV = 80.0, -- Camera Field of View
pitch = 40, -- up and down max
yaw = 100, -- left and rigth max
MaxLeftRotation = 80,
MaxZoom = 30,
MinZoom = 100,
MaxRightRotation = -50,
MaxUpRotation = 10,
MaxDownRotation = -45,
RotateSpeed = 0.3, -- Camera Rotation Speed
Controls = {
Left = 34, -- LEFT Arrow
Right = 35, -- RIGHT Arrow
Screenshot = 201, -- ENTER
NightVision = 38, -- E
ZoomIn = 96, -- UP Arrow
ZoomOut = 97, -- DOWN Arrow
Up = 32, -- UP Arrow
Down = 33, -- DOWN Arrow
Exit = 194, -- BACKSPACE
}
}

Config.IsometricFurnitures = {
'bathroom',
'bedroom',
'kitchen',
'living_room',
'others'
}

Config.SQLQueries = {}