[Free] Ox Inventory

we have the same issue and we have the latest release version

yeah, im so confused

dm me
Screenshot (1120)

1 Like

Hi my friends there is a way to transform the marker when I throw an item on the ground by a box or something like that please ?

need help i’m using ox inventory but i can’t able to add mf allhousing script

please help me??/

When you die, you don’t disappear from the inventory. Can you help me fix the error ?

ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(source, cb)
	local xPlayer = ESX.GetPlayerFromId(source)

	if Config.RemoveCashAfterRPDeath then
		if xPlayer.getMoney() > 0 then
			xPlayer.removeMoney(xPlayer.getMoney())
		end

		if xPlayer.getAccount('black_money').money > 0 then
			xPlayer.setAccountMoney('black_money', 0)
		end
	end

	if Config.RemoveItemsAfterRPDeath then
		for i=1, #xPlayer.inventory, 1 do
			if xPlayer.inventory[i].count > 0 then
				xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
			end
		end
	end

	local playerLoadout = {}
	if Config.RemoveWeaponsAfterRPDeath then
		for i=1, #xPlayer.loadout, 1 do
			xPlayer.removeWeapon(xPlayer.loadout[i].name)
		end
	else -- save weapons & restore em' since spawnmanager removes them
		for i=1, #xPlayer.loadout, 1 do
			table.insert(playerLoadout, xPlayer.loadout[i])
		end

		-- give back wepaons after a couple of seconds
		Citizen.CreateThread(function()
			Citizen.Wait(5000)
			for i=1, #playerLoadout, 1 do
				if playerLoadout[i].label ~= nil then
					xPlayer.addWeapon(playerLoadout[i].name, playerLoadout[i].ammo)
				end
			end

		end)
	end

	cb()
end)

3 Likes

Hey, how to connect stash to policejob or any other?

The script works great the only problem i am having is

When equipping a weapon i am able to unequip and reequip for around a time period of 10 seconds. anything longer than that or if i aim the weapon. then the weapon is stuck in my hand and i cannot access my inventory. to store it. i just get “cannot access inventory”

[ script:ox_inventory] > ref (@ox_lib/addCommand/server.lua:89)
[ script:ox_inventory] SCRIPT ERROR: @ox_inventory/modules/inventory/server.lua:1345: attempt to index a nil value (local ‘inventory’)
[ script:ox_inventory] > callback (@ox_inventory/modules/inventory/server.lua:1345)
[ script:ox_inventory] > ref (@ox_lib/addCommand/server.lua:89)
[ script:es_extended] [INFO] Saved 2 players over 0.0 ms

For anyone in the future reading this i set the > setr inventory:autoreload from false to true and this fixed the issue for me…

Decided to come back and just say this inventory is absolutely amazing great work! this thing will defiantly make a server look clean as hell. The added shops are a bonus! and look great too!

1 Like

i can’t use jerry can, i configure it with LegacyFuel ? how to fix this?

does this inventory come with a crafting system? i believe i read somewhere that it does and it allows me to define a recipe for items in the items data but im not sure how to craft them ingame. i dont want to use a specific crafting location.

1 Like

need some help with adding item to inventory i get this error when it gets to the add export

image

1 Like

dont connect. use its stash function?

Hello, sorry if this has been adressed already,
i’ve addded items from purchased atm robbery script and added them. i can spawn them in, however i’m having trouble making them usable. any help is greatly appreciated.
cheers.

hi i have a question if i want to change or edit the CSS how can I do it

Hello, to make changes to the UI, you have to make your changes, then re-build the UI (node/yarn) as explained in the documentation.

Hello,
You have to define your callbacks i assume, using exports.

in data/items.lua :

['your_item'] = {
	label = 'Your Item,
	....
	client = {
		....
		export = 'your_ressource_name.your_export_name'
	}
}

in your resource :

exports('your_export_name', function()
... your logic goes here ...
end)

Check the documentation about items creation, it may not be obvious, but once you get it, it’s pretty easy

Hope it helps, have fun

1 Like

Thanks, this is the greatest inventory!

1 Like

How can I check if a player’s inventory is empty or not? I did not find a solution in the documentation. And how can I disable all inventory controls for a particular activity?

hi everyone in my server I have 2 jobs one for legal jobs and the other for gangs, I would like to know how to open the stash while also checking the second job