Original post · 2y ago#1
[ATTACH type="full" alt="1705970505008.png"]12845[/ATTACH] 5Credit to debloque Chezza inventoryV4 open source, tested esx legacy V1.10.3 test possible ip connect: `connect game2.hebergtonserv.com:30120` [URL='https://drive.google.com/file/d/16ghJ6xxeNdWV0MdYQdZPYN75WLz2v8ad/view?usp=sharing']Link new version chezza inventory lock cfx[/URL] [URL='https://drive.google.com/file/d/19wU9Ivb5A7cf4rC1qIyJxyemWdX5OCpL/view?usp=sharing']Link chezza v3 open source[/URL] Addon link site web chezza Working getPlayerWeight and canCarryItem Exports [Only V4]
[/HR] [HEADING=2][/HEADING] Look for this: [ICODE]elseif action == 'search' then OpenBodySearchMenu(closestPlayer)[/ICODE] [HEADING=2][/HEADING] Replace the code above with this one: [ICODE]elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer))[/ICODE] [HEADING=2][/HEADING] For V4 replace with this one if you want to receive weapons: [ICODE]elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer), true)[/ICODE] 🦵 Disable run while inventory is full. ONLY V3 Hello hello my favorite community <3! This is a simple guide for disabling run while your inventory is full. IMPORTANT!!! This will only work if Config.PlayerWeight is ENABLED! First of all go to inventory/server/main.lua and paste this somewhere: [ICODE]ESX.RegisterServerCallback("inventory:isMax", function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) if not xPlayer then return end cb(xPlayer.getWeight() >= xPlayer.getMaxWeight())end)[/ICODE] Then go to inventory/client/main.lua and paste this somewhere: [ICODE]CreateThread(function() while true do Wait(1000) ESX.TriggerServerCallback("inventory:isMax", function(isMax) isAbleToRun = not isMax end) endend)[/ICODE] Ammunition as Items [V3 / V4] Only works with ESX 1.2 and above! [URL unfurl="true"]https://github.com/MSK-Scripts/msk_weaponammoitems[/URL] Don't forget to insert the items from config.lua to your database. Sqz_job support. ONLY V3 Support for Sqz_Unijobs! Make a new .lua file in inventory/client/plugins named as jobs.lua and add this to it [ICODE]RegisterNetEvent('inventory:openJobsInventory')AddEventHandler('inventory:openJobsInventory', function (Config) OpenInventory({ id = Config, type = 'Jobs', title = 'Job: '..Config, weight = 20000, save = true, timeout = 1000 })end)[/ICODE] And search for the function called OpenArmoryMenu() in sqz_unijobs/client/main.lua And replace for this: [ICODE]function OpenArmoryMenu(station) local elements = {} if Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyWeapon and ESX.PlayerData.job.grade >= Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyWeaponGrade then table.insert(elements, {label = _U('buy_weapon'), value = 'buy_weapons'}) end if Config.Jobs[ESX.PlayerData.job.name].Zones[station].OpenInventoryChezz then table.insert(elements, {label = 'Deposit', value = 'jobs_inventory'}) end if Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyItems then table.insert(elements, {label = _U('buy_items'), value = 'buy_items'}) end ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', { title = _U('armory'), align = Config.MenuAlign, elements = elements }, function(data, menu) if data.current.value == 'buy_weapons' then OpenBuyWeaponsMenu(station) elseif data.current.value == 'jobs_inventory' then TriggerEvent('inventory:openJobsInventory', ESX.PlayerData.job.name) elseif data.current.value == 'buy_items' then OpenBuyItemsMenu(station) end end, function(data, menu) menu.close() CurrentAction = 'menu_armory' CurrentActionData = {station = station} end)end [/ICODE] In config.lua, zones/armory add this in all jobs that you want to has inventory. of sqz_unijobs add this: [ICODE]OpenInventoryChezz = true[/ICODE] (Official Guide) Fix for throwables not updating on ESX Legacy [HEADING=3]In order to fix this issue head over to es_extended/client/main.lua ~385[/HEADING]
[/HR] [HEADING=2][/HEADING] Look for this: [ICODE]if IsPedArmed(ESX.PlayerData.ped, 4) then if IsPedShooting(ESX.PlayerData.ped) then local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) local weapon = ESX.GetWeaponFromHash(weaponHash) if weapon then currentWeapon.name = weapon.name currentWeapon.hash = weaponHash currentWeapon.timer = 100 * sleep end endelse sleep = 200end[/ICODE] [HEADING=2][/HEADING] [HEADING=2][/HEADING] Replace the code above with this one. [ICODE] if IsPedShooting(ESX.PlayerData.ped) then local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) local weapon = ESX.GetWeaponFromHash(weaponHash) if weapon then currentWeapon.name = weapon.name currentWeapon.hash = weaponHash currentWeapon.timer = 100 * sleep end end[/ICODE] Hello hello my favorite community <3! This is a simple fix for JerryCan/PetrolCan issue. Go to LegacyFuel/source/fuel_client.lua and find [ICODE]GiveWeaponToPed(ped, 883325847, 4500, false, true)[/ICODE] then replace it with: [ICODE]TriggerServerEvent('fuel:weapon')[/ICODE] Then go to LegacyFuel/source/fuel_server.lua and under the fuel:pay event add [ICODE]RegisterServerEvent('fuel:weapon') AddEventHandler('fuel:weapon', function() local _source = source local xPlayer = ESX.GetPlayerFromId(_source) xPlayer.addWeapon("weapon_petrolcan", 4500)end)[/ICODE] So your fuel_server.lua should look like this: [ICODE]ESX = nilif Config.UseESX then TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) RegisterServerEvent('fuel:pay') AddEventHandler('fuel:pay', function(price) local xPlayer = ESX.GetPlayerFromId(source) local amount = ESX.Math.Round(price) if price > 0 then xPlayer.removeMoney(amount) end end) RegisterServerEvent('fuel:weapon') AddEventHandler('fuel:weapon', function() local _source = source local xPlayer = ESX.GetPlayerFromId(_source) xPlayer.addWeapon("weapon_petrolcan", 4500) end)end[/ICODE] Best regards,
- https://musiker15.gitbook.io/chezza-studios/inventory-v4/exports/getweight
- https://musiker15.gitbook.io/chezza-studios/inventory-v4/exports/cancarry Export: clearInventory [Only V4] [HEADING=2]Usage[/HEADING] You can only use this export serverside! [ICODE]exports.inventory:clearInventory(xPlayer, deleteWeapons --[[boolean]])[/ICODE] Example [ICODE]exports.inventory:clearInventory(xPlayer, true) -- Will delete Weapons tooexports.inventory:clearInventory(xPlayer, false) -- Will not delete Weapons[/ICODE] [HEADING=2][/HEADING] [HEADING=2]Code[/HEADING] Add it at the bottom of inventory/plugins/players/sv_player.lua. exports('clearInventory', function(xPlayer, delWeapons) for k, v in pairs(xPlayer.inventory) do if v.count > 0 then xPlayer.setInventoryItem(v.name, 0) end end if delWeapons then for k, v in pairs(xPlayer.loadout) do xPlayer.removeWeapon(v.name) end endend)
[/HR] [HEADING=2][/HEADING] Look for this: [ICODE]elseif action == 'search' then OpenBodySearchMenu(closestPlayer)[/ICODE] [HEADING=2][/HEADING] Replace the code above with this one: [ICODE]elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer))[/ICODE] [HEADING=2][/HEADING] For V4 replace with this one if you want to receive weapons: [ICODE]elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer), true)[/ICODE] 🦵 Disable run while inventory is full. ONLY V3 Hello hello my favorite community <3! This is a simple guide for disabling run while your inventory is full. IMPORTANT!!! This will only work if Config.PlayerWeight is ENABLED! First of all go to inventory/server/main.lua and paste this somewhere: [ICODE]ESX.RegisterServerCallback("inventory:isMax", function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) if not xPlayer then return end cb(xPlayer.getWeight() >= xPlayer.getMaxWeight())end)[/ICODE] Then go to inventory/client/main.lua and paste this somewhere: [ICODE]CreateThread(function() while true do Wait(1000) ESX.TriggerServerCallback("inventory:isMax", function(isMax) isAbleToRun = not isMax end) endend)[/ICODE] Ammunition as Items [V3 / V4] Only works with ESX 1.2 and above! [URL unfurl="true"]https://github.com/MSK-Scripts/msk_weaponammoitems[/URL] Don't forget to insert the items from config.lua to your database. Sqz_job support. ONLY V3 Support for Sqz_Unijobs! Make a new .lua file in inventory/client/plugins named as jobs.lua and add this to it [ICODE]RegisterNetEvent('inventory:openJobsInventory')AddEventHandler('inventory:openJobsInventory', function (Config) OpenInventory({ id = Config, type = 'Jobs', title = 'Job: '..Config, weight = 20000, save = true, timeout = 1000 })end)[/ICODE] And search for the function called OpenArmoryMenu() in sqz_unijobs/client/main.lua And replace for this: [ICODE]function OpenArmoryMenu(station) local elements = {} if Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyWeapon and ESX.PlayerData.job.grade >= Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyWeaponGrade then table.insert(elements, {label = _U('buy_weapon'), value = 'buy_weapons'}) end if Config.Jobs[ESX.PlayerData.job.name].Zones[station].OpenInventoryChezz then table.insert(elements, {label = 'Deposit', value = 'jobs_inventory'}) end if Config.Jobs[ESX.PlayerData.job.name].Zones[station].BuyItems then table.insert(elements, {label = _U('buy_items'), value = 'buy_items'}) end ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', { title = _U('armory'), align = Config.MenuAlign, elements = elements }, function(data, menu) if data.current.value == 'buy_weapons' then OpenBuyWeaponsMenu(station) elseif data.current.value == 'jobs_inventory' then TriggerEvent('inventory:openJobsInventory', ESX.PlayerData.job.name) elseif data.current.value == 'buy_items' then OpenBuyItemsMenu(station) end end, function(data, menu) menu.close() CurrentAction = 'menu_armory' CurrentActionData = {station = station} end)end [/ICODE] In config.lua, zones/armory add this in all jobs that you want to has inventory. of sqz_unijobs add this: [ICODE]OpenInventoryChezz = true[/ICODE] (Official Guide) Fix for throwables not updating on ESX Legacy [HEADING=3]In order to fix this issue head over to es_extended/client/main.lua ~385[/HEADING]
[/HR] [HEADING=2][/HEADING] Look for this: [ICODE]if IsPedArmed(ESX.PlayerData.ped, 4) then if IsPedShooting(ESX.PlayerData.ped) then local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) local weapon = ESX.GetWeaponFromHash(weaponHash) if weapon then currentWeapon.name = weapon.name currentWeapon.hash = weaponHash currentWeapon.timer = 100 * sleep end endelse sleep = 200end[/ICODE] [HEADING=2][/HEADING] [HEADING=2][/HEADING] Replace the code above with this one. [ICODE] if IsPedShooting(ESX.PlayerData.ped) then local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) local weapon = ESX.GetWeaponFromHash(weaponHash) if weapon then currentWeapon.name = weapon.name currentWeapon.hash = weaponHash currentWeapon.timer = 100 * sleep end end[/ICODE] Hello hello my favorite community <3! This is a simple fix for JerryCan/PetrolCan issue. Go to LegacyFuel/source/fuel_client.lua and find [ICODE]GiveWeaponToPed(ped, 883325847, 4500, false, true)[/ICODE] then replace it with: [ICODE]TriggerServerEvent('fuel:weapon')[/ICODE] Then go to LegacyFuel/source/fuel_server.lua and under the fuel:pay event add [ICODE]RegisterServerEvent('fuel:weapon') AddEventHandler('fuel:weapon', function() local _source = source local xPlayer = ESX.GetPlayerFromId(_source) xPlayer.addWeapon("weapon_petrolcan", 4500)end)[/ICODE] So your fuel_server.lua should look like this: [ICODE]ESX = nilif Config.UseESX then TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) RegisterServerEvent('fuel:pay') AddEventHandler('fuel:pay', function(price) local xPlayer = ESX.GetPlayerFromId(source) local amount = ESX.Math.Round(price) if price > 0 then xPlayer.removeMoney(amount) end end) RegisterServerEvent('fuel:weapon') AddEventHandler('fuel:weapon', function() local _source = source local xPlayer = ESX.GetPlayerFromId(_source) xPlayer.addWeapon("weapon_petrolcan", 4500) end)end[/ICODE] Best regards,
Download
This file is reserved for VIP members.
23 replies
it works 100%
no I don't have access because I didn't make the purchase, but if you made the purchase you would have access to the source code
Nah bro tried it like 10 times and restarted server I even redownloaded it
Nah bro tried it like 10 times and restarted server I even redownloaded it
I'm going to try the resource and I'll keep you posted
[URL unfurl="true"]https://drive.google.com/file/d/1Ki8vRRC8gC13dFHaN9Ki3yKO-8O0_Adi/view?usp=sharing[/URL]
inventory tested server esx legacy version 1.10.3