mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
feat(esx_property): Optional Zone Based Pricing
This commit is contained in:
@@ -936,12 +936,15 @@ RegisterNetEvent("esx_property:CreateProperty", function()
|
||||
local Pcoords = GetEntityCoords(ESX.PlayerData.ped)
|
||||
local StreetHash = GetStreetNameAtCoord(Pcoords.x, Pcoords.y, Pcoords.z)
|
||||
local StreetName = GetStreetNameFromHashKey(StreetHash)
|
||||
local Zone = GetZoneAtCoords(Pcoords.x, Pcoords.y, Pcoords.z)
|
||||
local ZoneScum = GetZoneScumminess(Zone)
|
||||
local SuggestedPrice = Config.ZonePriceOptions.Enabled and Config.ZonePriceOptions.Default * Config.ZonePrices[ZoneScum] or nil
|
||||
HouseData = {}
|
||||
local Property = {{unselectable = true, icon = "fas fa-plus", title = _U("menu_title")},
|
||||
{value = 0, title = _U("element_title1"), icon = "fas fa-list-ol", description = _U("element_description1"), input = true,
|
||||
inputType = "number", inputPlaceholder = "Number...", inputValue = nil, inputMin = 1, inputMax = 90000, index = "hnumber"},
|
||||
{title = _U("element_title2"), icon = "fas fa-dollar-sign", input = true, inputType = "number",description = _U("element_description2"),
|
||||
inputPlaceholder = "Price...", inputValue = nil, inputMin = 1, inputMax = 50000000, index = "price"},
|
||||
inputPlaceholder = "Price...", inputValue = SuggestedPrice, inputMin = 1, inputMax = 900000000, index = "price"},
|
||||
{title = _U("element_title3"), description = _U("element_description3"), icon = "fas fa-home", index = "interior"},
|
||||
{title = _U("element_title4"), description = _U("element_description4"), icon = "fas fa-warehouse", value = {enabled = false},
|
||||
index = "garage", disabled = not (Config.Garage.Enabled)},
|
||||
|
||||
@@ -16,6 +16,23 @@ Config.CanCustomiseInventoryAndWardrobePositions = true -- Allow users to custom
|
||||
Config.WipeCustomNameOnSell = true -- Wipe custom name on sell Default: true
|
||||
Config.WipeFurnitureOnSell = true -- Wipe custom name on sell Default: true
|
||||
|
||||
|
||||
--------------------- Zone Suggested Prices ---------------------------------
|
||||
Config.ZonePriceOptions = {
|
||||
Enabled = true, -- Enable/Disable Zone Prices Modifiers Default: true
|
||||
Default = 250000, -- Default Price of a property Default: 250000
|
||||
}
|
||||
|
||||
-- The Amount to Multiply the Default Price by (if the above is enabled):
|
||||
Config.ZonePrices = {
|
||||
[0] = 10, -- Posh
|
||||
[1] = 7, -- Nice
|
||||
[2] = 5, -- Above Average
|
||||
[3] = 3, -- Bellow Average
|
||||
[4] = 2, -- Crap
|
||||
[5] = 1, -- Scum
|
||||
}
|
||||
|
||||
--------------------- Raid Settings ---------------------------------
|
||||
Config.Raiding = {
|
||||
Enabled = true, -- Enable/Disable Raiding Default: true
|
||||
|
||||
Reference in New Issue
Block a user