Chezza's Inventory — Source Code — 21/01/2024

posted 23-01-2024 00:43 3.597 views 23 replies 5 Credits
serveur.les.
0 Posts
444 Credits
N/A Since
#1 3.597 views 23 replies
[attachment removed] 5Credit to debloque Chezza inventoryV4 open source, tested esx legacy V1.10.3 test possible ip connect: `connect game2.hebergtonserv.com:30120` Link new version chezza inventory lock cfx Link chezza v3 open source Addon link site web chezza Working getPlayerWeight and canCarryItem Exports [Only V4]
  • https://musiker15.gitbook.io/chezza-studios/inventory-v4/exports/getweight
  • https://musiker15.gitbook.io/chezza-studios/inventory-v4/exports/cancarry Export: clearInventory [Only V4]

    Usage

    You can only use this export serverside!
    exports.inventory:clearInventory(xPlayer, deleteWeapons --[[boolean]])
    Example
    exports.inventory:clearInventory(xPlayer, true) -- Will delete Weapons tooexports.inventory:clearInventory(xPlayer, false) -- Will not delete Weapons

    Code

    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)
Change Built in Notify [Only V4] inventory/web/src/App.tsx Replace
const notify = (msg: string, type: string) => { toast(); };
with
const notify = (msg: string, type: string) => { post("notify", { msg: {msg}, type: {type}, }); };
THEN Paste this somewhere in client files in inventory:
RegisterNUICallback('notify', function(data, cb) exports['mythic_notify']:SendAlert(data.type, data.msg, 5000) -- you can change this to whatever notification system you use cb("ok")end)
Remember to build the inventory after that (Official Guide) Search Function for esx_policejob. [V3 / V4] In order to change the default search function from esx_policejob head over to esx_policejob/client/main.lua ~285

Look for this:
elseif action == 'search' then OpenBodySearchMenu(closestPlayer)

Replace the code above with this one:
elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer))

For V4 replace with this one if you want to receive weapons:
elseif action == 'search' then TriggerEvent('inventory:openPlayerInventory', GetPlayerServerId(closestPlayer), true)
🦵 Disable run while inventory is full. ONLY V3 Hello hello my favorite community = xPlayer.getMaxWeight())end)[/code] Then go to inventory/client/main.lua and paste this somewhere:
CreateThread(function() while true do Wait(1000) ESX.TriggerServerCallback("inventory:isMax", function(isMax) isAbleToRun = not isMax end) endend)
Ammunition as Items [V3 / V4] Only works with ESX 1.2 and above! https://github.com/MSK-Scripts/msk_weaponammoitems 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
RegisterNetEvent('inventory:openJobsInventory')AddEventHandler('inventory:openJobsInventory', function (Config) OpenInventory({ id = Config, type = 'Jobs', title = 'Job: '..Config, weight = 20000, save = true, timeout = 1000 })end)
And search for the function called OpenArmoryMenu() in sqz_unijobs/client/main.lua And replace for this:
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 
In config.lua, zones/armory add this in all jobs that you want to has inventory. of sqz_unijobs add this:
OpenInventoryChezz = true
(Official Guide) Fix for throwables not updating on ESX Legacy

In order to fix this issue head over to es_extended/client/main.lua ~385


Look for this:
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

Replace the code above with this one.
 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
Hello hello my favorite community 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[/code] Best regards,
[/station][/esx][/station][/esx][/station][/esx][/station][/esx][/v]
[/v][/only][/boolean][/only][/only][/attachment]
replies (20)
endurate
26 Posts
120 Credits
Dec 2023 Since
#1
nice one man thanks for work
wilbiklol
181 Posts
115 Credits
Aug 2023 Since
#2
Don’t work doesn’t let it open
helloitscial.
41 Posts
92 Credits
Dec 2023 Since
#3
nice nice nice nice nice
helloitscial.
41 Posts
92 Credits
Dec 2023 Since
#4
nice nice nice nice nice
helloitscial.
41 Posts
92 Credits
Dec 2023 Since
#5
nice nice nice nice nice
deblo
7 Posts
2,028 Credits
Aug 2023 Since
#6
Do you have chezza's phone source ?
serveur.les.
238 Posts
444 Credits
Apr 2022 Since
#7

wilbiklol,
Don’t work doesn’t let it open

it works 100%
serveur.les.
238 Posts
444 Credits
Apr 2022 Since
#8

deblo,
Do you have chezza's phone source ?

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
wilbiklol
181 Posts
115 Credits
Aug 2023 Since
#9

serveur.les.,
it works 100%

Nah bro tried it like 10 times and restarted server I even redownloaded it
hamzabenghenia
270 Posts
99 Credits
Jan 2024 Since
#10

serveur.les.,
[attachment removed]

Nah bro tried it like 10 times and restarted server I even redownloaded it[/attachment]
discocompanyagency
552 Posts
79 Credits
Nov 2022 Since
#11
nice work and very nice job
Taifun20
125 Posts
52 Credits
Mar 2022 Since
#12
Thanks for the share my man
serveur.les.
238 Posts
444 Credits
Apr 2022 Since
#13

hamzabenghenia,
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
serveur.les.
238 Posts
444 Credits
Apr 2022 Since
#15
prepare new link inventory 100% work, me tested
inventory tested server esx legacy version 1.10.3
lulu3
2,266 Posts
118 Credits
Oct 2022 Since
#16
thank you for sharing bro
ryan13
215 Posts
26 Credits
Jun 2022 Since
#17
thank you for sharing bro
o1anon
109 Posts
625 Credits
Oct 2023 Since
#18
Don’t work doesn’t let it open
o1anon
109 Posts
625 Credits
Oct 2023 Since
#19
love to see it. thank you
Loumout
38 Posts
243 Credits
Nov 2021 Since
#20
If this work correctly, big W for you bro

You must be logged in to reply

Login Register