mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-17 06:26:03 +01:00
feat: Notify config progressbar config & canrun while consume in config
This commit is contained in:
committed by
GitHub
parent
a6f6492d5b
commit
a0c83c0e1f
@@ -6,7 +6,6 @@ for k, v in pairs(Config.Consumables) do
|
||||
if not Config.Emotes[v.emote] then print("Emote check - '"..k.."' requested emote '"..v.emote.."' - not found in config.lua") end
|
||||
end
|
||||
|
||||
|
||||
RegisterNetEvent('jim-consumables:server:toggleItem', function(give, item, amount)
|
||||
local src = source
|
||||
if give == 0 or give == false then
|
||||
@@ -18,4 +17,18 @@ RegisterNetEvent('jim-consumables:server:toggleItem', function(give, item, amoun
|
||||
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount or 1)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('jim-consumables:server:addThirst', function(amount)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
if not Player then return end
|
||||
Player.Functions.SetMetaData('thirst', amount)
|
||||
TriggerClientEvent('hud:client:UpdateNeeds', source, Player.PlayerData.metadata.hunger, amount)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('jim-consumables:server:addHunger', function(amount)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
if not Player then return end
|
||||
Player.Functions.SetMetaData('hunger', amount)
|
||||
TriggerClientEvent('hud:client:UpdateNeeds', source, amount, Player.PlayerData.metadata.thirst)
|
||||
end)
|
||||
Reference in New Issue
Block a user