diff --git a/config.lua b/config.lua index d048056c..9e716a49 100644 --- a/config.lua +++ b/config.lua @@ -112,4 +112,4 @@ for k,v in ipairs(Config.Towables) do Color = { r = 204, g = 204, b = 0 }, Type = -1 } -end +end \ No newline at end of file diff --git a/esx_mechanicjob.sql b/esx_mechanicjob.sql index fc98ce84..651cab5e 100644 --- a/esx_mechanicjob.sql +++ b/esx_mechanicjob.sql @@ -20,11 +20,11 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('mechanic',4,'boss','Patron',0,'{}','{}') ; -INSERT INTO `items` (name, label, `limit`) VALUES - ('gazbottle', 'bouteille de gaz', 11), - ('fixtool', 'outils réparation', 6), - ('carotool', 'outils carosserie', 4), - ('blowpipe', 'Chalumeaux', 10), - ('fixkit', 'Kit réparation', 5), +INSERT INTO `items` (name, label, weight) VALUES + ('gazbottle', 'bouteille de gaz', 2), + ('fixtool', 'outils réparation', 2), + ('carotool', 'outils carosserie', 2), + ('blowpipe', 'Chalumeaux', 2), + ('fixkit', 'Kit réparation', 3), ('carokit', 'Kit carosserie', 3) ; diff --git a/localization/en_esx_mecanojob.sql b/localization/en_esx_mecanojob.sql index 524338fc..038e2bf6 100644 --- a/localization/en_esx_mecanojob.sql +++ b/localization/en_esx_mecanojob.sql @@ -20,11 +20,11 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('mechanic',4,'boss','Boss',0,'{}','{}') ; -INSERT INTO `items` (name, label, `limit`) VALUES - ('gazbottle', 'Gas Bottle', 11), - ('fixtool', 'Repair Tools', 6), - ('carotool', 'Tools', 4), - ('blowpipe', 'Blowtorch', 10), - ('fixkit', 'Repair Kit', 5), +INSERT INTO `items` (name, label, weight) VALUES + ('gazbottle', 'Gas Bottle', 2), + ('fixtool', 'Repair Tools', 2), + ('carotool', 'Tools', 2), + ('blowpipe', 'Blowtorch', 2), + ('fixkit', 'Repair Kit', 3), ('carokit', 'Body Kit', 3) ; diff --git a/localization/fi_esx_mecanojob.sql b/localization/fi_esx_mecanojob.sql index 66e013f3..c3dadaa5 100644 --- a/localization/fi_esx_mecanojob.sql +++ b/localization/fi_esx_mecanojob.sql @@ -20,11 +20,11 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('mechanic',4,'boss','Pomo',0,'{}','{}') ; -INSERT INTO `items` (name, label, `limit`) VALUES - ('gazbottle', 'Kaasupullo', 11), - ('fixtool', 'Korjaustyökalut', 6), - ('carotool', 'Työkalut', 4), - ('blowpipe', 'Polttoleikkuri', 10), - ('fixkit', 'Korjauskitti', 5), +INSERT INTO `items` (name, label, weight) VALUES + ('gazbottle', 'Kaasupullo', 2), + ('fixtool', 'Korjaustyökalut', 2), + ('carotool', 'Työkalut', 2), + ('blowpipe', 'Polttoleikkuri', 2), + ('fixkit', 'Korjauskitti', 3), ('carokit', 'Korikitti', 3) ; diff --git a/localization/pl_esx_mecanojob.sql b/localization/pl_esx_mecanojob.sql index a58b4bbf..b741fb45 100644 --- a/localization/pl_esx_mecanojob.sql +++ b/localization/pl_esx_mecanojob.sql @@ -20,11 +20,11 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('mechanic',4,'boss','Szef',0,'{}','{}') ; -INSERT INTO `items` (name, label, `limit`) VALUES - ('gazbottle', 'Butelka z gazem', 11), - ('fixtool', 'Zestaw do naprawy', 6), - ('carotool', 'Częsci naprawcze', 4), - ('blowpipe', 'Palnik', 10), - ('fixkit', 'Narzedzia naprawcze', 5), +INSERT INTO `items` (name, label, weight) VALUES + ('gazbottle', 'Butelka z gazem', 2), + ('fixtool', 'Zestaw do naprawy', 2), + ('carotool', 'Częsci naprawcze', 2), + ('blowpipe', 'Palnik', 2), + ('fixkit', 'Narzedzia naprawcze', 3), ('carokit', 'Części blacharskie', 3) ; diff --git a/localization/sv_esx_mecanojob.sql b/localization/sv_esx_mecanojob.sql index a4d3bd69..181d3ad7 100644 --- a/localization/sv_esx_mecanojob.sql +++ b/localization/sv_esx_mecanojob.sql @@ -20,11 +20,11 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('mechanic',4,'boss','Ägare',0,'{}','{}') ; -INSERT INTO `items` (name, label, `limit`) VALUES - ('gazbottle', 'Gas Flaska', 11), - ('fixtool', 'Reparationsverktyg', 6), - ('carotool', 'Verktyg', 4), - ('blowpipe', 'Blåslampa', 10), - ('fixkit', 'Reparationssats', 5), +INSERT INTO `items` (name, label, weight) VALUES + ('gazbottle', 'Gas Flaska', 2), + ('fixtool', 'Reparationsverktyg', 2), + ('carotool', 'Verktyg', 2), + ('blowpipe', 'Blåslampa', 2), + ('fixkit', 'Reparationssats', 3), ('carokit', 'Karosskit', 3) ; diff --git a/server/main.lua b/server/main.lua index 5c18d441..604eb082 100644 --- a/server/main.lua +++ b/server/main.lua @@ -262,21 +262,20 @@ AddEventHandler('esx_mechanicjob:getStockItem', function(itemName, count) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mechanic', function(inventory) local item = inventory.getItem(itemName) - local sourceItem = xPlayer.getInventoryItem(itemName) -- is there enough in the society? if count > 0 and item.count >= count then -- can the player carry the said amount of x item? - if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('player_cannot_hold')) - else + if xPlayer.canCarryItem(itemName, count) then inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', count, item.label)) + xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) end else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) + xPlayer.showNotification(_U('invalid_quantity')) end end) end) @@ -299,10 +298,10 @@ AddEventHandler('esx_mechanicjob:putStockItems', function(itemName, count) xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) + xPlayer.showNotification(_U('invalid_quantity')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label)) + xPlayer.showNotification(_U('have_deposited', count, item.label)) end) end)