- big change, moved data to shared folder
This commit is contained in:
1 parent
fdc28723bc
commit
c7eca0285b
52 files changed
+1117
-1128
No files matched your search
+12
-69
@@ -8,64 +8,7 @@ local burners = {
|
||||
methburner = {'methbaggy'},
|
||||
}
|
||||
local active = {}
|
||||
local settings = {}
|
||||
|
||||
settings.WholesaleQuantityBonus = 0.05 -- 5% bonus per 10 units sold (up to 20%)
|
||||
settings.WholesaleMaxBonus = 0.20 -- Maximum 20% bonus
|
||||
settings.WholesaleMinQuantity = 5 -- Minimum quantity required for wholesale
|
||||
settings.WholesaleAmbushEnabled = true -- Enable or disable ambush on failed deals
|
||||
settings.WholesaleAmbushBase = 2 -- Base number of attackers on failed deals
|
||||
settings.WholesaleAmbushScale = true -- Scale number of attackers based on drug quantity
|
||||
settings.WholesaleAmbushTier1 = 10 -- Drug quantity threshold for 3 attackers
|
||||
settings.WholesaleAmbushTier2 = 20 -- Drug quantity threshold for 4 attackers
|
||||
settings.WholesaleAmbushTier3 = 30 -- Drug quantity threshold for 5 attackers
|
||||
settings.FailChance = 20 -- Percentage chance of ambush occurring on a failed deal
|
||||
settings.PoliceCount = 0 -- Minimum police required to initiate a wholesale deal
|
||||
local Price = {
|
||||
cokeburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
},
|
||||
crackburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
},
|
||||
lsdburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
},
|
||||
heroinburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
},
|
||||
xtcburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
},
|
||||
methburner = {
|
||||
min = 25,
|
||||
max = 50
|
||||
}
|
||||
}
|
||||
|
||||
settings.Locs = {
|
||||
vector4(-2352.32, 266.78, 165.3, 23.46),
|
||||
vector4(-1467.49, 874.01, 183.59, 298.45),
|
||||
vector4(-856.71, 874.26, 202.85, 205.3),
|
||||
vector4(950.58, -128.49, 74.42, 205.3),
|
||||
vector4(1152.71, -328.43, 69.21, 205.3),
|
||||
vector4(112.66, -1955.67, 20.75, 37.94),
|
||||
vector4(-544.4, -1684.8, 19.89, 252.07),
|
||||
vector4(-1185.02, -1805.4, 3.91, 184.83),
|
||||
vector4(-1641.4, -981.99, 7.58, 35.38),
|
||||
vector4(-1827.93, 782.36, 138.29, 219.99),
|
||||
vector4(-320.84, 2818.73, 59.45, 337.22),
|
||||
vector4(474.88, 2609.56, 44.48, 357.0),
|
||||
}
|
||||
Locations = Locations or {}
|
||||
|
||||
|
||||
GlobalState.MDDrugsLocations = Locations
|
||||
|
||||
for k, v in pairs (burners) do
|
||||
Bridge.Framework.RegisterUsableItem(k, function(source, item)
|
||||
@@ -74,7 +17,7 @@ for k, v in pairs (burners) do
|
||||
TriggerClientEvent("md-drugs:client:MarkLocation", src, active[source].location)
|
||||
return
|
||||
end
|
||||
if #Bridge.Framework.GetPlayersByJob('police') < settings.PoliceCount then
|
||||
if #Bridge.Framework.GetPlayersByJob('police') < Config.Wholesale.settings.PoliceCount then
|
||||
return Bridge.Notify.SendNotify(source, Bridge.Language.Locale('wholesale.not_enough_police'), 'error')
|
||||
end
|
||||
local itemCount, itemList = 0, {}
|
||||
@@ -85,7 +28,7 @@ for k, v in pairs (burners) do
|
||||
itemList[d] = amt
|
||||
end
|
||||
end
|
||||
if itemCount < settings.WholesaleMinQuantity then
|
||||
if itemCount < Config.Wholesale.settings.WholesaleMinQuantity then
|
||||
return Bridge.Notify.SendNotify(source, Bridge.Language.Locale('wholesale.not_enough_drugs'), 'error')
|
||||
end
|
||||
|
||||
@@ -93,21 +36,21 @@ for k, v in pairs (burners) do
|
||||
active[src] = {
|
||||
count = itemCount,
|
||||
itemList = itemList,
|
||||
location = settings.Locs[math.random(1, #settings.Locs)],
|
||||
price = math.random(Price[k].min, Price[k].max),
|
||||
location = Config.Wholesale.Locs[math.random(1, #Config.Wholesale.Locs)],
|
||||
price = math.random(Config.Wholesale.Price[k].min, Config.Wholesale.Price[k].max),
|
||||
drugType = k,
|
||||
ambush = math.random(1, 100) <= settings.FailChance and true or false,
|
||||
ambush = math.random(1, 100) <= Config.Wholesale.settings.FailChance and true or false,
|
||||
}
|
||||
if active[src].ambush and settings.WholesaleAmbushEnabled then
|
||||
active[src].attackerCount = settings.WholesaleAmbushBase
|
||||
if settings.WholesaleAmbushScale then
|
||||
if active[src].count > settings.WholesaleAmbushTier1 then
|
||||
if active[src].ambush and Config.Wholesale.settings.WholesaleAmbushEnabled then
|
||||
active[src].attackerCount = Config.Wholesale.settings.WholesaleAmbushBase
|
||||
if Config.Wholesale.settings.WholesaleAmbushScale then
|
||||
if active[src].count > Config.Wholesale.settings.WholesaleAmbushTier1 then
|
||||
active[src].attackerCount = active[src].attackerCount + 1
|
||||
end
|
||||
if active[src].count > settings.WholesaleAmbushTier2 then
|
||||
if active[src].count > Config.Wholesale.settings.WholesaleAmbushTier2 then
|
||||
active[src].attackerCount = active[src].attackerCount + 1
|
||||
end
|
||||
if active[src].count > settings.WholesaleAmbushTier3 then
|
||||
if active[src].count > Config.Wholesale.settings.WholesaleAmbushTier3 then
|
||||
active[src].attackerCount = active[src].attackerCount + 1
|
||||
end
|
||||
end
|
||||
@@ -132,7 +75,7 @@ RegisterNetEvent('md-drugs:server:SuccessSale', function(entity)
|
||||
return
|
||||
end
|
||||
local basePrice = active[src].price * active[src].count
|
||||
local bonusMultiplier = math.min(math.floor(active[src].count / 10) * settings.WholesaleQuantityBonus, settings.WholesaleMaxBonus)
|
||||
local bonusMultiplier = math.min(math.floor(active[src].count / 10) * Config.Wholesale.settings.WholesaleQuantityBonus, Config.Wholesale.settings.WholesaleMaxBonus)
|
||||
local totalPrice = math.floor(basePrice * (1 + bonusMultiplier))
|
||||
for k, v in pairs (active[src].itemList) do
|
||||
local has = Bridge.Inventory.GetItemCount(src, k) or 0
|
||||
|
||||
Reference in new issue
Block a user