Skip to content

Commit

Permalink
chore: removal of superfluous code
Browse files Browse the repository at this point in the history
- Remove unnecessary code as it is handled in ox_inventory
  • Loading branch information
bitpredator committed Sep 20, 2023
1 parent 26d6c17 commit de30900
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions server-data/resources/[esx_addons]/esx_basicneeds/server/main.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
CreateThread(function()
for k,v in pairs(Config.Items) do
ESX.RegisterUsableItem(k, function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if v.remove then
xPlayer.removeInventoryItem(k,1)
end
if v.type == "food" then
TriggerClientEvent("esx_status:add", source, "hunger", v.status)
TriggerClientEvent('esx_basicneeds:onUse', source, v.type, v.prop, v.anim)
xPlayer.showNotification(_U('used_food', ESX.GetItemLabel(k)))
elseif v.type == "drink" then
TriggerClientEvent("esx_status:add", source, "thirst", v.status)
TriggerClientEvent('esx_basicneeds:onUse', source, v.type, v.prop, v.anim)
xPlayer.showNotification(_U('used_drink', ESX.GetItemLabel(k)))
else
print(string.format('^1[ERROR]^0 %s has no correct type defined.', k))
end
end)
end
end)

ESX.RegisterCommand('heal', 'admin', function(xPlayer, args, showError)
args.playerId.triggerEvent('esx_basicneeds:healPlayer')
args.playerId.showNotification(_U('got_healed'))
Expand Down

0 comments on commit de30900

Please sign in to comment.