From 7ceaa97b5f82a9546259202e2fde5d642f423307 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 31 Jan 2026 02:44:07 -0700 Subject: [PATCH] - add locales, fix cornerselling --- locales/en.json | 4 +++- server/cornerselling.lua | 12 ++++++------ server/functions.lua | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/locales/en.json b/locales/en.json index bbd4a31..2b7feb1 100644 --- a/locales/en.json +++ b/locales/en.json @@ -265,7 +265,9 @@ "cannabisIcon": "fa-solid fa-cannabis", "itemDoesntExistWarn": "Player: %s attempted to exploit the weed salesman event by trying to purchase an item that does not exist in the weed salesman: %s", "invalidTableWarn": "Player: %s attempted to exploit the weed event by triggering the event with an invalid recipe table butter/oil.", - "recipeDoesntExistWarn": "Player: %s attempted to exploit the weed event by triggering the event with a non existent recipe name: %s." + "recipeDoesntExistWarn": "Player: %s attempted to exploit the weed event by triggering the event with a non existent recipe name: %s.", + "targetMakeButter": "Make Edible Products", + "targetMakeOil": "Make Oil" }, "wholesale": { diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 4c14d12..1645ed8 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -55,7 +55,7 @@ Bridge.Callback.Register('md-drugs:server:cornerselling:getAvailableDrugs', func if count >= 1 then local maths = math.random(1,100) - if maths <= Config.CornerSelling.config.robChance then + if maths <= Config.Cornerselling.config.robChance then beingRobbed(source, k, count, ped) soldPeds[src][ped] = {item = k, amount = count} return 'robbed' @@ -123,12 +123,12 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price AddRep(src, 'cornerselling', Config.Cornerselling.Drugs[item].rep * amount) DrugDeals[src] = nil - if Config.CornerSelling.config.MarkedBills then + if Config.Cornerselling.config.MarkedBills then Bridge.Inventory.AddItem(src, 'markedbills', price, nil, {worth = price}) return end - if Config.CornerSelling.config.CustomItem ~= '' then - Bridge.Inventory.AddItem(src, Config.CornerSelling.config.CustomItem, price) + if Config.Cornerselling.config.CustomItem ~= '' then + Bridge.Inventory.AddItem(src, Config.Cornerselling.config.CustomItem, price) return end Bridge.Framework.AddAccountBalance(src, 'cash', price) @@ -150,8 +150,8 @@ end) RegisterCommand('cornersell', function(source, args, raw) local src = source - if #Bridge.Framework.GetPlayersByJob('police') < Config.CornerSelling.config.policeRequired then - Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Cornerselling.notEnoughCops', Config.CornerSelling.config.policeRequired - #Bridge.Framework.GetPlayersByJob('police')), 'error') + if #Bridge.Framework.GetPlayersByJob('police') < Config.Cornerselling.config.policeRequired then + Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Cornerselling.notEnoughCops', Config.Cornerselling.config.policeRequired - #Bridge.Framework.GetPlayersByJob('police')), 'error') return end TriggerClientEvent('md-drugs:client:cornerselling', src) diff --git a/server/functions.lua b/server/functions.lua index 9857aef..17318e2 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -92,9 +92,9 @@ local function handleFresh(source) heroin = 0, dealerrep = 0, cornerselling = { - price = Config.CornerSellLevel[1].price, + price = Config.Cornerselling.CornerSellLevel[1].price, rep = 0, - label = Config.CornerSellLevel[1].label, + label = Config.Cornerselling.CornerSellLevel[1].label, level = 1 } }