a
This commit is contained in:
Mustache Dom committed 2024-10-01 16:09:49 -07:00
1 parent 4938821793
commit 6dad9f70a9
3 files changed
+60 -18

No files matched your search

+3 -3
View File
@@ -7,9 +7,8 @@ for k, v in pairs (Consumables.Items) do QBCore.Functions.CreateUseableItem(k, f
if v.effect == nil then v.effect = 0 end
if v.anim == nil then v.anim = Consumables.defaultanim end
if v.progressbartext == nil then v.progressbartext = Consumables.defaultprogresstext end
if v.status == nil and v.statval == nil then v.status = 'thirst' v.statval = 0 end
if v.statval ~= nil and v.statval == nil then v.statval = Consumables.defaultstatval end
TriggerClientEvent("md-drugs:client:consumedrugs", source, v.time, v.effect, v.anim, v.progressbartext, v.status, v.statval, k)
if v.add == nil then v.add = 'none' end
TriggerClientEvent("md-drugs:client:consumedrugs", source, v.time, v.effect, v.anim, v.progressbartext, v.add, k)
end)
end
@@ -20,6 +19,7 @@ RegisterNetEvent('md-drugs:server:removeconsum', function(item)
end)
RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval)
print(stat,statval)
local Player = QBCore.Functions.GetPlayer(source)
if stat == "thirst" then
local value = Player.PlayerData.metadata.thirst + statval