/conde-b1g_inventory

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

conde-b1g_inventory 1.0.0

Inventory HUD for ESX based on TSRAK esx_inventoryhud made by me and B1G https://github.com/CarlosVergikosk.

Most of the code of the shops was taken from SUKU's suku shops for esx_inventoryhud, although some features were added, like ilegal shop, police shop, price easily changeable on the config, and some other spicy stuff :)

The weapons as items part is made like in disc_inventoryhud, and for that reason it uses disc_ammo in which you can easily remove the disc_base dependency if you want!

This resource should work on ESX 1.2, but I use a version before the 1.2 and after the weight update!

You can get it to work with most of esx_inventoryhud plugins, like trunk, property etc.. Check the js file most things come already pre configured!

Most of the notifications are in Portuguese, so if any kind sould want to translate them, that would be apreciated!

I may give some support, but won't 100% guarantee.

That's pretty much it, this is like the ultimate inventory hud that you can have on your ESX server without breaking or leaving your server unplayable, I'll list the features down below.

Requirements

Features

  • Drag and drop
  • Using items
  • Dropping items
  • Giving items
  • Cash included
  • Accounts support (bank, black money, ...)
  • Weight Supported
  • Weapons as items
  • 5 Usable Fast Items hotbar: 1, 2 ,3 ,4 ,5 keys
  • Blocked Weapon Wheel
  • Inventory items notification (anytime you receive or lose an item, check installation for more info)
  • Fast items Hotbar , ALT is the default key.
  • Animations with props, when you give an item. Check the config to add more props to each item!
  • Integrated status hud, so you can have a clean hud while you play!
  • Easy shortcuts to use items, double click uses the item and closes the inventory, right click puts the item on fast item hotbar or in the second inventory.
  • Steal the body of a dead or handcuffed player!
  • Optimized
  • Some other stuff, I'll probably remember later :)

Screens

Commands

  • /steal - Steals nearby player's inventory
  • /closeinventory - Closes the inventory if needed

Installation

  • Download the code and change the folder name to conde-b1g_inventory
  • This should be pretty much drag and drop, change the essentialmode on the sql file to whatever is your database name, and run it.
  • To add the notifications, just trigger this event on your es_extended classes/player functions. Ex: addInventoryItem, removeInventoryItem, addMoney, removeMoney:
	self.addMoney = function(money)
		money = ESX.Math.Round(money)

		if money >= 0 then
			self.player.addMoney(money)
			TriggerClientEvent('conde-inventoryhud:notification',self.source, "cash", "Money", money, false)
		end
	end

	self.removeMoney = function(money)
		money = ESX.Math.Round(money)

		if money > 0 then
			self.player.removeMoney(money)
			TriggerClientEvent('conde-inventoryhud:notification',self.source, "cash", "Money", money, true)
		end
	end
	
	
		self.addInventoryItem = function(name, count)
		local item = self.getInventoryItem(name)

		if item then
			count = ESX.Math.Round(count)

			local newCount = item.count + count
			item.count = newCount

			TriggerEvent('esx:onAddInventoryItem', self.source, item.name, item.count)
			self.triggerEvent('esx:addInventoryItem', item.name, item.count)
			TriggerClientEvent('conde-inventoryhud:notification', self.source, item.name, item.label, count, false)
		end
	end

	self.removeInventoryItem = function(name, count)
		local item = self.getInventoryItem(name)

		if item then
			count = ESX.Math.Round(count)
			local newCount = item.count - count

			if newCount >= 0 then
				item.count = newCount

				TriggerEvent('esx:onRemoveInventoryItem', self.source, item.name, item.count)
				self.triggerEvent('esx:removeInventoryItem', item.name, item.count)
				TriggerClientEvent('conde-inventoryhud:notification',self.source, item.name, item.label, count, true)
			end
		end
	end
  • To make the status to work just change the events on line 250 client/main of the inventory, to your basic needs or stress events.