This commit is contained in:
Nordi98 2025-08-11 16:10:18 +02:00
parent 23e3e52966
commit 68151e44fe
11 changed files with 594 additions and 0 deletions

View file

@ -114,6 +114,8 @@ function ConsumeItem(name)
if ProcessingEffect and not Config.Effects[effectName].canOverlap then return end
ProcessingEffect = true
Config.Effects[effectName].process(cfg.effect)
-- Event auslösen
TriggerEvent("pickle_consumables:effectStarted", effectName, cfg.effect, name)
ProcessingEffect = false
end)
end
@ -289,3 +291,11 @@ AddEventHandler('onResourceStart', function(resourceName)
if (GetCurrentResourceName() ~= resourceName) then return end
ValidateItemConfigs()
end)
-- Event-Listener für Alkoholkonsum
AddEventHandler("pickle_consumables:effectStarted", function(effectName, effectData, itemName)
if effectName == "drunk" then
local intensity = effectData.intensity or 1.0
TriggerServerEvent('qb-alcoholtest:server:alcoholConsumed', itemName, intensity)
end
end)