Skip to content

The ACTUAL real code for the inventoryhud that is not broken

License

Notifications You must be signed in to change notification settings

brynnie1/disc-inventoryhud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[ESX] [DISC] disc-inventoryhud

The ACTUAL real code for the inventoryhud that is not broken

ESX Compatibility

This is a fork for use with the inventory Rex's ESX

Events

Add Item Event

TriggerEvent('disc-inventoryhud:addItem', source, name, count)

Remove Item Event

Can only be used in Item Use Callback

TriggerEvent('disc-inventoryhud:removeItem', source, item.Id, 1, item.Slot, item.Inventory)

Register Item for Use

TriggerEvent('disc-inventoryhud:registerItemUse', item, cb)

Example (Courtesy of esx_basicneeds)

TriggerEvent('disc-inventoryhud:registerItemUse', "water", function(source, item)
	local xPlayer = ESX.GetPlayerFromId(source)
	TriggerEvent('disc-inventoryhud:removeItem', source, item.Id, 1, item.Slot, item.Inventory)

	TriggerClientEvent('esx_status:add', source, 'thirst', 200000)
	TriggerClientEvent('esx_basicneeds:onDrink', source)
	TriggerClientEvent('esx:showNotification', source, _U('used_water'))
end)

Check Has Item

TriggerEvent('disc-inventoryhud:hasItem', source, 'bread', function(hasItem)
    if hasItem then
        print('Has Item')
    else
        print('No Item')
    end
end)

REQUIREMENTS

disc-base repo

BETA

This version contains everything besides shops and weapons.

Stream

I stream on Twitch. Come hang out and learn from me!

Other Downloads

Other Downloads available on my repo

About

The ACTUAL real code for the inventoryhud that is not broken

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 57.7%
  • JavaScript 41.0%
  • Other 1.3%