diff --git a/resources/[inventory]/nordi_hookah/client.lua b/resources/[inventory]/nordi_hookah/client.lua index 6adc96d41..c1e9ad529 100644 --- a/resources/[inventory]/nordi_hookah/client.lua +++ b/resources/[inventory]/nordi_hookah/client.lua @@ -174,7 +174,7 @@ function StartShishaSmoking(selectedShisha) -- Create a separate thread to keep the animation playing local smokingActive = true - local smokeThread = CreateThread(function() + CreateThread(function() -- Play animation and keep it playing while smokingActive do if not IsEntityPlayingAnim(ped, animDict, animName, 3) then @@ -185,7 +185,6 @@ function StartShishaSmoking(selectedShisha) end) -- Create smoke effect - local smokeEffect = nil CreateThread(function() RequestNamedPtfxAsset("core") while not HasNamedPtfxAssetLoaded("core") do @@ -212,11 +211,18 @@ function StartShishaSmoking(selectedShisha) smokingActive = false ClearPedTasks(ped) - -- NOW apply effects and show message AFTER smoking is complete + -- Warte einen kurzen Moment, um sicherzustellen, dass alle Threads beendet sind + Wait(500) + + -- JETZT erst die Effekte anwenden und Nachricht anzeigen + Debug("Rauchen vollständig abgeschlossen") TriggerEvent("evidence:client:SetStatus", "weedsmell", 300) TriggerServerEvent('hud:server:RelieveStress', math.random(15, 25)) + + -- Warte noch einen Moment, bevor die Entspannungsnachricht angezeigt wird + Wait(1000) QBCore.Functions.Notify("Du fühlst dich entspannt...", "success") - Debug("Rauchen abgeschlossen, Entspannungseffekte angewendet") + Debug("Entspannungseffekte angewendet") end, function() -- Cancelled -- Clean up if cancelled smokingActive = false